Files
AIclinicalresearch/docs/03-业务模块/IIT Manager Agent/05-测试文档/IIT Manager Agent V2.8:记忆信息映射指南.md
HaHafeng 0c590854b5 docs(iit): Add IIT Manager Agent V2.9 development plan with multi-agent architecture
Features:
- Add V2.9 enhancements: Cron Skill, User Profiling, Feedback Loop, Multi-Intent Handling
- Create modular development plan documents (database, engines, services, memory, tasks)
- Add V2.5/V2.6/V2.8/V2.9 design documents for architecture evolution
- Add system design white papers and implementation guides

Architecture:
- Dual-Brain Architecture (SOP + ReAct engines)
- Three-layer memory system (Flow Log, Hot Memory, History Book)
- ProfilerService for personalized responses
- SchedulerService with Cron Skill support

Also includes:
- Frontend nginx config updates
- Backend test scripts for WeChat signature
- Database backup files

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-05 22:33:26 +08:00

83 lines
4.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# **IIT Manager Agent V2.8:记忆信息映射指南**
**核心逻辑:** \> \* **即时/全局信息** ![][image1] 存入 **Hot Memory (Markdown)** ![][image1] 每次对话都带。
* **历史/阶段信息** ![][image1] 存入 **Weekly Reports (Database)** ![][image1] 查历史时全量读取。
## **1\. 信息存储位置映射表**
| 信息类型 | 存储位置 | 存储形式 | 举例 | 谁来维护? |
| :---- | :---- | :---- | :---- | :---- |
| **用户偏好** (User Preferences) | **Hot Memory** (Level 3\) | iit\_project\_memory 中的 Markdown 列表 | "PI 喜欢简报格式" "不要在周末发消息" | **人工编辑** (Admin) 或 **每日 AI 提炼** |
| **经常出现的上下文** (Frequent Context) | **Hot Memory** (Level 3\) | iit\_project\_memory 中的 Markdown 文本 | "当前处于入组冲刺阶段" "P001 是重点关注对象" | **每日 AI 提炼** (Cron Job) |
| **关键决策** (Key Decisions) | **Weekly Reports** (Level 2\) | iit\_weekly\_reports 中的 summary 字段 | "2026-02-01 决定放宽入排标准" "确认 P003 不良事件不相关" | **每周 AI 归档** (Scheduler) |
| **踩过的坑/经验教训** (Lessons Learned) | **双重存储** | **Hot** (如果是永久教训) **Weekly** (如果是历史记录) | **Hot**: "严禁直接调用 API 修改数据" **Weekly**: "W5 因参数错误导致同步失败" | **人工** (定规矩) **AI** (记流水) |
## **2\. 详细存储机制**
### **2.1 用户偏好 & 经常出现的上下文 \-\> Hot Memory (Markdown)**
这部分信息需要\*\*“时刻生效”\*\*,所以必须存成轻量级的 Markdown每次对话都注入 System Prompt。
* **存储表**iit\_project\_memory (config 字段)
* **内容示例**
\# User Preferences
\- \[PI\]: 汇报时只看数据,不要废话。
\- \[CRC\]: 下午 2 点后比较忙,尽量上午推任务。
\# Active Context
\- 当前重点任务:清理 3 月份的 Query。
\- 风险提示P005 患者依从性差,需每日提醒。
* **更新机制**
1. **被动更新**:管理员在后台手动修改。
2. **主动更新**每天凌晨AI 扫描昨日对话,如果发现用户说了“以后别...”,自动追加到这里。
### **2.2 关键决策 & 踩过的坑 \-\> Weekly Reports (编年史)**
这部分信息属于\*\*“项目历史”\*\*,不需要每次对话都挂在嘴边,但当用户问“回顾一下”时,需要能查到。
* **存储表**iit\_weekly\_reports
* **内容示例 (Week 2026-05)**
\[进度\]: 本周入组 3 人,累计 15 人。
\[决策\]: 2月3日 PI 会议决定:暂停筛选 "间质性肺炎" 既往史患者。
\[问题\]: 曾尝试自动录入化验单,但因 OCR 精度不足失败(踩坑记录),已回退为人工复核模式。
* **使用机制**
* 当用户问:“我们之前为什么暂停筛选肺炎患者?”
* 意图识别判断为 QUERY\_HISTORY。
* 系统一次性拉取过去所有周报 (150条记录),拼接成“编年史”,喂给 LLM 阅读并回答。
## **3\. 为什么这样设计?**
1. **偏好 (Preferences)** 必须是 **Hot** 的:
* 如果存到周报里AI 可能聊着聊着就忘了“老板不喜欢废话”这个规矩。只有放在 Hot Memory (System Prompt) 里,才能保证每一句回复都符合老板口味。
2. **决策 (Decisions)** 必须是 **Time-Series** 的:
* 决策往往有时间背景。存到周报里天然带有时间戳Week 5 做的决定)。这样 AI 才能回答“上个月做了什么决定”。
3. **踩坑 (Lessons)** 需要 **人工干预**
* 如果只是 AI 自动总结,可能会漏。
* V2.8 允许你在 Hot Memory 里手动写上一条:“【系统禁令】严禁在未授权情况下删除数据”。这条“人工植入的记忆”比任何 AI 总结都管用。
## **4\. 总结:信息流向图**
graph TD
User\[用户输入\] \--\>|对话流| Raw\[原始日志\]
subgraph "实时影响 (Hot)"
Raw \--\>|每日提炼| Prefs\[用户偏好\]
Raw \--\>|每日提炼| Context\[高频上下文\]
Admin\[人工干预\] \--\>|手动编辑| Prefs
end
subgraph "历史归档 (History)"
Raw \--\>|每周汇总| Decisions\[关键决策\]
Raw \--\>|每周汇总| Lessons\[踩坑记录\]
end
Prefs \--\>|注入| NextPrompt\[下一次对话\]
Context \--\>|注入| NextPrompt
Decisions \-.-\>|按需查询| NextPrompt
[image1]: <data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAXCAYAAADpwXTaAAAAX0lEQVR4XmNgGAWjYCQAeXn50+hiZAOgYU/QxcgGcnJy2kA8HV2cbAB03SwgDkIXB0lIkomnAfF1oBHM1DBsERCfRzGMHCCPy5ukAmgETEAXJwvIUzFpMMpTM9GOcAAAmV0cRTlI2MMAAAAASUVORK5CYII=>