feat(asl): Add DeepSearch smart literature retrieval MVP

Features:
- Integrate unifuncs DeepSearch API (OpenAI compatible protocol)
- SSE real-time streaming for AI thinking process display
- Natural language input, auto-generate PubMed search strategy
- Extract and display PubMed literature links
- Database storage for task records (asl_research_tasks)

Backend:
- researchService.ts - Core business logic with SSE streaming
- researchController.ts - SSE stream endpoint
- researchWorker.ts - Async task worker (backup mode)
- schema.prisma - AslResearchTask model

Frontend:
- ResearchSearch.tsx - Search page with unified content stream
- ResearchSearch.css - Styling (unifuncs-inspired simple design)
- ASLLayout.tsx - Enable menu item
- api/index.ts - Add research API functions

API Endpoints:
- POST /api/v1/asl/research/stream - SSE streaming search
- POST /api/v1/asl/research/tasks - Async task creation
- GET /api/v1/asl/research/tasks/:taskId/status - Task status

Documentation:
- Development record for DeepSearch integration
- Update ASL module status (v1.5)
- Update system status (v3.7)

Known limitations:
- SSE mode, task interrupts when leaving page
- Cost ~0.3 RMB per search (unifuncs API)
This commit is contained in:
2026-01-18 19:15:55 +08:00
parent 57fdc6ef00
commit 1ece9a4ae8
20 changed files with 2052 additions and 16 deletions

View File

@@ -1,14 +1,13 @@
# AIclinicalresearch 系统当前状态与开发指南
> **文档版本:** v3.6
> **文档版本:** v3.7
> **创建日期:** 2025-11-28
> **维护者:** 开发团队
> **最后更新:** 2026-01-18
> **重大进展:** 🎉 **AIA V2.1 完成Prompt管理系统集成!**
> - 🆕 AIA 10个智能体 Prompt 迁移到数据库
> - 🏆 支持管理端在线配置和调试提示词
> - ✅ 灰度预览调试者看DRAFT普通用户看ACTIVE
> - ✅ 三级容灾(数据库→缓存→兜底)
> **重大进展:** 🎉 **ASL 智能文献检索DeepSearchMVP 完成!**
> - 🆕 集成 unifuncs DeepSearch APIAI 驱动的 PubMed 自动检索
> - ✅ SSE 实时流式显示 AI 思考过程
> - ✅ 自然语言输入,自动生成检索策略
> **部署状态:** ✅ 生产环境运行中 | 公网地址http://8.140.53.236/
> **文档目的:** 快速了解系统当前状态为新AI助手提供上下文
@@ -44,7 +43,7 @@
|---------|---------|---------|---------|---------|--------|
| **AIA** | AI智能问答 | 12个智能体选题→方案→评审→写作 | ⭐⭐⭐⭐⭐ | 🎉 **V2.1完成90%** - Prompt管理集成 | **P0** |
| **PKB** | 个人知识库 | RAG问答、私人文献库 | ⭐⭐⭐ | ✅ **核心功能完成90%** | P1 |
| **ASL** | AI智能文献 | 文献筛选、Meta分析、证据图谱 | ⭐⭐⭐⭐⭐ | 🚧 **正在开发** | **P0** |
| **ASL** | AI智能文献 | 文献筛选、Meta分析、证据图谱 | ⭐⭐⭐⭐⭐ | 🎉 **智能检索MVP完成60%** - DeepSearch集成 | **P0** |
| **DC** | 数据清洗整理 | ETL + 医学NER百万行级数据 | ⭐⭐⭐⭐⭐ | ✅ **Tool B完成 + Tool C 99%(异步架构+性能优化-99%+多指标转换+7大功能** | **P0** |
| **IIT** | IIT Manager Agent | AI驱动IIT研究助手 - 智能质控+REDCap集成 | ⭐⭐⭐⭐⭐ | 🎉 **Phase 1.5完成60%- AI对话+REDCap数据集成** | **P0** |
| **SSA** | 智能统计分析 | 队列/预测模型/RCT分析 | ⭐⭐⭐⭐⭐ | 📋 规划中 | P2 |
@@ -157,6 +156,39 @@
---
### 🆕 ASL 智能文献检索 DeepSearch MVP2026-01-18
#### ✅ 功能完成
**核心功能:**
- ✅ 集成 unifuncs DeepSearch APIOpenAI 兼容协议)
- ✅ 自然语言输入研究问题AI 自动生成 PubMed 检索策略
- ✅ SSE 实时流式显示 AI 思考过程
- ✅ 提取并展示 PubMed 文献链接
- ✅ 数据库存储任务记录
**技术实现:**
- 后端:`researchService.ts` + `researchController.ts`SSE 流式接口)
- 前端:`ResearchSearch.tsx`(统一内容流展示)
- 数据库:`asl_schema.asl_research_tasks`
**API 端点:**
| 方法 | 路径 | 说明 |
|------|------|------|
| POST | `/api/v1/asl/research/stream` | SSE 流式检索 |
| POST | `/api/v1/asl/research/tasks` | 异步任务(备用) |
| GET | `/api/v1/asl/research/tasks/:taskId/status` | 任务状态 |
**前端入口:**
- 路由:`/literature/research/search`
- 菜单AI智能文献 → 2. 智能文献检索
**已知限制:**
- ⚠️ SSE 模式,离开页面任务中断
- ⚠️ 每次检索成本约 0.3 元unifuncs API
---
### 🏆 历史进展:通用能力层重大升级 + AIA V2.02026-01-14
#### ✅ Phase 1: 通用流式响应服务OpenAI Compatible