feat(admin): Implement Prompt knowledge base integration

Features:

- PromptService enhancement: enhanceWithKnowledge(), loadFullKnowledge(), ragSearch()

- FULL mode: Load entire knowledge base content

- RAG mode: Vector search based on user query

- Knowledge config API: PUT /:code/knowledge-config

- Test render with knowledge injection support

- Frontend: Knowledge config UI in Prompt editor

Bug fixes:

- Fix knowledge config not returned in getPromptDetail

- Fix publish button 400 error (empty request body)

- Fix cache not invalidated after publish

- Add detailed logging for debugging

Documentation:

- Add development record 2026-01-28

- Update ADMIN module status to Phase 4.6

- Update system status document to v4.5

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-02-01 20:26:20 +08:00
parent 0d9e6b9922
commit aaa29ea9d3
15 changed files with 1459 additions and 26 deletions

View File

@@ -1,22 +1,23 @@
# AIclinicalresearch 系统当前状态与开发指南
> **文档版本:** v4.4
> **文档版本:** v4.5
> **创建日期:** 2025-11-28
> **维护者:** 开发团队
> **最后更新:** 2026-01-27
> **最后更新:** 2026-01-28
> **🎉 重大里程碑:**
> - **2026-01-28Prompt 知识库集成完成!** Prompt 可动态引用系统知识库内容
> - **2026-01-27系统知识库管理功能完成** 运营管理端新增知识库管理+文档上传下载
> - **2026-01-25Protocol Agent MVP完整交付** 一键生成研究方案+Word导出
> - **2026-01-24Protocol Agent 框架完成!** 可复用Agent框架+5阶段对话流程
> - **2026-01-22OSS 存储集成完成!** 阿里云 OSS 正式接入平台基础层
> - **2026-01-21成功替换 Dify** PKB 模块完全使用自研 pgvector RAG 引擎
>
> **最新进展(系统知识库管理 2026-01-27**
> - ✅ **系统知识库管理**:运营管理端新增知识库模块,支持 Prompt 引用
> - ✅ **主从页面模式**Master-Detail UX卡片列表+文档管理表格
> - ✅ **文档管理**:上传(单个/批量)、下载(保留原始文件名)、删除
> - ✅ **RAG 引擎集成**:文档解析、分块、向量化存储
> - ✅ **OSS 存储集成**system/knowledge-bases/{kbId}/{docId} 路径
> **最新进展(Prompt 知识库集成 2026-01-28**
> - ✅ **PromptService 增强**:支持 FULL/RAG 两种知识库注入模式
> - ✅ **配置界面**Prompt 编辑器右侧面板配置知识库增强
> - ✅ **测试渲染**:预览知识库注入效果
> - ✅ **发布即生效**:发布后业务端立即使用知识库增强
> - ✅ **Bug 修复**:配置保存、发布按钮、缓存清除等问题
>
> **部署状态:** ✅ 生产环境运行中 | 公网地址http://8.140.53.236/
> **文档目的:** 快速了解系统当前状态为新AI助手提供上下文
@@ -59,7 +60,7 @@
| **SSA** | 智能统计分析 | 队列/预测模型/RCT分析 | ⭐⭐⭐⭐⭐ | 📋 规划中 | P2 |
| **ST** | 统计分析工具 | 100+轻量化统计工具 | ⭐⭐⭐⭐ | 📋 规划中 | P2 |
| **RVW** | 稿件审查系统 | 方法学评估、审稿流程、Word导出 | ⭐⭐⭐⭐ | ✅ **开发完成95%** | P3 |
| **ADMIN** | 运营管理端 | Prompt管理、租户管理、用户管理、运营监控、系统知识库 | ⭐⭐⭐⭐⭐ | 🎉 **Phase 4.5完成85%** - 系统知识库管理+文档上传下载 | **P0** |
| **ADMIN** | 运营管理端 | Prompt管理、租户管理、用户管理、运营监控、系统知识库 | ⭐⭐⭐⭐⭐ | 🎉 **Phase 4.6完成88%** - Prompt知识库集成+动态注入 | **P0** |
---