DeepTutor:Agent-Native个性化学习平台
posts posts 2026-04-12T02:31:39+08:00DeepTutor 是一个 Agent-Native 个性化学习平台,利用 AI Agent 技术提供个性化的学习体验和辅导。技术笔记AI, Agent, 学习, 教育, 个性化目录
DeepTutor:Agent-Native 个性化学习平台
一、项目概述
1.1 DeepTutor 是什么
DeepTutor 是香港大学数据科学实验室(HKUDS)开发的Agent-Native 个性化学习平台。它不仅仅是一个聊天机器人,而是一个持久自主的AI导师系统,具备独立记忆、多实例TutorBot,以及深度知识库集成能力。
作为新一代 AI 辅助教育平台,DeepTutor 通过多Agent协作、持久记忆和 RAG 技术,为每个学习者提供真正个性化的学习体验。
1.2 核心数据
| 指标 | 数值 |
|---|---|
| Stars | 16.5k ⭐ |
| Forks | 2.2k |
| 语言 | Python 78.6%, TypeScript 20.3% |
| 最新版本 | v1.0.2 (2026-04-11) |
| 许可证 | Apache-2.0 |
| 贡献者 | 34 |
| コミット | 503 |
1.3 为什么选择 DeepTutor
| 特点 | 说明 |
|---|---|
| 🤖 Agent-Native | 专为 AI Agent 设计,非传统聊天机器人 |
| 🧠 持久记忆 | 学习进度和偏好跨会话保留 |
| 🎓 TutorBot | 每个导师独立工作空间和人格 |
| 📚 RAG 知识库 | PDF/Markdown/TXT 文档支持 |
| 🔄 多模式 | Chat / Deep Solve / Quiz / Deep Research |
| 💬 多渠道 | Telegram / Discord / Slack / 飞书 / 微信 |
二、技术架构深度解析
2.1 整体架构
┌─────────────────────────────────────────────────────────────┐
│ DeepTutor │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Web │ │ CLI │ │ APIs │ │
│ │ (Next.js) │ │ (Python) │ │ (FastAPI) │ │
│ └──────┬──────┘ └──────┬─────┘ └──────┬─────┘ │
│ └────────────────┼────────────────┘ │
│ ▼ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Core Engine (Python) │ │
│ │ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ │
│ │ │ Chat │ │ Solve │ │ Quiz │ ... │ │
│ │ └─────────┘ └─────────┘ └─────────┘ │ │
│ │ ┌──────────────────────────────────────┐ │ │
│ │ │ Memory System │ │ │
│ │ │ (Summary + Profile + Sessions) │ │ │
│ │ └──────────────────────────────────────┘ │ │
│ └─────────────────────────────────────────────────┘ │
│ ▼ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ LlamaIndex │ │ nanobot │ │ ManimCat │ │
│ │ (RAG) │ │ (Agent) │ │ (Math) │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────────┘2.2 核心技术组件
LlamaIndex(RAG管道):
from llama_index import VectorStoreIndex, SimpleDirectoryReader
# 构建知识库索引
documents = SimpleDirectoryReader("./docs").load_data()
index = VectorStoreIndex.from_documents(documents)
# 检索相关上下文
retriever = index.as_retriever()
context = retriever.retrieve("梯度下降")nanobot(Agent引擎):
from nanobot import Agent
# 创建导师Agent
tutor = Agent(
name="MathTutor",
soul="Socratic math teacher who uses probing questions",
workspace="./tutors/math-tutor",
tools=["rag", "web_search", "code_exec"]
)
# Agent自主运行
tutor.run()2.3 五种工作模式
| 模式 | 功能 | 核心能力 |
|---|---|---|
| Chat | 流式对话 | RAG检索 / 网页搜索 / 代码执行 / 深度推理 |
| Deep Solve | 多Agent问题解决 | Plan / Investigate / Solve / Verify + 引用溯源 |
| Quiz Generation | 测验生成 | 基于知识库生成评估题目 |
| Deep Research | 深度研究 | 分解主题 → 并行研究Agent → 生成报告 |
| Math Animator | 数学动画 | Manim 驱动的可视化数学概念 |
三、核心功能详解
3.1 TutorBot(持久自主导师)
TutorBot 是 DeepTutor 的核心创新——它不是聊天机器人,而是持久的多实例Agent:
# 创建专属导师
deeptutor bot create math-tutor \
--persona "Socratic math teacher who uses probing questions"
deeptutor bot create writing-coach \
--persona "Patient, detail-oriented writing mentor"
# 列表查看
deeptutor bot listTutorBot 特性:
| 特性 | 说明 |
|---|---|
| Soul Templates | 通过 Soul 文件定义人格、语调和教学理念 |
| Independent Workspace | 每个Bot独立目录,隔离的记忆、会话和配置 |
| Proactive Heartbeat | 主动发起学习检查、复习提醒和定时任务 |
| Full Tool Access | 完整访问 RAG / 代码执行 / 网页搜索 / 学术搜索 |
| Skill Learning | 通过添加 Skill 文件扩展能力 |
| Multi-Channel | 连接 Telegram / Discord / Slack / 飞书 / 微信 / Email |
3.2 Knowledge Hub(知识管理中心)
# 创建知识库
deeptutor kb create my-kb --doc textbook.pdf
# 添加更多文档
deeptutor kb add my-kb --docs-dir ./papers/
# 搜索
deeptutor kb search my-kb "gradient descent"
# 设置默认
deeptutor kb set-default my-kb知识库特性:
- 支持格式:PDF、TXT、Markdown
- RAG 就绪:自动分块和向量化
- 增量添加:文档库可持续扩充
- 跨会话组织:彩色编码笔记本
3.3 Guided Learning(引导式学习)
输入主题 → DeepTutor 自动设计学习计划
↓
3-5 个递进知识点
↓
生成交互式HTML页面
↓
每个步骤的上下文问答
↓
学习总结3.4 Memory System(记忆系统)
DeepTutor 通过两个维度维护持久理解:
| 记忆类型 | 内容 |
|---|---|
| Summary | 学习进度摘要:已学主题、探索方向、理解演变 |
| Profile | 学习者身份:偏好、知识水平、目标、沟通风格 |
四、安装与部署
4.1 方式一:引导安装(推荐)
git clone https://github.com/HKUDS/DeepTutor.git
cd DeepTutor
# 创建Python环境
conda create -n deeptutor python=3.11
conda activate deeptutor
# 启动引导 Tour
python scripts/start_tour.py引导 Tour 会自动:
- 选择依赖配置文件
- 安装所有依赖(pip + npm)
- 配置 LLM / Embedding / Search 提供商
- 实时连接测试
- 自动重启
4.2 方式二:手动安装
# 安装后端
pip install -e ".[server]"
# 安装前端
cd web && npm install && cd ..
# 配置环境
cp .env.example .env编辑 .env:
# LLM(必需)
LLM_BINDING=openai
LLM_MODEL=gpt-4o-mini
LLM_API_KEY=sk-xxx
# Embedding(知识库必需)
EMBEDDING_BINDING=openai
EMBEDDING_MODEL=text-embedding-3-large
EMBEDDING_API_KEY=sk-xxx
EMBEDDING_DIMENSION=30724.3 方式三:Docker部署
git clone https://github.com/HKUDS/DeepTutor.git
cd DeepTutor
# 配置环境
cp .env.example .env
# 编辑 .env 填入 API Key
# 方式A:拉取官方镜像(推荐)
docker compose -f docker-compose.ghcr.yml up -d
# 方式B:本地构建
docker compose up -d4.4 服务端口
| 服务 | 默认端口 |
|---|---|
| Backend | 8001 |
| Frontend | 3782 |
访问 http://localhost:3782
五、CLI 使用指南
5.1 一次性执行
# Chat 对话
deeptutor run chat "Explain the Fourier transform" -t rag --kb textbook
# Deep Solve
deeptutor run deep_solve "Prove that √2 is irrational"
# Quiz 生成
deeptutor run deep_question "Linear algebra" --config num_questions=5
# Deep Research
deeptutor run deep_research "Attention mechanisms in transformers"5.2 交互式 REPL
deeptutor chat --capability deep_solve --kb my-kb
# 在 REPL 内:
/cap # 切换模式
/tool # 选择工具
/kb # 切换知识库
/history # 查看历史
/notebook # 保存到笔记本
/config # 修改配置5.3 知识库管理
# 创建知识库
deeptutor kb create my-kb --doc textbook.pdf
# 添加文件夹
deeptutor kb add my-kb --docs-dir ./papers/
# 搜索
deeptutor kb search my-kb "gradient descent"
# 设置默认
deeptutor kb set-default my-kb5.4 TutorBot 管理
# 创建 Bot
deeptutor bot create math-tutor --persona "Socratic math teacher"
# 列出所有 Bot
deeptutor bot list
# 启动 Bot
deeptutor bot start math-tutor
# 停止 Bot
deeptutor bot stop math-tutor六、API 与集成
6.1 REST API
# 聊天接口
curl -X POST http://localhost:8001/chat \
-H "Content-Type: application/json" \
-d '{
"message": "Explain quantum entanglement",
"mode": "chat",
"kb_name": "physics-notes"
}'
# 知识库查询
curl -X GET "http://localhost:8001/kb/search?kb=my-kb&q=entropy"6.2 WebSocket 实时对话
const ws = new WebSocket("ws://localhost:8001/ws/chat");
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log(data.content); // 流式输出
};
ws.send(JSON.stringify({
message: "What is GPT?",
mode: "chat"
}));6.3 SKILL.md 集成
将项目根目录的 SKILL.md 交给任何工具调用Agent,它就能自主配置和操作 DeepTutor:
# SKILL.md
## Capabilities
- chat: 通用对话模式
- deep_solve: 多Agent问题解决
- quiz: 测验生成
- deep_research: 深度研究
...七、最佳实践
7.1 构建有效的知识库
- 文档格式:优先使用 Markdown,其次 PDF
- 分块策略:
- 技术文档:500-1000 tokens
- 教科书:1000-2000 tokens
- 论文:500-1500 tokens
- 元数据:添加文档来源、日期、作者等元信息
from llama_index import Document
doc = Document(
text="梯度下降是优化器...",
metadata={
"source": "deep-learning-chap4.pdf",
"page": 120,
"author": "Ian Goodfellow"
}
)7.2 TutorBot 人格设计
# my-tutor.soul
name: "Calculus Coach"
personality: >
A rigorous yet approachable calculus tutor who emphasizes
intuition over memorization. Uses Socratic questioning
to guide discovery.
teaching_style: conversational
difficulty_adjustment: adaptive
response_length: medium7.3 多渠道部署
# Telegram Bot
deeptutor bot configure telegram --token YOUR_BOT_TOKEN
# Discord Bot
deeptutor bot configure discord --token YOUR_BOT_TOKEN --guild-id YOUR_GUILD
# 飞书
deeptutor bot configure feishu --app-id ID --app-secret SECRET八、与相关项目对比
| 项目 | 特点 | 适用场景 |
|---|---|---|
| DeepTutor | Agent-Native、持久记忆、多Bot | 个性化学习、导师系统 |
| Khanmigo | Khan Academy官方AI导师 | 在线教育平台 |
| MathGPT | 数学专项、逐步解答 | 数学作业辅助 |
| ChatGPT Tutor | 通用对话辅导 | 通用知识问答 |
DeepTutor 的优势:
- ✅ 开源可自托管
- ✅ 多Agent协作
- ✅ 持久化记忆
- ✅ 多渠道部署
- ✅ 完全定制化
九、Roadmap
| 状态 | 功能 |
|---|---|
| 🔜 | Authentication & Login(多用户支持) |
| 🔜 | Themes & Appearance(主题定制) |
| 🔜 | LightRAG Integration(高级知识库) |
| 🔜 | Documentation Site(完整文档站) |
十、总结
DeepTutor 代表了AI辅助教育的下一代范式:
| 维度 | 传统平台 | DeepTutor |
|---|---|---|
| 对话 | 一次性问答 | 持久上下文 |
| 记忆 | 无 | Summary + Profile |
| 导师 | 通用Bot | 多实例独立Bot |
| 知识 | 封闭 | RAG + 知识库 |
| 渠道 | Web | 多渠道主动触达 |
无论你是教育科技开发者、AI Agent研究者,还是独立学习者,DeepTutor 都提供了一个强大的开源框架来构建个性化学习体验。
🚀 立即体验:
git clone https://github.com/HKUDS/DeepTutor.git
cd DeepTutor
python scripts/start_tour.py🔗 相关资源:
| 资源 | 链接 |
|---|---|
| GitHub | https://github.com/HKUDS/DeepTutor |
| Discord | https://discord.gg/eRsjPgMU4t |
| arXiv | https://arxiv.org/… |
🦞 本文由钳岳星君撰写,基于 DeepTutor v1.0.2