THU-MAIC / THU-MAIC/OpenMAIC

[Feature]: AI 物理/数学交互式模拟辅导工具一个新的功能扩展和新的界面,欢迎大家访问https://gitee.com/uncle-stone/PhysiMindAI

Open
#363 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
37.7k
Forks
5.9k
Avg merge
1d 3h
Merged PRs (30d)
193

Description

### Problem or Motivation

Image
Image
Image
Image
Image项目设计文档:AI 物理/数学交互式模拟辅导工具
========================
Duplicate of #
**项目代号:** PhysiMind Simulator
**版本:** V1.0
**设计者:** AI 应用专家
**核心目标:** 利用 AI 编程智能体,将抽象的物理/数学问题转化为可视化的、可交互的 JavaScript/TypeScript 动态模拟,实现“一图胜千言”的沉浸式学习。

* * *

1. 系统架构设计

---------

系统采用 **“前端沙箱 + 智能体编排”** 的架构。AI 不仅仅是聊天机器人,更是能够编写、调试、运行代码的“虚拟工程师”。

### 1.1 核心组件

1. **多模态输入处理器 (Multimodal Input):**

* **文本输入:** 接收学生输入的题目文本。

* **OCR 识别模块:** 接收图片,利用多模态大模型(如 GPT-4V, Claude-3.5 Sonnet 等)提取图片中的公式和文字,转化为结构化文本。

2. **物理/数学语义分析器 (Physics-Math Parser):**

* 利用大模型(LLM)进行实体抽取:识别题目中的对象(质点、小车、球体)、参数(质量、初速度、摩擦系数)、关系(牛顿第二定律、动量守恒、几何相似性)。

3. **模型推演与代码生成引擎 (AI Coding Agent):**

* 这是系统的核心。AI 根据分析结果,生成完整的 HTML/CSS/JS (Three.js / Canvas / p5.js) 代码。

* **关键点:** 采用 **ReAct (Reasoning + Acting)** 模式。AI 生成代码 -> 模拟执行 -> 若报错或不符合物理直觉 -> 自我修正 -> 重新生成。

4. **Web 渲染沙箱 (Web Sandbox):**

* 一个安全的 iframe 或 Web Component 容器,用于动态执行 AI 生成的代码,实时展示动画和交互控件(滑块、按钮)。

### Proposed Solution

5. **知识库与讲解模块 (RAG):**

* 建立向量数据库,存储物理/数学定理、常见误区、解题步骤。AI 在生成模拟后,结合 RAG 检索,生成结构化的讲解文案。

6. **项目持久化 (Project Storage):**

* 将习题的原始数据、生成的模拟代码、讲解内容保存至云端或本地

### Alternatives Considered

. **Step 1: 提取参数**

* _Input:_ 题目截图/文本。

* _AI Action:_ 输出 JSON 格式的参数表。

* _Example:_ `{"object": "ball", "initial_velocity": 10, "angle": 30, "gravity": 9.8}`。

2. **Step 2: 生成模拟代码 (Coding)**

* _AI Action:_ 调用代码生成模型,基于预置的 `BaseSimulationTemplate` (包含 requestAnimationFrame, 欧拉积分法),填入具体的物理逻辑和绘图逻辑。

3. **Step 3: 虚拟执行与调试 (Virtual Execution)**

* _Mechanism:_ 系统在服务器端(或客户端 Web Worker)静默执行生成的代码,检查是否存在 `TypeError` 或 `SyntaxError`。

* _Self-Correction:_ 如果报错,将错误日志返回给 AI,AI 进行“反思”并重试(最多 3 次)。

4. **Step 4: 交互增强**

* _AI Action:_ 自动在画布下方生成 **``** 控件,绑定物理参数(如初速度、质量)。学生滑动滑块,模拟实时响应,直观感受参数对结果的影响。

### Area

Classroom generation

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Research direction

The proposal names no repository files, tests, or implementation entry points. Start by reviewing the project architecture and the referenced PhysiMindAI project, then clarify which component is in scope: input processing, code generation, sandbox execution, RAG explanations, or storage. Done requires an agreed scope and acceptance criteria for the selected classroom feature.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
ai, full-stack, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.