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,10 +1,10 @@
# AI智能文献模块 - 当前状态与开发指南
> **文档版本:** v1.4
> **文档版本:** v1.5
> **创建日期:** 2025-11-21
> **维护者:** AI智能文献开发团队
> **最后更新:** 2025-12-13 🏆 **Postgres-Only 架构改造完成**
> **重大进展:** Platform-Only 架构改造 - 智能双模式处理、任务拆分、断点续传
> **最后更新:** 2026-01-18 🆕 **智能文献检索DeepSearchMVP完成**
> **重大进展:** unifuncs DeepSearch API 集成 - AI驱动的 PubMed 自动检索
> **文档目的:** 反映模块真实状态,帮助新开发人员快速上手
---
@@ -27,15 +27,43 @@
AI智能文献模块是一个基于大语言模型LLM的文献筛选系统用于帮助研究人员根据PICOS标准自动筛选文献。
### 当前状态
- **开发阶段**:🚧 标题摘要初筛MVP已完成全文复筛后端已完成待前端开发
- **开发阶段**:🚧 标题摘要初筛MVP已完成全文复筛后端已完成智能文献检索MVP已完成
- **已完成功能**
- ✅ 标题摘要初筛Title & Abstract Screening- 完整流程
- ✅ 全文复筛后端Day 2-5- LLM服务 + API + Excel导出
-**智能文献检索DeepSearchMVP** - unifuncs API 集成SSE 实时流式
- **开发中功能**
- 🚧 全文复筛前端UIDay 6-8预计2.5天)
- **模型支持**DeepSeek-V3 + Qwen-Max 双模型筛选
- **模型支持**DeepSeek-V3 + Qwen-Max 双模型筛选 + unifuncs DeepSearch
- **部署状态**:✅ 本地开发环境运行正常
### 🆕 智能文献检索 DeepSearch2026-01-18 MVP完成
**功能概述:**
- AI 驱动的自动化 PubMed 文献检索
- 自然语言输入研究问题AI 自动生成检索策略
- 实时显示 AI 思考过程和检索进展
- 提取并展示 PubMed 文献链接
**技术实现:**
- 集成 unifuncs DeepSearch APIOpenAI 兼容协议)
- Server-Sent Events (SSE) 实时流式通信
- 数据库存储:`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
- ⏳ 搜索历史、高级筛选等功能待开发
### 🏆 Postgres-Only 架构改造2025-12-13完成
**改造目标:**