大学生作业 DDL 聚合 Agent:用户手动录入作业,本地持久化,按截止时间自动提醒,支持重启恢复与多轮对话。
| 要求 | 实现 |
|---|---|
| ≥2 个功能技能 | DdlService:本地 JSON、APScheduler 定时、紧急度排序、周报导出 |
| MCP / function calling | 双模式:--backend function(默认)与 --backend mcp |
| 不靠 LLM 编造数据 | 统一经 tools/service.py 读写 data/ |
| Prompts 入库 | prompts/(含 archive/ 开发 prompt 归档) |
用户 → DDLAgent / MCPDDLAgent → LLM
↓ tool_call
DdlService(统一服务层)
↓
AssignmentStore | ReminderScheduler | PriorityEngine | briefing
首次安装:
cd D:\github\lab2\ddl-agent
python -m venv .venv
.venv\Scripts\pip install -r requirements.txt
copy .env.example .env每次运行(无需 activate):
cd D:\github\lab2\ddl-agent
$env:PYTHONIOENCODING = 'utf-8'
.venv\Scripts\python.exe main.py # function calling(默认)
.venv\Scripts\python.exe main.py --backend mcp # MCP Client 模式- 8 个工具:录入、查询、看板、完成、删除、更新提醒、查看调度、导出周报
- 重启恢复提醒:启动时从
assignments.json重新注册 APScheduler 任务 - 多轮对话:支持「刚才那条作业提前 3 小时提醒」;
/reset清空上下文 - Windows 通知:提醒时尝试桌面 toast,失败则终端
[REMINDER]+ 日志
你> 高数习题5,后天23:00截止,提前24小时提醒
你> 提前3小时提醒刚才那条
你> 按紧急程度排一下
你> 导出这周作业周报
你> 删掉线性代数那条作业
.venv\Scripts\python.exe -m pytest tests/ -v见 docs/mcp-setup.md 与 mcp_config.example.json。
ddl-agent/
├── agent/ # loop.py, mcp_loop.py, executor.py
├── tools/ # service.py, assignments, reminders, priority, briefing
├── mcp_server/ # FastMCP server
├── prompts/ # system_prompt, tool_use_examples, archive/
├── tests/ # pytest
├── docs/ # mcp-setup.md
└── main.py
见 .env.example。