DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.
Python ai-agentsai-tutorclawbotcli-tooldeepresearchinteractive-learninglearningmulti-agent-systemsrag
fix: improv cli
Bingxi Zhao (Frank)e11db5001b2d
diff --git a/deeptutor/agents/base_agent.py b/deeptutor/agents/base_agent.pyindex 1f6ea1593..c6b8b3f11 100644--- a/deeptutor/agents/base_agent.py+++ b/deeptutor/agents/base_agent.py@@ -54,7 +54,7 @@ class BaseAgent(ABC):model: str | None = None,api_version: str | None = None,language: str = "zh",- binding: str = "openai",+ binding: str | None = None,config: dict[str, Any] | None = None,token_tracker: Any | None = None,log_dir: str | None = None,@@ -106,7 +106,7 @@ class BaseAgent(ABC):self.base_url = base_url or os.getenv("LLM_HOST")self.model = model or os.getenv("LLM_MODEL")self.api_version = api_version or os.getenv("LLM_API_VERSION")- self.binding = binding+ self.binding = binding or os.getenv("LLM_BINDING", "openai")# Get Agent-specific configuration (if config provided)self.agent_config = self.config.get("agents", {}).get(agent_name, {})diff --git a/deeptutor/agents/question/agents/idea_agent.py b/deeptutor/agents/question/agents/idea_agent.pyindex 8c715b834..8b8aab3f8 100644--- a/deeptutor/agents/question/agents/idea_agent.py+++ b/deeptutor/agents/question/agents/idea_agent.py@@ -190,7 +190,7 @@ class IdeaAgent(BaseAgent):"Existing concentrations:\n{existing_concentrations}\n""Knowledge context:\n{knowledge_context}\n\n""Generate {num_ideas} candidate question ideas.\n"- 'Return JSON {"ideas":[{"concentration":"","question_type":"","difficulty":"","rationale":""}]}'+ 'Return JSON {{"ideas":[{{"concentration":"","question_type":"","difficulty":"","rationale":""}}]}}')constraints: list[str] = []diff --git a/deeptutor/capabilities/deep_research.py b/deeptutor/capabilities/deep_research.pyindex 2c9385904..c22e7e334 100644--- a/deeptutor/capabilities/deep_research.py+++ b/deeptutor/capabilities/deep_research.py@@ -8,6 +8,7 @@ Wraps ``ResearchPipeline`` as a first-class built-in capability.from __future__ import annotations+import asynciofrom typing import Anyfrom deeptutor.capabilities.request_contracts import get_capability_request_schema@@ -101,7 +102,7 @@ class DeepResearchCapability(BaseCapability):str(data.get("message") or status or data.get("type") or "").strip(),)- async def _progress_cb(data: dict[str, Any]) -> None:+ async def _emit_progress(data: dict[str, Any]) -> None:raw_stage = str(data.get("stage") or "researching")stage = _normalize_stage(raw_stage)status = str(data.get("status") or data.get("type") or "")@@ -123,6 +124,13 @@ class DeepResearchCapability(BaseCapability):},)+ def _progress_cb(data: dict[str, Any]) -> None:+ try:+ loop = asyncio.get_running_loop()+ except RuntimeError:+ return+ loop.create_task(_emit_progress(data))+def _label_from_update(update: dict[str, Any], stage: str) -> str:agent_name = str(update.get("agent_name") or "")raw_stage = str(update.get("stage") or "")diff --git a/deeptutor/services/llm/utils.py b/deeptutor/services/llm/utils.pyindex 310d5a279..4b8aa5789 100644--- a/deeptutor/services/llm/utils.py+++ b/deeptutor/services/llm/utils.py@@ -200,6 +200,20 @@ def build_completion_url(return url+def _extract_content_field(content: object) -> str:+ if isinstance(content, list):+ parts: list[str] = []+ for part in content:+ if isinstance(part, Mapping) and "text" in part:+ parts.append(str(part["text"]))+ elif isinstance(part, str):+ parts.append(part)+ return "".join(parts)+ if content is None:+ return ""+ return str(content)++def extract_response_content(message: object) -> str:"""Extract textual content from response payloads."""if message is None:@@ -209,20 +223,30 @@ def extract_response_content(message: object) -> str:return messageif isinstance(message, Mapping):- content = message.get("content")- if isinstance(content, list):- parts: list[str] = []- for part in content:- if isinstance(part, Mapping) and "text" in part:- parts.append(str(part["text"]))- elif isinstance(part, str):- parts.append(part)- return "".join(parts)- if content is not None:- return str(content)- if "text" in message:+ content = _extract_content_field(message.get("content"))+ if content:+ return content+ if "text" in message and message["text"] is not None:return str(message["text"])+ # LiteLLM/OpenAI SDK response models often expose attributes instead of dict keys.+ if hasattr(message, "content"):+ content = _extract_content_field(getattr(message, "content"))+ if content:+ return content+ if hasattr(message, "text"):+ text_value = getattr(message, "text")+ if text_value is not None:+ return str(text_value)++ if hasattr(message, "model_dump"):+ try:+ dumped = message.model_dump()+ except Exception:+ dumped = None+ if dumped is not None and dumped is not message:+ return extract_response_content(dumped)+return str(message)diff --git a/deeptutor/services/notebook/service.py b/deeptutor/services/notebook/service.pyindex 6e80883ca..c35a04b5a 100644--- a/deeptutor/services/notebook/service.py+++ b/deeptutor/services/notebook/service.py@@ -238,7 +238,8 @@ class NotebookManager:) -> dict:record_id = str(uuid.uuid4())[:8]now = time.time()- resolved_type = RecordType(str(record_type))+ # Accept both enum instances and plain string values from callers.+ resolved_type = record_type if isinstance(record_type, RecordType) else RecordType(str(record_type))record = {"id": record_id,@@ -410,4 +411,3 @@ def get_notebook_manager() -> NotebookManager:notebook_manager = get_notebook_manager()-diff --git a/deeptutor/services/prompt/manager.py b/deeptutor/services/prompt/manager.pyindex be95cb955..c1820554a 100644--- a/deeptutor/services/prompt/manager.py+++ b/deeptutor/services/prompt/manager.py@@ -83,26 +83,34 @@ class PromptManager:subdirectory: str | None,) -> dict[str, Any]:"""Load prompt file with language fallback."""- # Handle modules that are not under deeptutor/agents/- if module_name in self.NON_AGENT_MODULES:- prompts_dir = PROJECT_ROOT / "src" / module_name / "prompts"- else:- prompts_dir = PROJECT_ROOT / "src" / "agents" / module_name / "prompts"+ prompt_dirs = self._candidate_prompt_dirs(module_name)fallback_chain = self.LANGUAGE_FALLBACKS.get(lang_code, ["en"])- for lang in fallback_chain:- prompt_file = self._resolve_prompt_path(prompts_dir, lang, agent_name, subdirectory)- if prompt_file and prompt_file.exists():- try:- with open(prompt_file, encoding="utf-8") as f:- return yaml.safe_load(f) or {}- except Exception as e:- print(f"Warning: Failed to load {prompt_file}: {e}")- continue+ for prompts_dir in prompt_dirs:+ for lang in fallback_chain:+ prompt_file = self._resolve_prompt_path(prompts_dir, lang, agent_name, subdirectory)+ if prompt_file and prompt_file.exists():+ try:+ with open(prompt_file, encoding="utf-8") as f:+ return yaml.safe_load(f) or {}+ except Exception as e:+ print(f"Warning: Failed to load {prompt_file}: {e}")+ continueprint(f"Warning: No prompt file found for {module_name}/{agent_name}")return {}+ def _candidate_prompt_dirs(self, module_name: str) -> list[Path]:+ """Return legacy and current prompt roots for a module."""+ if module_name in self.NON_AGENT_MODULES:+ legacy_dir = PROJECT_ROOT / "src" / module_name / "prompts"+ current_dir = PROJECT_ROOT / "deeptutor" / module_name / "prompts"+ return [legacy_dir, current_dir]++ legacy_dir = PROJECT_ROOT / "src" / "agents" / module_name / "prompts"+ current_dir = PROJECT_ROOT / "deeptutor" / "agents" / module_name / "prompts"+ return [legacy_dir, current_dir]+def _resolve_prompt_path(self,prompts_dir: Path,diff --git a/deeptutor_cli/main.py b/deeptutor_cli/main.pyindex 8d31f12d2..1086f6b4b 100644--- a/deeptutor_cli/main.py+++ b/deeptutor_cli/main.py@@ -199,12 +199,19 @@ def animate(message: str = typer.Argument(..., help="Animation prompt."),session: str | None = typer.Option(None, "--session", help="Existing session id."),language: str = typer.Option("en", "--language", "-l", help="Response language."),- output_mode: str = typer.Option("video", "--output-mode", help="video | frames | storyboard"),+ output_mode: str = typer.Option(+ "video",+ "--output-mode",+ help="video | image (legacy aliases: frames | storyboard)",+ ),quality: str = typer.Option("medium", "--quality", help="low | medium | high"),style_hint: str = typer.Option("", "--style-hint", help="Visual style hint."),fmt: str = typer.Option("rich", "--format", "-f", help="Output format: rich | json."),) -> None:"""Alias for ``run math_animator``."""+ normalized_output_mode = output_mode+ if output_mode in {"frames", "storyboard"}:+ normalized_output_mode = "image"_run_alias(capability="math_animator",message=message,@@ -216,7 +223,7 @@ def animate(language=language,fmt=fmt,config_items=[- f"output_mode={output_mode}",+ f"output_mode={normalized_output_mode}",f"quality={quality}",f"style_hint={style_hint}",],diff --git a/paper/COMMENTS.md b/paper/COMMENTS.mdindex c408525a7..8b7b5a64e 100644--- a/paper/COMMENTS.md+++ b/paper/COMMENTS.md@@ -1,257 +1,19 @@-COMMENTS COLLECTION+# Evaluation Summary - Overall-reviewer 1:-这是一份基于 ACL ARR 评分标准,针对该论文前三章(摘要、引言、相关工作、方法)的顶尖学术审稿人意见:+- Generated at: 2026-03-14T16:09:36.638022+- Output root: `/data2/zjh/DeepTutor/benchmark/data/bench_pipeline`+- Eval files: 15+- Backends: 5-### 1. Paper Summary (论文摘要)-本文提出了一种名为 **DeepTutor** 的个性化智能辅导系统(Agentic Tutoring System)。该系统首次将工具增强的问题解答(Problem-Solving)与难度校准的问题生成(Question Generation)整合到一个闭环的交互过程中。其核心创新在于提出了“混合个性化引擎(Hybrid Personalization Engine)”,该引擎结合了静态知识增强(多模态 RAG)和动态个人记忆(Trace Forest)。通过记录多分辨率的交互轨迹,系统能够持续更新包含会话历史、用户弱点和系统自省的三个维度的学习者画像,从而实现问题解答与问题生成之间的双向任务耦合。+## Metrics Table-### 2. Summary of Strengths (主要优点)-1. **创新的闭环框架 (Novel Closed-Loop Framework)**:将“解题”和“出题”通过共享的记忆结构(Trace Forest)连接成闭环,这一设计非常符合真实的教育学原理。以往的工作大多孤立地处理这两个任务,本文的统一架构具有很高的启发性。-2. **精细化的记忆机制 (Comprehensive Memory Design)**:Trace Forest 的层次化设计(从会话级总结到细粒度的执行记录)以及三维度的学习者画像($\mathcal{D}_s, \mathcal{D}_w, \mathcal{D}_r$)有效克服了现有系统仅依赖粗粒度技能评分的缺陷,为 LLM 提供了丰富的个性化上下文。-3. **鲁棒的模块化流水线 (Robust Pipeline Architecture)**:方法部分对解题(调查-逐步求解-迭代写作)和出题(对抗式生成-验证)的拆解非常合理。特别是引入了层次化压缩(Hierarchical compression)来防止上下文窗口溢出,以及独立的验证器(Validator)来减少幻觉,这些工程设计都非常扎实。-### 3. Summary of Weaknesses (主要缺点)-1. **Trace Forest 的技术细节略显不足 (Lack of Detail in Trace Forest)**:虽然 Trace Forest 的概念很吸引人,但方法部分对其具体实现(如:节点嵌入 $\mathbf{e}_v$ 是如何生成和更新的?TraceToolkit 的 \textsc{SearchTrace} 是基于什么相似度度量?)描述不够具体,可能会影响复现性。-2. **“对抗式”术语的使用可能被夸大 (Overstated Terminology)**:在 2.4 节(Stage 4)中,作者使用了“Adversarial Q-A Pair Generation”。但从描述来看,这更像是一个标准的“生成-验证-反馈-修改”(Generate-and-Verify with Feedback)流水线,并没有体现出博弈论意义上的对抗训练。建议修改术语或进一步澄清其对抗性体现在何处。-3. **计算开销与延迟的考量缺失 (Complexity and Latency Concerns)**:系统包含多个 LLM Agent、多模态 RAG、代码沙箱执行以及复杂的记忆更新机制。对于一个“实时交互式”辅导系统而言,推理延迟和计算成本是致命的。方法部分完全没有讨论系统在实际运行中的效率问题。-4. **图表与算法的对应关系 (Formatting and Flow)**:Algorithm 1 非常密集,包含了大量符号(如 $\mathcal{I}, \mathcal{T}_i, f_i$),虽然在正文中有所提及,但读者在阅读算法伪代码时仍会感到吃力。+| Backend | Profiles | Faith | Personal. | Applic. | Vivid. | Logic | Faith Fail | Teach Fail | PQ Fail | PQ Fitness | PQ Ground | PQ Diversity | PQ AnsQual | PQ Cross |+| ------------------------ | -------- | ------ | --------- | ------- | ------ | ------ | ---------- | ---------- | ------- | ---------- | --------- | ------------ | ---------- | -------- |+| deep_tutor | 3 | 3.6465 | 4.5737 | 4.7111 | 4.7995 | 4.6269 | 0.00% | 0.00% | 0.00% | 4.1111 | 2.8222 | 3.1556 | 4.5556 | 3.5334 |+| deep_tutor_no_memory | 3 | 3.2921 | 4.1556 | 4.6878 | 4.7778 | 4.6222 | 0.00% | 0.00% | 0.00% | 3.6500 | 2.7555 | 3.0778 | 4.2389 | 3.3278 |+| deep_tutor_no_rag | 3 | 3.3750 | 4.0677 | 4.6635 | 4.7984 | 4.5570 | 0.00% | 0.00% | 0.00% | 3.7333 | 2.6667 | 3.0889 | 4.2667 | 3.4667 |+| deep_tutor_no_rag_memory | 3 | 3.2738 | 4.0667 | 4.7094 | 4.7026 | 4.6616 | 0.00% | 0.00% | 0.00% | 3.9556 | 2.7111 | 2.8444 | 4.3111 | 3.2222 |+| mock | 3 | 3.2998 | 3.8615 | 4.5272 | 3.9509 | 4.0719 | 0.00% | 0.00% | 0.00% | 4.0222 | 2.8000 | 2.7111 | 4.2445 | 3.2667 |-### 4. Comments/Suggestions/Typos (详细意见/建议/拼写错误)-* **Abstract**: 第73行 "They are unified through..." 中的 "They" 指代略显模糊,建议改为 "These two tasks are unified..."。同句中 "trace forest that continuously refines" 建议加冠词改为 "a trace forest that..."。-* **Introduction**: 第11行 "An effective human tutor does far more than supply correct answers--it diagnoses..." 使用 "it" 来指代 human tutor 不太自然,建议改为 "they diagnose" 或 "he/she diagnoses"。-* **Method (Section 2.2.1)**: 在介绍倒数秩融合(Reciprocal Rank Fusion)时,公式是标准的,但建议简要补充图检索(Graph-based retrieval)是如何对其候选节点进行初始排序($\mathrm{rank}_r(d)$)的。-* **Method (Section 2.3)**: Stage 1 提到“investigating before planning prevents sub-goals that are too vague”。这是一个非常好的洞察!强烈建议在这里用半句话补充一个具体的例子(例如:“相比于生成‘复习微积分’,系统会生成‘复习链式法则在三角函数中的应用’...”),这会大大增强文章的表达力。-### 5. Soundness (合理性评分及评价)-**评分: 4 (Strong)**-**评价**: 该研究的动机明确,方法设计逻辑严密,特别是在教育学理论(如诊断误区、支架式解释)与 LLM Agent 架构的结合上做得非常出色。如果能进一步补充关于检索排序细节和系统延迟的讨论,合理性将无可挑剔。--### 6. Excitement (兴奋度评分及评价)-**评分: 4.5 (Highly Exciting/Exciting)**-**评价**: 这是一篇令人兴奋的论文。将大模型应用于教育领域的痛点抓得很准,Trace Forest 和闭环反馈机制的设计为个性化 AI 导师提供了一个极具潜力的范式。我非常期待看到后续的实验结果(TutorBench)如何证明这一复杂系统的有效性。--### 7. Overall Assessment (总体评价)-**评分: 4 (Conference - Accept)**-**评价**: 仅从前三章来看,本文具备被顶级会议(如 ACL/EMNLP)接收的强大潜力。文章结构清晰,插图精美(Figure 1 和 Figure 2 质量很高),核心贡献(DeepTutor 框架和 Trace Forest)具有显著的创新性。建议作者在修改时重点提升方法细节的透明度(尤其是记忆检索机制),并适当降温部分略显夸大的术语(如 Adversarial)。---reviewer 2:-## 主要问题-1. **核心新颖性主张偏强,但在前三章范围内没有被充分论证。** 摘要和引言都使用了 `the first` 级别的表述,但当前我看到的前三章还没有给出足够严谨的任务分解、系统边界定义,或与现有 personalized tutoring / agentic RAG / question generation 系统的逐项对比,因此这类 claim 在 ARR 里会很容易被审稿人质疑为“过度宣称”。--```72:76:paper/main.tex-In this paper, we present \textsc{DeepTutor}, the first personalized agentic tutoring system with both citation-grounded problem-solving and difficulty-calibrated question generation.-They are unified through a hybrid personalization engine that couples static knowledge grounding with trace forest that continuously refines an evolving learner profile to customize every interaction.-To further evaluate personalized tutoring abilities, we construct TutorBench, a benchmark containing 100 KB-grounded learner profiles to perform first-person interactive assessments via profile-driven student simulator.-Generalization experiments on five standard benchmarks further show that our reasoning pipeline lifts solving accuracy by approximately 25\% on average over the backbone model.-\textsc{DeepTutor} system with full evaluation suites are open-sourced at \url{https://github.com/HKUDS/DeepTutor/tree/eval}.-```--```27:31:paper/sections/intro.tex-\begin{itemize}[nosep,leftmargin=*]- \item We propose \textsc{DeepTutor}, an agentic tutoring framework that, to the best of our knowledge, is the first to unify tool-augmented problem solving, adversarial question generation, and long-term structured memory into a closed interactive loop.- \item We introduce \textit{trace forest}, a hierarchical memory architecture in which specialized agents collaboratively maintain a fine-grained, evolving learner model from multi-resolution interaction traces.- \item We construct \textsc{TutorBench}, a benchmark of 100 knowledge-base-grounded learner profiles paired with a student simulator for first-person interactive evaluation. Experiments on TutorBench and five standard reasoning benchmarks show that \textsc{DeepTutor} substantially outperforms various baselines, providing insights for the future shape of personalized tutoring systems.-\end{itemize}-```--2. **方法章节目前更像“系统蓝图”,还不够像可复现、可验证的研究方法。** `paper/sections/method.tex` 引入了大量模块:KG、VDB、Trace Forest、memory agents、planner、tool agent、writer、generator、validator,但多数仍停留在概念级描述。对 ACL ARR 来说,这会直接拉低 `Soundness` 和 `Reproducibility`,因为读者仍不清楚关键设计到底是什么、哪些是必要创新、哪些只是工程组合。--```111:124:paper/sections/method.tex-\paragraph{Profile Construction.}-\label{sec:injection}-Raw traces must be interpreted into actionable tutoring signals.-We introduce three specialized memory agents to process each new trace tree $T_j$ in parallel, incrementally updating a dedicated dimension of the learner profile $\mathcal{D}$:-\begin{itemize}[nosep,leftmargin=*]-\item Session History $ \mathcal{D}_s$: distills topics covered and performance trends. This will record what has happened, providing general session memories.-\item User Weakness $\mathcal{D}_w$: compares learner responses against reference solutions, labeling each weakness as active or resolved to maintain a prioritized gap inventory, emphasizing where to focus.-\item Self-Reflection $\mathcal{D}_r$: critiques the system's own prior outputs for pedagogical alignment, producing actionable improvement notes, indicating how to improve.-\end{itemize}-Each agent receives the new trace along with its current profile dimension and produces an updated version through incremental revision, preserving long-term trends while incorporating recent signals.-```--3. **个性化记忆机制存在“错误累积/自我强化”风险,但当前方法没有给出足够防护。** 你们让系统把历史交互、弱点诊断、甚至 tutor 自反思都写回 profile;这很有想法,但也意味着一旦前序判断有误,系统可能反复读取并放大错误 learner model。尤其 `Self-Reflection` 与 `User Weakness` 都可能受到模型幻觉影响,前三章里尚未看到 confidence gating、conflict resolution、time decay、human-grounded correction 等机制。--4. **“闭环个性化 tutoring” 的核心科学命题没有被形式化。** 引言里最重要的论点是“解题暴露出的弱点应影响后续出题,而后续表现又应反向更新讲解方式”;这是一个很强、也很值得发表的命题。但在 `paper/sections/intro.tex` 和 `paper/sections/method.tex` 里,这个命题更多是叙事上的闭环,而不是可测量、可证伪的机制。比如:difficulty calibration 如何定义?学习者水平如何估计?“更个性化”到底对应什么客观指标?如果这些不清晰,审稿人会认为贡献更多是系统工程而非研究贡献。--5. **摘要与引言的写作尚不够“ARR-ready”。** 当前文本可读性总体不错,但摘要里有几处句法和指代不够稳,例如 `They are unified...` 的指代模糊,`trace forest that continuously refines...` 的语法不够顺,`lifts solving accuracy by approximately 25% on average` 又是一个非常重的结果性 claim,却没有在摘要中限定 benchmark、setting、baseline 类型。顶会审稿人通常会把这类问题视为“论证不够谨慎”。--## 综合审稿意见-如果我以 **ACL ARR 审稿人** 的角度、且**只基于摘要 + 引言 + 方法** 来打一个暂定印象分,这篇工作属于:--- **选题很强,方向很对,潜在影响力也不错。**-- **系统构想完整,问题意识清晰,`problem solving + question generation + memory` 的统一视角是最有价值的点。**-- **但目前前三章最大的问题是:claim 很大,方法写法偏概念化,关键科学问题还没有被足够“钉实”。**--按 ARR 口径,我会给出一个**暂定**判断:--- `Reviewer Confidence`: **3/5**-- `Soundness`: **2.5/5**-- `Excitement`: **3.5/5**-- `Overall Assessment`: **2.5/5 到 3/5 之间**-- 更具体地说:**如果后续实验和消融非常扎实,有机会到 Findings;如果实验对这些核心机制支撑不够,这篇会更像“下轮重投”。**--## 改进方法-1. **把 novelty claim 收紧。** 除非你们能在 related work 里做非常系统的排他性对比,否则建议把 `the first` 改成更稳健的表述,例如 `among the first`, `to our knowledge, one of the first`, 或者直接强调“we unify ... in a closed-loop tutoring setting”。--2. **把方法从“架构描述”升级成“研究方法描述”。** 最需要补的是一张总表:每个模块的输入、输出、模型、prompt 角色、调用时机、关键超参、失败条件、停止条件。现在读者知道你们“有这些模块”,但还不知道它们“究竟怎么工作”。--3. **明确 trace forest 的更新规则。** 建议补充:node schema、embedding 粒度、写回频率、profile update policy、冲突样本如何处理、旧信息何时衰减。否则 memory 贡献会显得像一个很好听但难以验证的概念。--4. **把 personalization 变成可操作定义。** 例如显式定义:- - learner proficiency signal- - weakness severity- - question difficulty target- - explanation adaptation dimensions- 这样后面实验才能自然对应到“是否真的 personalized”。--5. **提前在方法里写出 failure control。** 我最担心的是 profile drift 和 hallucinated weakness。建议补充一致性校验、低置信度不写回、短期/长期记忆分离、以及基于证据的更新门控。--6. **摘要重写一版。** 顶会论文的摘要最好做到三件事:问题界定单句说清、核心技术单句说清、结果边界单句说清。你现在的摘要信息很多,但密度过高、句法稍乱,容易让审稿人第一印象打折。--## 开放问题-1. `User Weakness` 的标签是由谁产生的?是基于 gold reference、rule-based matching,还是纯 LLM judgment?-2. `Self-Reflection` 为什么应该进入 learner profile,而不是只作为 system-side optimization signal?-3. `difficulty-calibrated` 的标定标准是什么?有外部 rubric、IRT 风格定义,还是模型自评?-4. 闭环收益是来自 `memory`、`tool use`、`RAG`,还是三者交互?如果没有强消融,这一点会被反复追问。--如果你愿意,我下一步可以继续直接按 `ACL ARR Review Form` 的格式,帮你把这份意见整理成一版可直接放进 `paper/REVIEW.md` 的正式审稿文本。--reviewer 3:-明白,我重新聚焦到 **Abstract、Introduction、Related Work、Method** 这四个部分,完全不涉及实验章节。以下是修订后的审稿意见。-------## 综合审稿意见(范围:Abstract + Intro + Related Work + Method)--### Paper Summary--本文提出 DeepTutor,一个工具增强的个性化辅导系统,将引用溯源的问题求解(problem solving)和难度校准的题目生成(question generation)统一在一个闭环框架中。核心贡献为 Hybrid Personalization Engine,耦合静态知识检索(多模态 KG + 向量数据库)与动态个人记忆(Trace Forest),通过三个专用记忆代理持续更新学习者画像,实现"求解暴露弱点 → 驱动出题 → 出题表现反馈修正解释"的双向耦合循环。-------### Summary of Strengths--**S1. 问题定位精准,动机论证有力。**-Introduction 中"闭环交互循环"(closed interactive loop)的缺失论证逻辑清晰:现有系统要么单做求解要么单做出题,缺乏将两者通过持久化学习者状态耦合起来的设计。§1 第三段对所需两个条件的提炼——(i) 细粒度结构化记忆、(ii) 模块共享并持续更新该记忆——为后续 Method 的展开提供了很好的铺垫。--**S2. 方法的形式化程度高,架构清晰。**-Algorithm 1 提供了完整的伪代码,涵盖从 profile injection 到 trace forest 更新的全流程。符号体系($\mathcal{D}$, $\mathcal{F}$, $\mathcal{C}_{\text{mem}}$, $\mathcal{C}_{\text{rag}}$)在 Preliminaries 中统一定义,后续各子模块一致使用,读者可以清晰追踪数据流。--**S3. Trace Forest 的可编程记忆设计有新意。**-三层层次化记忆(Session → Planning → Execution)配合 TraceToolkit(SearchTrace / ListTraces / ReadNodes)的接口设计,将被动数据存储转变为可主动查询的结构化记忆。这比简单的对话历史窗口或 summary buffer 更具灵活性,允许不同 agent 以不同粒度按需检索历史。--**S4. 双向任务耦合(Bidirectional Task Coupling)概念有理论价值。**-§2.5 中描述的求解 → $\mathcal{D}_w$ → 出题 → $\mathcal{D}_s$/$\mathcal{D}_r$ → 解释修正循环,在教育学上对应形成性评估(formative assessment)理论,在 LLM 系统设计中尚属少见。--**S5. 叙述结构层次分明。**-Method 各子节遵循一致的"动机 → 技术描述 → 与整体系统的关联"叙述模式,Figure 2 信息量丰富,能有效帮助读者把握全局。-------### Summary of Weaknesses--**W1. "First" 声明过强,缺乏系统性论证(Critical)。**--摘要和 Contribution (i) 反复使用 "the first personalized agentic tutoring system" 和 "the first to unify tool-augmented problem solving, adversarial question generation, and long-term structured memory"。这种强排他性声明需要有系统性的文献排查支撑,但 Related Work 仅有三段、共12行,远不足以承担此任务。具体问题:--- **经典 ITS 被忽略**:Cognitive Tutor、AutoTutor、BEETLE II 等系统早已集成了问题生成与求解反馈的闭环,且具有长期学习者建模。Related Work 中完全没有讨论这些工作与 DeepTutor 的区别;-- **近期商业/开源系统被忽略**:Khanmigo(Khan Academy + GPT-4)、Duolingo Max 等系统也做了个性化 + 出题 + 求解的整合,应当明确说明本文与这些系统在架构层面的差异;-- **"First" 的精确范围未定义**:是 first open-source?first with trace-based memory?first with tool-augmented agents?需要限定条件。--**W2. Related Work 过于单薄,无法支撑论文的 positioning(Major)。**--整个 Related Work 只有三个 paragraph(Agentic Tool Use / Personalization and Memory / AI for Education),每段仅 3-4 句。对于一篇声称 "first to unify" 三个方向的论文,这样的文献综述是严重不足的:--- **缺少 ITS(Intelligent Tutoring Systems)方向**:这是教育技术的核心领域,有数十年的研究积累,完全没有被讨论;-- **缺少 Knowledge Tracing 方向**:BKT、DKT、SAINT 等知识追踪模型与 Trace Forest 的学习者建模功能存在功能重叠,需要对比并说明差异;-- **每段的 "DeepTutor fills this gap" 式结尾过于公式化**:三段都以"XXX methods lack Y. DeepTutor addresses this with Z"结尾,缺乏对现有工作优缺点的深入分析。--**W3. Method 中多个核心模块的 novelty boundary 模糊(Major)。**--Method 组合了多个已有技术,但未清晰界定哪些是复用、哪些是本文贡献:--- **Static Knowledge Grounding(§2.2.1)**:多模态 KG 构建引用了 RAGAnything [Guo et al.],RRF 融合引用了 [Cormack et al., 2009]——这一小节中是否有任何本文特有的技术贡献?如果主要是工程整合,应当明确说明;-- **Step-by-step Solving(§2.3 Stage ②)**:ReAct 循环 + adaptive replanning 与 IterResearch [Chen et al., 2026] 高度相似,self-note 机制是否是本文独有的贡献?需要明确对比;-- **"Adversarial" 用词误导**:Generator-Validator 分离是 "generate-then-validate" 模式,并非真正的对抗训练(adversarial training)。在 NLP 社区中 "adversarial" 有明确的技术含义(如 GANs、adversarial examples),这里的使用可能造成混淆。--**W4. Profile Injection 机制(§2.2 末尾)描述不足,是全文最关键的薄弱点(Major)。**--$\mathcal{C}_{\text{mem}}$ 的组装是连接 Trace Forest 与所有 pipeline agent 的核心桥梁,但描述极为简略:--- "top-$k$ most relevant nodes with $k$ allocated proportionally across levels" — 比例如何确定?$k$ 的具体值是多少?是超参数还是自适应的?-- "role-specific slices of $\mathcal{D}$" — planner 收到 $\mathcal{D}_s + \mathcal{D}_w$,writer 收到 $\mathcal{D}_r$——这种硬编码分配的依据是什么?有无替代方案的讨论?-- Token budget 如何在 $\mathcal{C}_{\text{rag}}$ 和 $\mathcal{C}_{\text{mem}}$ 之间分配?当 context window 紧张时如何取舍?-- 缺少一个端到端的 worked example 展示实际注入的内容。--**W5. Trace Forest 形式化与实现细节之间存在空缺(Moderate)。**--- 节点 embedding $\mathbf{e}_v$ 用什么模型生成?是否与 $\mathcal{B}$(RAG 的向量索引)共享同一编码器?-- SearchTrace 的检索是 ANN 还是精确搜索?复杂度如何?-- 三层层次结构(Level 1/2/3)的设计选择缺乏论证——为什么是三层而非两层或四层?§2.2 末尾说 "concrete node types at each level are task-specific and detailed alongside the respective pipelines",但 §2.3 和 §2.4 中并没有明确列出各 level 的 node types;-- Forest 的增长管理机制(pruning / compaction)未在 Method 中讨论。--**W6. 三个 Memory Agent 的更新机制缺乏形式化(Moderate)。**--§2.2 列出了 $\mathcal{D}_s$(Session History)、$\mathcal{D}_w$(User Weakness)、$\mathcal{D}_r$(Self-Reflection)三个维度,描述为"incremental revision",但:-- 这些 agent 的输入输出格式是什么?是自然语言文本还是结构化数据?-- "incremental revision" 的具体机制是什么?是完全重写还是 diff-based 更新?-- 当历史越来越长时,profile 如何避免无限膨胀?-- $\mathcal{D}_w$ 中 "active or resolved" 的状态转换逻辑是什么?--**W7. 摘要中指代不清和衔接问题(Minor)。**--Abstract 第四句 "They are unified through a hybrid personalization engine..." — "They" 的指代对象(citation-grounded problem-solving 和 difficulty-calibrated question generation)需要读者回溯推断,建议改为显式主语。此外,摘要在 RAG 的不足(第三句)和 DeepTutor 的方案(第四句)之间缺乏过渡,读者需要自行建立逻辑跳跃。-------### Comments / Suggestions / Typos--**结构性改进建议:**--1. **扩充 Related Work 至至少一整页**:增加 ITS 经典系统、Knowledge Tracing、LLM-based educational QG 三个方向的讨论。对每个方向,不仅说"它们缺乏X",更要分析它们各自的优势,然后说明 DeepTutor 如何在此基础上推进。--2. **在 Method 开头增加 "Design Rationale" 段**:解释为什么采用 investigation-solving-writing 三阶段分离而非端到端推理,并引用教育学理论(如 scaffolding theory、Zone of Proximal Development)。当前 Method 读起来更像系统描述而非研究贡献,增加理论支撑可显著提升深度。--3. **为 Profile Injection 增加 worked example**:用一个具体场景(如"初学者询问反向传播")展示 $\mathcal{C}_{\text{mem}}$ 的实际内容,包括从 Trace Forest 检索了什么、从 $\mathcal{D}$ 中提取了什么、最终注入 prompt 的格式。--4. **弱化 "first" claim**:改为如 "To our knowledge, DeepTutor is the first *open-source agentic framework* that unifies ... within a single closed-loop architecture" 或类似的有限定条件的表述。--**具体文字修正:**--| 位置 | 问题 | 建议修正 |-|------|------|----------|-| Abstract 第4句 | "They are unified" 指代不清 | → "These two capabilities are unified..." |-| Method §2 开头 | "as shown in figure~\ref{}" | → "Figure" 首字母大写 |-| §2.3 Stage ② | "a ReAct-style loop, ~\citep{}" | → 删除逗号和多余空格:"a ReAct-style loop~\citep{}" |-| §2.3 Stage ② | tool suite $\mathcal{A}$ 未正式定义 | 在 Notation 段中增加定义 |-| 全文 | "trace forest" 大小写不一致 | 统一为 "Trace Forest"(专有名词)或 "trace forest"(通用概念),选定一种 |-| Related Work ¶1 | "These frameworks target short-horizon tasks" | 过于笼统,应指出具体哪些 framework |-| Related Work ¶2 | "Yet existing methods rarely maintain pedagogically meaningful learner trajectories" | 需要具体引用说明哪些方法被检查过 |-| Algorithm 1 | 正文引用 "line 14" | 建议改为引用操作名 `Compress` 而非行号,避免重编号后失效 |-------### 预估评分(仅基于 Abs + Intro + Related Work + Method 的写作与方法论质量)--| 维度 | 评分 | 理由 |-|------|------|------|-| **Soundness** | 3.0 | 系统设计合理但 Profile Injection、Memory Agent 更新机制等核心细节不足;novelty boundary 模糊 |-| **Excitement** | 3.5 | Trace Forest + 闭环耦合概念有新意且有教育学理论基础,但"组合创新"需更清晰地与已有工作区分 |-| **Overall** | 3.0 (Findings) | 方法框架有价值,但 Related Work 过于单薄无法支撑 "first" claim,核心机制描述存在缺口 |-| **Reviewer Confidence** | 4 | 熟悉 RAG、Agent、ITS 及教育 AI 领域 |-------### 改进路线图(按优先级)--| 优先级 | 改进项 | 影响维度 |-|--------|--------|----------|-| **P0** | 扩充 Related Work,增加 ITS 经典系统 + Knowledge Tracing 讨论,精确化 "first" claim 的边界条件 | Soundness ↑, Overall ↑ |-| **P1** | 明确每个子模块的 novelty boundary(表格形式:模块 / 复用来源 / 本文贡献) | Excitement ↑ |-| **P1** | 补全 Profile Injection 的细节 + worked example | Soundness ↑, Reproducibility ↑ |-| **P2** | 增加 Design Rationale 段,引入教育学理论支撑 | Excitement ↑ |-| **P2** | 补全 Trace Forest 实现细节(embedding 模型、检索算法、层数论证) | Soundness ↑ |-| **P2** | 形式化 Memory Agent 的更新机制 | Soundness ↑ |-| **P3** | 修正术语一致性、typos、"adversarial" 用词 | 专业度 ↑ |\ No newline at end of filediff --git a/paper/main.tex b/paper/main.texindex 7b54ce538..0d287619f 100644--- a/paper/main.tex+++ b/paper/main.tex@@ -64,24 +64,20 @@\footnotetext{\hspace{-1.8em}$^*$Equal contribution.\newline $^\dagger$Corresponding author.}%\renewcommand{\thefootnote}{\arabic{footnote}}%\setcounter{footnote}{0}%-Education is among the most promising real-world applications of large language models (LLMs).-While current LLMs exhibit strong abilities, they rely heavily on static knowledge acquired during pre-training stages.-While current RAG systems can anchor responses in course-content, they optimize for retrieval precision rather than the adaptive,-guided explanations that effective tutoring demands.-In this paper, we present \textsc{DeepTutor}, among the first open-source agentic frameworks to unify citation-grounded problem-solving and difficulty-calibrated question generation.-These two capabilities are unified through a hybrid personalization engine that couples static knowledge grounding with a trace forest that continuously refines an evolving learner profile to customize every interaction.-To further evaluate personalized tutoring abilities, we construct TutorBench, a benchmark containing 100 KB-grounded learner profiles to perform first-person interactive assessments via profile-driven student simulator.-Generalization experiments on five standard benchmarks further show that our reasoning pipeline lifts solving accuracy by approximately 25\% on average over the backbone model across these datasets.-\textsc{DeepTutor} system with full evaluation suites are open-sourced at \url{https://github.com/HKUDS/DeepTutor/tree/eval}.-+Education is one of the most promising real-world applications for Large Language Models (LLMs). However, current LLMs rely heavily on static knowledge from pre-training, and existing Retrieval-Augmented Generation (RAG) systems often prioritize retrieval precision over the adaptive, guided explanations essential for effective tutoring.+In this paper, we present \textsc{DeepTutor}, a fully open-source agentic framework that unifies citation-grounded problem-solving with difficulty-calibrated question generation.+These capabilities are integrated through a hybrid personalization engine that couples static knowledge grounding with a trace forest, which continuously refines evolving learner profiles to customize every interaction.+To evaluate personalized tutoring, we construct TutorBench, featuring 100 KB-grounded customized learner profiles.+We further conduct interactive assessments via a profile-driven student simulator, complemented by general problem-solving evaluations on authoritative benchmarks.+Our results demonstrate that \textsc{DeepTutor} excels in personalized scenarios while maintaining robust generalized agentic abilities.+The \textsc{DeepTutor} system and its evaluation suites are open-sourced at \url{https://github.com/HKUDS/DeepTutor}.\end{abstract}% ===== Sections =====\input{sections/intro}+\input{sections/related-work}\input{sections/method}\input{sections/experiments}-\input{sections/related-work}\input{sections/conclusion}\input{sections/limitation}diff --git a/paper/sections/appendix.tex b/paper/sections/appendix.texindex ce7b91019..f5e0ea514 100644--- a/paper/sections/appendix.tex+++ b/paper/sections/appendix.tex@@ -2,12 +2,3 @@\label{sec:appendix}This is an appendix.--\section{Worked Example: Profile Injection}-\label{sec:appendix_worked_example}--To illustrate the profile injection mechanism ($\mathcal{C}_{\text{mem}}$), consider a scenario where a beginner learner asks: ``How does backpropagation work?''.--1. \textbf{Active Trace Retrieval}: The TraceToolkit queries the trace forest using the question embedding. It retrieves a Level 1 session summary (``Learner struggled with chain rule last week'') and a Level 3 execution record (``Failed to apply chain rule in a nested function problem'').-2. \textbf{Profile Excerpting}: The planner receives $\mathcal{D}_s$ (``Topic: Calculus, Neural Networks'') and $\mathcal{D}_w$ (``Active Weakness: Chain rule application''). The writer receives $\mathcal{D}_r$ (``Self-Reflection: Learner needs step-by-step mathematical derivations before code examples'').-3. \textbf{Context Assembly}: The token budget is partitioned (e.g., 60\% for $\mathcal{C}_{\text{rag}}$ to retrieve backpropagation formulas, 40\% for $\mathcal{C}_{\text{mem}}$). The final prompt instructs the agent to explain backpropagation with a specific focus on the chain rule, providing a step-by-step derivation.diff --git a/paper/sections/experiments.tex b/paper/sections/experiments.texindex 8a6772759..ed558583c 100644--- a/paper/sections/experiments.tex+++ b/paper/sections/experiments.tex@@ -13,11 +13,11 @@\section{Experiments}\label{sec:experiments}- Standard NLP benchmarks evaluate factual correctness but not whether a tutor \emph{adapts} to the individual learner.- We therefore design a three-pronged evaluation:- \textbf{TutorBench} (\S\ref{sec:tutorbench}), a new benchmark with fine-grained learner profiles grounded in real course materials;- a \textbf{first-person interactive evaluation} (\S\ref{sec:interactive_eval}) that simulates multi-turn tutoring and scores personalization along four rubrics;- and a \textbf{generalization study} (\S\ref{sec:generalization}) on five standard benchmarks verifying that our structured reasoning transfers broadly.+Conventional QA-style benchmarks mostly measure final correctness, but personalized tutoring requires process-level evaluation: whether the system diagnoses learner-specific gaps, corrects them through interaction, and then generates targeted follow-up practice.+Accordingly, we evaluate \textsc{DeepTutor} along three axes:+\textbf{TutorBench} construction quality (\S\ref{sec:tutorbench}),+\textbf{first-person interactive tutoring quality} (\S\ref{sec:interactive_eval}),+and \textbf{general problem-solving transfer} (\S\ref{sec:generalization}).% ===========================================================================@@ -25,55 +25,34 @@\label{sec:tutorbench}% ===========================================================================- Existing educational benchmarks treat all test-takers as identical, missing the \emph{personalization} dimension entirely.- We construct \textbf{TutorBench}, a benchmark in which every test case specifies a complete \emph{learner persona} with realistic knowledge gaps anchored to actual course materials, together with an interactive task.- Figure~\ref{fig:datagen} illustrates the construction pipeline.+Existing educational benchmarks rarely model who the student is and what they specifically misunderstand.+We construct \textbf{TutorBench}, where each entry explicitly couples a learner persona, grounded knowledge gaps, and an interactive tutoring task.+The construction pipeline is shown in Figure~\ref{fig:datagen}.\paragraph{KB Initialization.}University-level textbooks and research papers are indexed into the dual-representation knowledge base described in \S\ref{sec:rag}.A \textit{domain hierarchy} is simultaneously derived from the document structure, providing topical scaffolding for subsequent profile generation.- \paragraph{Profile Definition.}- Three proficiency levels---\textit{beginner}, \textit{intermediate}, and \textit{advanced}---capture qualitatively different learner states, from fundamental misconceptions to nuanced understanding.- For each level, an LLM generates a detailed persona conditioned on the KB's content scope, including educational background and a fine-grained \emph{knowledge state} that categorizes every topic as \textit{known well}, \textit{partially known}, or \textit{unknown}.+\paragraph{Profile Definition.}+Each KB instantiates three learner profiles---\textit{beginner}, \textit{intermediate}, and \textit{advanced}---with distinct educational background, learning purpose, and per-topic mastery states (\textit{known well}/\textit{partially known}/\textit{unknown}).+This mirrors the benchmark generator configuration used in the codebase.- \paragraph{Personal Profile Construction.}- For each profile, we sample pages from the indexed content and generate three types of \emph{grounded knowledge gaps}:+\paragraph{Personal Profile Construction.}+For each profile, we sample source pages from the KB and generate three types of \emph{grounded knowledge gaps}:\textbf{misconceptions} (incorrect beliefs),\textbf{incomplete understanding} (partial grasp with missed edge cases), and\textbf{missing knowledge} (never-encountered concepts).Each gap is anchored to specific source pages and includes both a \textit{manifestation} (how the student would exhibit the gap) and the \textit{correct understanding} for evaluation reference.- Gaps are assembled into \textbf{interactive tasks}---each bundling at least three related gaps with a natural initial message---via rejection sampling that verifies task--gap consistency, source support, and conversational naturalness.+Gaps are assembled into \textbf{interactive tasks} via rejection sampling that verifies task--gap consistency, source grounding, and conversational naturalness.- \paragraph{Statistics.}- Table~\ref{tab:tutorbench_stats} summarizes TutorBench. Each entry is a self-contained unit: a learner profile, grounded knowledge gaps, and an interactive task.-- \begin{table}[t]- \centering- \small- \begin{tabular}{lc}- \toprule- \textbf{Statistic} & \textbf{Count} \\- \midrule- Knowledge Bases & \textit{TBD} \\- Subjects / Topics & \textit{TBD} \\- Learner Profiles & \textit{TBD} \\- \quad -- Beginner & \textit{TBD} \\- \quad -- Intermediate & \textit{TBD} \\- \quad -- Advanced & \textit{TBD} \\- Knowledge Gaps (total) & \textit{TBD} \\- \quad -- Misconception & 30\% \\- \quad -- Incomplete & 40\% \\- \quad -- Missing & 30\% \\- Interactive Tasks & \textit{TBD} \\- Avg.\ Gaps per Task & $\geq 3$ \\- Avg.\ Source Pages per Profile & 10 \\- \bottomrule- \end{tabular}- \caption{Statistics of TutorBench. Each entry couples a learner profile with grounded knowledge gaps and an interactive task, enabling personalization-aware evaluation.}- \label{tab:tutorbench_stats}- \end{table}+\paragraph{Statistics.}+TutorBench is generated with a fixed, configuration-driven recipe.+For each KB, we instantiate three learner profiles (\textit{beginner},+\textit{intermediate}, \textit{advanced}), yielding $3 \times N_{\text{KB}}$+profiles in total. We sample source pages to generate at least 3 knowledge gaps for each interactive task and construct 3+interactive tasks per profile via rejection sampling. In our current release, this produces 90 KB-grounded learner+profiles overall, which is 270 interactive tasks.% ===========================================================================@@ -81,66 +60,125 @@\label{sec:interactive_eval}% ===========================================================================- Static evaluation cannot capture how a tutor \emph{steers an evolving conversation} toward resolving specific misconceptions.- We design a \textbf{first-person interactive evaluation} in which an LLM-powered student simulator engages in multi-turn dialogue with the tutor, followed by rubric-based assessment (Figure~\ref{fig:evaluation}).+Static evaluation cannot capture whether a tutor adaptively resolves misconceptions over turns.+We therefore use a \textbf{first-person interactive protocol}: an LLM student simulator (initialized from TutorBench entries) interacts with each evaluated system, and we score both dialogue behavior and generated practice questions (Figure~\ref{fig:evaluation}).\begin{figure}[t]\centering\includegraphics[width=\columnwidth]{figures/evaluation-ver1.png}- \caption{First-person interactive evaluation protocol. A \textbf{Student Simulator}---initialized from a TutorBench entry with personality, first-person beliefs (encoded gaps), and a dynamic solve list---engages the tutor in multi-turn dialogue. The tutor responds with its full pipeline (solve) and generates personalized practice (quiz). All traces are recorded and assessed by four \textbf{Personalized Evaluation Rubrics}: Source Faithfulness, Average Solve Turns, Difficulty Fitted, and Gap Covered.}+ \caption{First-person interactive evaluation protocol. A \textbf{Student Simulator} initialized from TutorBench (persona + first-person gap beliefs + dynamic gap pacing) interacts with the tutor. After session completion, the tutor generates five practice questions. Evaluation is split into \textbf{turn-level tutoring metrics} and \textbf{practice-question metrics}, then aggregated in a fixed-judge Step-3 pipeline.}\label{fig:evaluation}\end{figure}- \paragraph{Student Simulator.}- To elicit authentic behavior, each knowledge gap is converted into a \textbf{first-person belief encoding}---e.g., a misconception becomes ``\textit{You believe that \ldots, and this feels obviously correct to you}''---preventing the LLM from being self-aware about its own ``mistakes.''- The result is naturalistic behavior: the simulator defends misconceptions, resists premature corrections, and gradually updates understanding only after convincing explanations.- A \textbf{gap pacing plan} schedules when each gap surfaces, and a behavioral protocol constrains the student to respond concisely and signal completion only when all gaps are addressed.+\paragraph{Student Simulator.}+Each gap is transformed into a first-person belief so the simulator \emph{acts as the student} rather than describing errors from an outside view.+Combined with dynamic gap pacing, this yields realistic resistance patterns: the student may defend misconceptions, partially accept corrections, and only mark completion after sufficient explanation.- \paragraph{Evaluation Rubrics.}- The full session is assessed along four dimensions:+\paragraph{Evaluation Rubrics.}+Following the latest evaluation pipeline, metrics are explicitly split into+\textbf{turn-level tutoring metrics} and \textbf{practice-question metrics}.+Importantly, the final practice-question turn is \emph{excluded} from turn-level scoring and evaluated independently.\begin{itemize}[nosep,leftmargin=*]- \item \textbf{Gap Covered (GC)}: fraction of knowledge gaps the tutor explicitly identified and resolved (requiring concrete correction, not casual mention).+\item \textbf{Iter}: raw turn count from interactive sessions (lower is better). This is the only non-1--5 metric.- \item \textbf{Source Faithfulness (SF)}: per-turn score (1--5) measuring alignment with the original source material, penalizing hallucination.+\item \textbf{Solve-side Quality}: per-turn 1--5 scores for \textit{personalization}, \textit{applicability}, \textit{source faithfulness}, \textit{vividness} (modality diversity of expression, e.g., structured tables when useful), and \textit{logical depth}.- \item \textbf{Difficulty Fitted (DF)}: per-question delta ($-5$ to $+5$; $0$=ideal) reflecting difficulty calibration to the student profile; we report average absolute delta ($\downarrow$).-- \item \textbf{Gap Coverage of Practice (GP)}: score (1--5) measuring how well the generated practice set collectively covers the student's weaknesses.+\item \textbf{Practice Metrics}: after dialogue ends, five generated \textbf{MCQ} questions are evaluated separately:+\textit{fitness}, \textit{groundedness}, \textit{diversity}, \textit{answer quality}, and \textit{cross concept} (all per-question, all 1--5).\end{itemize}\paragraph{Protocol.}- For each TutorBench entry, the simulator converses with the tutor, which responds using its full pipeline.- Upon task completion, the tutor generates five personalized practice questions, and the full transcript is scored by all four rubrics.- Baselines: \textbf{Direct LLM} (backbone model without tools or memory) and \textbf{RAG-Tutor} (backbone with RAG retrieval but no structured reasoning or personalization).+We run a three-stage pipeline:+\textbf{Step 1} generates benchmark entries,+\textbf{Step 2} runs interactive simulation and logs transcripts,+\textbf{Step 3} scores transcripts with LLM-as-judge prompts.+To ensure comparability in model studies, we support multi-model Step-2 generation while fixing a single judge model in Step-3.+We compare \textbf{\textsc{DeepTutor}} against one baseline:+\textbf{Naive Tutor} (the project mock tutor: base LLM + simple RAG, without structured planning/memory loop).\paragraph{Results.}- Table~\ref{tab:interactive_results} reports the interactive evaluation results.- %% TODO: Fill in actual results and add analysis paragraphs.+Table~\ref{tab:interactive_results_main} reports the main interactive metrics used in the paper body.+Table~\ref{tab:interactive_results_full} provides the extended metric breakdown (turn-level teaching quality and additional practice-quality dimensions).+Across our internal runs, \textsc{DeepTutor} consistently improves both tutoring and practice metrics over \textit{Naive Tutor}. For all 1--5 metrics, we report averages with four decimal places.\begin{table}[t]\centering\small\begin{tabular}{lcccc}\toprule- \textbf{System} & \textbf{GC}$\uparrow$ & \textbf{SF}$\uparrow$ & \textbf{DF}$\downarrow$ & \textbf{GP}$\uparrow$ \\+ \textbf{System} & \textbf{SQ}$\uparrow$ & \textbf{PQ}$\uparrow$ & \textbf{OQ}$\uparrow$ & \textbf{Iter}$\downarrow$ \\\midrule- Direct LLM & -- & -- & -- & -- \\- RAG-Tutor & -- & -- & -- & -- \\+ Naive Tutor & -- & -- & -- & -- \\\textsc{DeepTutor} & -- & -- & -- & -- \\\bottomrule\end{tabular}- \caption{First-person interactive evaluation results. GC: Gap Covered (resolution rate, $\uparrow$); SF: Source Faithfulness (1--5, $\uparrow$); DF: Difficulty Fitted (avg.\ absolute delta, $\downarrow$); GP: Gap Coverage of Practice (1--5, $\uparrow$). %% TODO: fill in results+\caption{Main first-person interactive results. SQ: solve-quality composite over \{SF, personalization, applicability, vividness, logical depth\}. PQ: practice-quality composite over \{fitness, groundedness, diversity, answer quality, cross concept\}. OQ: average of SQ and PQ. Iter: raw turn count (lower is better).}- \label{tab:interactive_results}+ \label{tab:interactive_results_main}\end{table}--++\begin{table*}[t]+\centering+\small+\setlength{\tabcolsep}{4.5pt}+\begin{tabular}{lcccccccccc}+\toprule+\textbf{System} &+\textbf{SF}$\uparrow$ &+\textbf{PER}$\uparrow$ &+\textbf{APP}$\uparrow$ &+\textbf{VID}$\uparrow$ &+\textbf{LD}$\uparrow$ &+\textbf{FIT}$\uparrow$ &+\textbf{GND}$\uparrow$ &+\textbf{DIV}$\uparrow$ &+\textbf{ANS}$\uparrow$ &+\textbf{CC}$\uparrow$ \\+\midrule+Naive Tutor & -- & -- & -- & -- & -- & -- & -- & -- & -- & -- \\+\textsc{DeepTutor}& -- & -- & -- & -- & -- & -- & -- & -- & -- & -- \\+\bottomrule+\end{tabular}+\caption{Extended first-person interactive results (all metrics are 1--5 with four-decimal averages). PER/APP/VID/LD denote personalization, applicability, vividness, and logical depth for solve turns. FIT/GND/DIV/ANS/CC denote fitness, groundedness, diversity, answer quality, and cross concept for practice questions. Baseline is Naive Tutor (mock tutor: base LLM + simple RAG).}+\label{tab:interactive_results_full}+\end{table*}+++% ===========================================================================+\subsection{Ablation Study}+\label{sec:ablation_rag_memory}+% ===========================================================================++To quantify the contribution of retrieval grounding and long-horizon personalization, we run ablations on both the \textit{solve} and \textit{question-generation} pipelines.+Starting from full \textsc{DeepTutor}, we evaluate three variants:+\textbf{without RAG} (disable retrieval in planner/solver and question generation),+\textbf{without Memory} (disable personalization memory context in both pipelines),+and \textbf{without RAG+Memory} (disable both).+All settings use the same TutorBench entries, simulation protocol, and fixed judge model. Results are reported in table 4.++\begin{table}[t]+\centering+\small+\begin{tabular}{lcccc}+\toprule+\textbf{Variant} & \textbf{SQ}$\uparrow$ & \textbf{PQ}$\uparrow$ & \textbf{OQ}$\uparrow$ & \textbf{Iter}$\downarrow$ \\+\midrule+\textsc{DeepTutor} (full) & -- & -- & -- & -- \\+w/o RAG & -- & -- & -- & -- \\+w/o Memory & -- & -- & -- & -- \\+w/o RAG + Memory & -- & -- & -- & -- \\+\bottomrule+\end{tabular}+\caption{Ablation on retrieval grounding and personalization memory. SQ/PQ/OQ follow the definitions in Table~\ref{tab:interactive_results_main}. For 1--5 metrics, we report four-decimal averages; Iter is raw turn count.}+\label{tab:ablation_rag_memory}+\end{table}+\begin{table*}[!t]\centering\caption{General Problem-solving \textbf{pass@1 scores} across five benchmarks.-\textit{Avg~$\Delta$} mean relative improvement across benchmarks.+\textit{Avg~$\Delta$} means relative improvement across benchmarks.$^*$use the first 500 quesitons within HLE.$^{**}$represents GPQA-diamond.$^{***}$use live reasoning subset.@@ -177,8 +215,13 @@ Minimax-m2.5 & 14.00 & 82.83 & 59.30 & 35.29 & 22.78 & 12.00 & 23.64 & 66.00 & \\label{sec:generalization}% ===========================================================================-Apart from personalized tutoring, it's also important for tutor system to demonstrate the correct and convincing answer when solving problems. Therefore, we further evaluate the general agentic reasoning abilites of \textsc{DeepTutor}. We choose five diverse model families \textit{(Claude, GPT, Gemini, Qwen, Minimax)} with five authorized benchmarks, which covers three core capabilities that is crucial for daily tutoring scenarios. For \textbf{\textit{STEM reasoning}}, we select HLE~\citep{phan2025hle}, GPQA-Diamond~\citep{rein2024gpqa} and LiveBench~\citep{white2025livebench}; for \textbf{\textit{general agentic problem-solving}}, we choose GAIA~\citep{mialon2024gaia}; for \textbf{\textit{long input processing}}, we choose AA-LCR~\citep{artificialanalysis2025lcr}.-Correctness is judged by LLM evaluator, following the benchmark-specific evaluation rubrics. More evlauation details are provided in appendix.+Beyond personalized tutoring, a practical tutor should retain strong general reasoning ability.+We therefore evaluate \textsc{DeepTutor} on five public benchmarks over five backbone families (\textit{Claude, GPT, Gemini, Qwen, MiniMax}), covering three capability groups:+\textbf{STEM reasoning} (HLE~\citep{phan2025hle}, GPQA-Diamond~\citep{rein2024gpqa}, LiveBench~\citep{white2025livebench}),+\textbf{general agentic problem-solving} (GAIA~\citep{mialon2024gaia}),+and \textbf{long-context reasoning} (AA-LCR~\citep{artificialanalysis2025lcr}).+Correctness is judged by LLM evaluators following benchmark-specific rubrics.-As shown in Table~\ref{tab:generalization}, \textsc{DeepTutor} consistently lifts backbone from \textit{+23\% to 32\%} on average, demonstrating that the system could strenghthens the general problem-solving ability while maintaining personalization-oriented designs.+As shown in Table~\ref{tab:generalization}, \textsc{DeepTutor} consistently improves backbone pass@1 performance by \textit{+23\% to +32\%} on average across model families.+These gains suggest that our tutoring-oriented decomposition (plan, tool-grounded solving, and critic-guided generation) improves general reasoning robustness rather than overfitting to TutorBench-specific prompts.\ No newline at end of filediff --git a/paper/sections/method.tex b/paper/sections/method.texindex 09cb6fa4f..a2bb35414 100644--- a/paper/sections/method.tex+++ b/paper/sections/method.tex@@ -9,7 +9,7 @@\end{figure*}DeepTutor is built around two sub-pipes with a common personalization engine, as shown in figure~\ref{fig:overview}.-The \textit{Hybrid Personalization Engine} (\S\ref{sec:personalization}) couples a static knowledge grounding---multi-modal knowledge graphs and vector databases built from course materials---with a dynamic memory that maintains an evolving learner profile.+The \textit{Hybrid Personalization Engine} (\S\ref{sec:personalization}) couples a static knowledge grounding with a dynamic memory that maintains an evolving learner profile.Building upon this substrate, the \textit{problem-solving pipeline} (\S\ref{sec:solve}) produces citation-grounded explanations through three stages, while the \textit{question-generation pipeline} (\S\ref{sec:generate}) produces difficulty-calibrated practice items.Each completed interaction feeds back into the learner profile, creating a closed tutoring cycle (\S\ref{sec:system}).diff --git a/requirements.txt b/requirements.txtindex 6c6648734..7eb34cdb1 100644--- a/requirements.txt+++ b/requirements.txt@@ -1,5 +1,5 @@# ============================================-# DeepTutor Python Dependencies (Full Install)+# DeepTutor Python Dependencies (Runtime Bundle)# ============================================# Python >= 3.10 required#@@ -10,15 +10,10 @@# pip install -r requirements/rag-full.txt # compatibility alias of rag-lite# pip install -r requirements/providers.txt # + native LLM SDKs# pip install -r requirements/dev.txt # + dev/test tools+#+# This file intentionally installs runtime-only dependencies.+# Development tooling (pytest, pre-commit, security linters) lives in dev.txt.-r requirements/server.txt-r requirements/rag-lite.txt-r requirements/providers.txt--# ============================================-# Development and testing tools-# ============================================-pytest>=7.0.0-pre-commit>=3.0.0-safety<3.0.0-bandit>=1.8.0diff --git a/requirements/dev.txt b/requirements/dev.txtindex f3f0e56ed..cf46625c0 100644--- a/requirements/dev.txt+++ b/requirements/dev.txt@@ -2,6 +2,7 @@# DeepTutor Development Dependencies# ============================================# Install: pip install -r requirements/dev.txt+# Includes runtime bundle layers + development tooling.-r server.txt-r rag-lite.txtdiff --git a/scripts/check_install.py b/scripts/check_install.pyindex 6bee6570c..27c2de8d1 100644--- a/scripts/check_install.py+++ b/scripts/check_install.py@@ -125,7 +125,7 @@ def check_backend_packages() -> tuple[bool, int, int]:# HTTP & API("requests", "requests", "2.32.0", False),("openai", "openai", "1.30.0", False),- ("anthropic", "anthropic", "0.30.0", False),+ ("anthropic", "anthropic", "0.30.0", True),("aiohttp", "aiohttp", "3.9.0", False),("httpx", "httpx", "0.27.0", False),# Asyncdiff --git a/tests/agents/test_base_agent_binding.py b/tests/agents/test_base_agent_binding.pynew file mode 100644index 000000000..759d64cfb--- /dev/null+++ b/tests/agents/test_base_agent_binding.py@@ -0,0 +1,32 @@+"""Tests for BaseAgent runtime binding behavior."""++from __future__ import annotations++from deeptutor.agents.base_agent import BaseAgent+from deeptutor.services.llm.config import LLMConfig+++class _DummyAgent(BaseAgent):+ async def process(self, **_kwargs): # noqa: ANN003+ return {}+++def test_base_agent_defaults_to_resolved_binding(monkeypatch) -> None:+ """When binding is not explicitly provided, use resolved runtime binding."""+ resolved = LLMConfig(+ model="google/gemini-3-flash-preview",+ api_key="sk-test",+ base_url="https://openrouter.ai/api/v1",+ binding="openrouter",+ provider_name="openrouter",+ provider_mode="gateway",+ )+ monkeypatch.setattr("deeptutor.agents.base_agent.get_llm_config", lambda: resolved)++ agent = _DummyAgent(+ module_name="question",+ agent_name="idea_agent",+ language="en",+ )++ assert agent.binding == "openrouter"diff --git a/tests/services/llm/test_utils.py b/tests/services/llm/test_utils.pyindex d38d2d0d2..0216eb5a3 100644--- a/tests/services/llm/test_utils.py+++ b/tests/services/llm/test_utils.py@@ -64,6 +64,27 @@ def test_extract_response_content() -> None:assert extract_response_content(payload) == "HelloWorld"+def test_extract_response_content_from_object_attributes() -> None:+ """Response content extraction should handle SDK-like objects."""++ class _Message:+ content = "Hello from object"++ assert extract_response_content(_Message()) == "Hello from object"+++def test_extract_response_content_from_model_dump() -> None:+ """Response content extraction should fallback to model_dump payload."""++ class _Message:+ content = None++ def model_dump(self):+ return {"content": [{"text": "A"}, {"text": "B"}]}++ assert extract_response_content(_Message()) == "AB"++def test_collect_model_names() -> None:"""Model name collection should extract names from payload entries."""entries = ["m1", {"id": "m2"}, {"name": "m3"}, {"model": "m4"}]diff --git a/tests/services/test_notebook_service.py b/tests/services/test_notebook_service.pynew file mode 100644index 000000000..f7dc6d711--- /dev/null+++ b/tests/services/test_notebook_service.py@@ -0,0 +1,24 @@+"""Notebook service regression tests."""++from __future__ import annotations++from deeptutor.services.notebook.service import NotebookManager, RecordType+++def test_add_record_accepts_enum_record_type(tmp_path) -> None:+ manager = NotebookManager(base_dir=str(tmp_path))+ notebook = manager.create_notebook("CLI test notebook")++ result = manager.add_record(+ notebook_ids=[notebook["id"]],+ record_type=RecordType.CO_WRITER,+ title="Sample",+ user_query="Sample",+ output="# Sample",+ )++ assert result["record"]["type"] == RecordType.CO_WRITER++ stored = manager.get_notebook(notebook["id"])+ assert stored is not None+ assert stored["records"][0]["type"] == "co_writer"diff --git a/tests/services/test_prompt_manager.py b/tests/services/test_prompt_manager.pynew file mode 100644index 000000000..91e3f0af6--- /dev/null+++ b/tests/services/test_prompt_manager.py@@ -0,0 +1,18 @@+"""Prompt manager path resolution tests."""++from __future__ import annotations++from deeptutor.services.prompt import get_prompt_manager+++def test_prompt_manager_loads_prompts_from_deeptutor_tree() -> None:+ manager = get_prompt_manager()+ manager.clear_cache()++ prompts = manager.load_prompts(+ module_name="question",+ agent_name="idea_agent",+ language="en",+ )++ assert "generate_ideas" in prompts