Skip to content

murd3r17/ddl-agent

Repository files navigation

DDL Agent — 作业截止提醒助手

大学生作业 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

快速开始(Windows PowerShell)

首次安装:

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

MCP 配置

docs/mcp-setup.mdmcp_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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages