diff --git a/README.md b/README.md index b685c1689..0108b23c6 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ [](./Communication.md) [](https://github.com/HKUDS/DeepTutor/issues/78) -[Features](#-key-features) · [Get Started](#-get-started) · [Explore](#-explore-deeptutor) · [CLI](#%EF%B8%8F-deeptutor-cli--agent-native-interface) · [Community](#-community) +[Features](#-key-features) · [Get Started](#-get-started) · [Explore](#-explore-deeptutor) · [CLI](#%EF%B8%8F-deeptutor-cli--agent-native-interface) · [Ecosystem](#-ecosystem--open-to-the-skills-community) · [Community](#-community) @@ -147,13 +147,13 @@ ## ✨ Key Features -DeepTutor is an agent-native learning workspace: Chat, Solve, Quiz, Research, Visualize, and Mastery Path run on one extensible tutoring runtime. +DeepTutor is an agent-native learning workspace that connects tutoring, problem solving, quiz generation, research, visualization, and mastery practice in one extensible system. -- **Multiple learning modes, one tutor runtime** — move between flexible chat, step-by-step solving, auto-validated quiz generation, multi-agent research, visual explanation, and mastery-based tutoring without switching systems. -- **Connected learning workspace** — Knowledge Bases, Book pages, Co-Writer drafts, Space assets, notebooks, and Memory give the tutor reusable context instead of scattering learning materials across isolated tools. -- **Extensible tool and skill ecosystem** — DeepTutor can use built-in tools, MCP tools, built-in skills, and community skills from ClawHub, so the tutor can grow with new workflows instead of being limited to a fixed feature set. -- **Inspectable long-term memory** — L1 traces, L2 surface summaries, and L3 cross-surface synthesis make personalization visible, editable, and traceable. -- **Persistent Partners** — IM-connected companions run on the same DeepTutor agent loop, each with its own soul, channels, workspace, and assigned library. +- **One runtime for every mode** — Chat, Solve, Quiz, Research, Visualize, and Mastery Path share the same tutoring engine, so context can move with the learner. +- **Connected learning context** — Knowledge Bases, books, Co-Writer drafts, Space assets, notebooks, and Memory stay available across workflows instead of living in isolated tools. +- **Extensible tools and skills** — Built-in tools, MCP tools, built-in skills, and installable community skills let DeepTutor grow with new learning workflows. +- **Inspectable memory** — L1 traces, L2 surface summaries, and L3 synthesis make personalization visible, editable, and grounded in prior activity. +- **Persistent Partners** — IM-connected companions run on the same agent loop, each with its own soul, channels, workspace, and assigned library. --- @@ -401,7 +401,7 @@ Project-root `.env` is **not** read as an application config file. For a minimal ## 📖 Explore DeepTutor -The README tour follows the product surfaces in the order you will most often meet them: Chat, Partner, Co-Writer, Book, Knowledge, Space, Memory, and Settings. The screenshots below come from the reorganized `assets/figs` tree; archived legacy images are intentionally not used here. +Start with the main surfaces you will use day to day: Chat, Partners, Co-Writer, Book, Knowledge, Space, Memory, and Settings. The tour then covers Multi-User deployments for shared, isolated workspaces.
@@ -564,16 +564,39 @@ The **first registered user becomes admin** and owns model catalogs, provider cr
## ⌨️ DeepTutor CLI — Agent-Native Interface
-DeepTutor is CLI-native: the same `deeptutor` entry point can initialize a workspace, start the web app, run a one-shot capability, open an interactive REPL, manage knowledge bases, inspect sessions, maintain books, and operate partners.
+One `deeptutor` binary, two ways in: an interactive **REPL** for people who live in the terminal, and structured **JSON** for other agents that drive DeepTutor as a tool. Same capabilities, tools, and knowledge bases either way.
+
+### Drive it yourself
+
+`deeptutor chat` opens an interactive REPL; `deeptutor run diff --git a/deeptutor/agents/chat/agentic_pipeline.py b/deeptutor/agents/chat/agentic_pipeline.py index d4231ea57..89ff44612 100644 --- a/deeptutor/agents/chat/agentic_pipeline.py +++ b/deeptutor/agents/chat/agentic_pipeline.py @@ -76,7 +76,7 @@ FIRST on every turn, call `mastery_status`. It returns the next objective to wor Then act on the objective: - No objectives yet? Design a path from the learner's materials (use `rag` / `read_source` when materials are attached) and call `mastery_build`. Tag each knowledge point: memory (facts), procedure (step-by-step skills), concept (ideas to understand), design (open-ended judgement). - `probe` (untouched): briefly check whether the learner already knows it before teaching — let them test out, don't lecture what they have already mastered. -- memory / procedure objectives: pose a concrete question with `mastery_quiz`, present it (use `ask_user` for a tight ask-and-answer loop), then score the learner's answer with `mastery_grade`. Keep working the same objective until `mastery_grade` reports `mastered: true`. +- memory / procedure objectives: register the question + its answer with `mastery_quiz`, then ALWAYS present it with the `ask_user` tool so the learner answers on an interactive card — never write the choices as plain numbered text. For multiple choice, give each `ask_user` option a short label (A / B / C …) and set the matching label as `mastery_quiz`'s `expected_answer`; for open questions use `ask_user` free text. When the answer comes back, score it with `mastery_grade`. Keep working the same objective until `mastery_grade` reports `mastered: true`. - concept / design objectives: ask the learner to explain the idea in their own words, judge it, and record the result with `mastery_assess` (`passed: true` only when the explanation truly shows understanding). - `review`: a spaced-repetition item is due — quiz it again to refresh it. - `complete`: congratulate the learner and summarise what they have mastered. @@ -92,7 +92,7 @@ _MASTERY_SYSTEM_ZH = """\ 然后针对该知识点行动: - 还没有任何知识点?根据学习者的材料设计一条路径(材料已挂载时用 `rag` / `read_source`),调用 `mastery_build`。给每个知识点标类型:memory(记忆/事实)、procedure(程序/步骤技能)、concept(概念/需理解)、design(设计/开放判断)。 - `probe`(未触碰):先简短探查学习者是否已经会了再教——允许其"测试通过"直接跳过,不要重复讲他已掌握的内容。 -- memory / procedure 类:用 `mastery_quiz` 出一道具体题目并呈现给学习者(紧凑问答用 `ask_user`),再用 `mastery_grade` 批改其作答。在 `mastery_grade` 返回 `mastered: true` 之前,持续打磨同一个知识点。 +- memory / procedure 类:先用 `mastery_quiz` 登记题目与答案,然后**始终用 `ask_user` 工具**把题目呈现成可点选的卡片让学习者作答——绝不要把选项写成纯文字的 1./2./3.。选择题给每个 `ask_user` 选项一个短标签(A / B / C …),并把正确标签设为 `mastery_quiz` 的 `expected_answer`;简答题用 `ask_user` 的自由输入。收到作答后用 `mastery_grade` 批改。在 `mastery_grade` 返回 `mastered: true` 之前,持续打磨同一个知识点。 - concept / design 类:让学习者用自己的话解释该概念,你来判断,并用 `mastery_assess` 记录结果(只有解释确实体现理解时才 `passed: true`)。 - `review`:有到期的间隔复习项——再考一次以巩固。 - `complete`:祝贺学习者并总结其已掌握的内容。 diff --git a/deeptutor/tools/mastery_tool.py b/deeptutor/tools/mastery_tool.py index e54ca4952..6e019d68a 100644 --- a/deeptutor/tools/mastery_tool.py +++ b/deeptutor/tools/mastery_tool.py @@ -138,9 +138,11 @@ class MasteryQuizTool(BaseTool): "Pose a question for a MEMORY or PROCEDURE objective and register " "its expected answer with the engine (so grading is deterministic " "and you never re-state the answer later). After calling this, " - "present the question to the learner — via ask_user for a tight " - "loop, or as your reply — then call mastery_grade with their " - "answer. For CONCEPT / DESIGN objectives use mastery_assess instead." + "present the question with the ask_user tool so the learner answers " + "on an interactive card (for choices, give ask_user options short " + "labels like A/B/C and set the correct label as expected_answer); " + "then call mastery_grade with their answer. For CONCEPT / DESIGN " + "objectives use mastery_assess instead." ), parameters=[ ToolParameter( @@ -221,8 +223,10 @@ class MasteryQuizTool(BaseTool): "question": question, "options": options, "instruction": ( - "Present this question to the learner now, then call " - "mastery_grade with their answer." + "Present this question with the ask_user tool (use its options " + "for multiple choice; the option labels must match the " + "expected_answer you registered), then call mastery_grade with " + "the learner's answer." ), }, meta_key="mastery_quiz", diff --git a/site/src/content/docs/docs/cli/agent-handoff.md b/site/src/content/docs/docs/cli/agent-handoff.md index 96ad816ec..cdb4695ad 100644 --- a/site/src/content/docs/docs/cli/agent-handoff.md +++ b/site/src/content/docs/docs/cli/agent-handoff.md @@ -49,7 +49,7 @@ deeptutor kb create linalg --docs-dir ./textbooks/ SESSION_ID=$(deeptutor run deep_question "Linear algebra fundamentals" \ --kb linalg \ --config num_questions=4 --config difficulty=easy \ - --format json | jq -r 'select(.type=="done") | .metadata.session_id') + --format json | jq -r 'select(.type=="done") | .session_id') deeptutor run deep_question "Linear algebra eigenvectors" \ --kb linalg --session "$SESSION_ID" \ @@ -157,7 +157,7 @@ SESSION_ID=$(deeptutor run deep_research "Survey 2026 papers on RAG" \ --tool web_search --kb papers \ --config mode=report --config depth=standard \ --format json | \ - jq -r 'select(.type=="done") | .metadata.session_id') + jq -r 'select(.type=="done") | .session_id') # Step 2 — summarize (same session, different capability) deeptutor run chat "Summarize the top three findings as bullet points" \ @@ -206,7 +206,7 @@ for line in proc.stdout: print(f"× Error: {event['content']}") break elif event["type"] == "done": - session_id = event["metadata"]["session_id"] + session_id = event["session_id"] break answer = "".join(final_content) @@ -221,7 +221,7 @@ deeptutor run chat "Hello" --format json | \ # Get the session id deeptutor run chat "Hello" --format json | \ - jq -r 'select(.type=="done") | .metadata.session_id' + jq -r 'select(.type=="done") | .session_id' # Stream stages as they finish deeptutor run deep_research "..." \ diff --git a/site/src/content/docs/docs/cli/commands.md b/site/src/content/docs/docs/cli/commands.md index 428c2c034..5929da1ab 100644 --- a/site/src/content/docs/docs/cli/commands.md +++ b/site/src/content/docs/docs/cli/commands.md @@ -471,7 +471,7 @@ class TurnRequest: | `tool_call` | A tool is being invoked | `content` (tool name), `metadata.args` | | `tool_result` | A tool returned | `content`, `metadata.tool` | | `error` | Something went wrong | `content` | -| `done` | Turn complete | `metadata.session_id`, `metadata.turn_id` | +| `done` | Turn complete | `session_id`, `turn_id` (top-level), `metadata.status` | ## See also diff --git a/site/src/content/docs/zh-cn/docs/cli/agent-handoff.md b/site/src/content/docs/zh-cn/docs/cli/agent-handoff.md index 1b5830711..fd3e0bac4 100644 --- a/site/src/content/docs/zh-cn/docs/cli/agent-handoff.md +++ b/site/src/content/docs/zh-cn/docs/cli/agent-handoff.md @@ -49,7 +49,7 @@ deeptutor kb create linalg --docs-dir ./textbooks/ SESSION_ID=$(deeptutor run deep_question "Linear algebra fundamentals" \ --kb linalg \ --config num_questions=4 --config difficulty=easy \ - --format json | jq -r 'select(.type=="done") | .metadata.session_id') + --format json | jq -r 'select(.type=="done") | .session_id') deeptutor run deep_question "Linear algebra eigenvectors" \ --kb linalg --session "$SESSION_ID" \ @@ -157,7 +157,7 @@ SESSION_ID=$(deeptutor run deep_research "Survey 2026 papers on RAG" \ --tool web_search --kb papers \ --config mode=report --config depth=standard \ --format json | \ - jq -r 'select(.type=="done") | .metadata.session_id') + jq -r 'select(.type=="done") | .session_id') # Step 2 —— 总结(同一 session,不同 capability) deeptutor run chat "Summarize the top three findings as bullet points" \ @@ -206,7 +206,7 @@ for line in proc.stdout: print(f"× Error: {event['content']}") break elif event["type"] == "done": - session_id = event["metadata"]["session_id"] + session_id = event["session_id"] break answer = "".join(final_content) @@ -221,7 +221,7 @@ deeptutor run chat "Hello" --format json | \ # 拿到 session id deeptutor run chat "Hello" --format json | \ - jq -r 'select(.type=="done") | .metadata.session_id' + jq -r 'select(.type=="done") | .session_id' # 流式打印每个 stage 完成的瞬间 deeptutor run deep_research "..." \ diff --git a/site/src/content/docs/zh-cn/docs/cli/commands.md b/site/src/content/docs/zh-cn/docs/cli/commands.md index 783ca973d..20fb3f957 100644 --- a/site/src/content/docs/zh-cn/docs/cli/commands.md +++ b/site/src/content/docs/zh-cn/docs/cli/commands.md @@ -471,7 +471,7 @@ class TurnRequest: | `tool_call` | 正在调用某个 tool | `content`(tool 名)、`metadata.args` | | `tool_result` | tool 返回结果 | `content`、`metadata.tool` | | `error` | 出错 | `content` | -| `done` | turn 完成 | `metadata.session_id`、`metadata.turn_id` | +| `done` | turn 完成 | `session_id`、`turn_id`(顶层)、`metadata.status` | ## 另见