feat(iit): Phase 1.5 AI对话集成REDCap真实数据完成

- feat: ChatService集成DeepSeek-V3实现AI对话(390行)
- feat: SessionMemory实现上下文记忆(最近3轮对话,170行)
- feat: 意图识别支持REDCap数据查询(关键词匹配)
- feat: REDCap数据注入LLM(queryRedcapRecord, countRedcapRecords, getProjectInfo)
- feat: 解决LLM幻觉问题(基于真实数据回答,明确system prompt)
- feat: 即时反馈(正在查询...提示)
- test: REDCap查询测试通过(test0102项目,10条记录,ID 7患者详情)
- docs: 创建Phase1.5开发完成记录(313行)
- docs: 更新Phase1.5开发计划(标记完成)
- docs: 更新MVP开发任务清单(Phase 1.5完成)
- docs: 更新模块当前状态(60%完成度)
- docs: 更新系统总体设计文档(v2.6)
- chore: 删除测试脚本(test-redcap-query-for-ai.ts, check-env-config.ts)
- chore: 移除REDCap测试环境变量(REDCAP_TEST_*)

技术亮点:
- AI基于REDCap真实数据对话,不编造信息
- 从数据库读取项目配置,不使用环境变量
- 企业微信端测试通过,用户体验良好

测试通过:
-  查询项目记录总数(10条)
-  查询特定患者详情(ID 7)
-  项目信息查询
-  上下文记忆(3轮对话)
-  即时反馈提示

影响范围:IIT Manager Agent模块
This commit is contained in:
2026-01-03 22:48:10 +08:00
parent 4794640f5d
commit b47079b387
158 changed files with 1273 additions and 110 deletions

View File

@@ -559,5 +559,6 @@ df['creatinine'] = pd.to_numeric(df['creatinine'], errors='coerce')

View File

@@ -974,5 +974,6 @@ export const aiController = new AIController();

View File

@@ -1308,5 +1308,6 @@ npm install react-markdown

View File

@@ -216,5 +216,6 @@ FMA___基线 | FMA___1个月 | FMA___2个月

View File

@@ -374,5 +374,6 @@ formula = "FMA总分0-100 / 100"

View File

@@ -208,5 +208,6 @@ async handleFillnaMice(request, reply) {

View File

@@ -180,5 +180,6 @@ method: 'mean' | 'median' | 'mode' | 'constant' | 'ffill' | 'bfill'

View File

@@ -631,5 +631,6 @@ import { logger } from '../../../../common/logging/index.js';

View File

@@ -434,5 +434,6 @@ import { ChatContainer } from '@/shared/components/Chat';

View File

@@ -344,5 +344,6 @@ const initialMessages = defaultMessages.length > 0 ? defaultMessages : [{

View File

@@ -632,5 +632,6 @@ http://localhost:5173/data-cleaning/tool-c

View File

@@ -420,5 +420,6 @@ Docs: docs/03-业务模块/DC-数据清洗整理/06-开发记录/DC模块重建

View File

@@ -293,5 +293,6 @@ ConflictDetectionService // 冲突检测(字段级对比)

View File

@@ -457,5 +457,6 @@ Tool B后端代码**100%复用**了平台通用能力层,无任何重复开发

View File

@@ -234,5 +234,6 @@ $ node scripts/check-dc-tables.mjs

View File

@@ -467,5 +467,6 @@ ${fields.map((f, i) => `${i + 1}. ${f.name}${f.desc}`).join('\n')}