Summary: - Implement Prompt management infrastructure and core services - Build admin portal frontend with light theme - Integrate CodeMirror 6 editor for non-technical users Phase 3.5.1: Infrastructure Setup - Create capability_schema for Prompt storage - Add prompt_templates and prompt_versions tables - Add prompt:view/edit/debug/publish permissions - Migrate RVW prompts to database (RVW_EDITORIAL, RVW_METHODOLOGY) Phase 3.5.2: PromptService Core - Implement gray preview logic (DRAFT for debuggers, ACTIVE for users) - Module-level debug control (setDebugMode) - Handlebars template rendering - Variable extraction and validation (extractVariables, validateVariables) - Three-level disaster recovery (database -> cache -> hardcoded fallback) Phase 3.5.3: Management API - 8 RESTful endpoints (/api/admin/prompts/*) - Permission control (PROMPT_ENGINEER can edit, SUPER_ADMIN can publish) Phase 3.5.4: Frontend Management UI - Build admin portal architecture (AdminLayout, OrgLayout) - Add route system (/admin/*, /org/*) - Implement PromptListPage (filter, search, debug switch) - Implement PromptEditor (CodeMirror 6 simplified for clinical users) - Implement PromptEditorPage (edit, save, publish, test, version history) Technical Details: - Backend: 6 files, ~2044 lines (prompt.service.ts 596 lines) - Frontend: 9 files, ~1735 lines (PromptEditorPage.tsx 399 lines) - CodeMirror 6: Line numbers, auto-wrap, variable highlight, search, undo/redo - Chinese-friendly: 15px font, 1.8 line-height, system fonts Next Step: Phase 3.5.5 - Integrate RVW module with PromptService Tested: Backend API tests passed (8/8), Frontend pending user testing Status: Ready for Phase 3.5.5 RVW integration
通用能力层
层级定义: 跨业务模块共享的核心技术能力
核心原则: 可复用、高内聚、独立部署
📋 能力清单
| 能力 | 说明 | 复用率 | 优先级 | 状态 |
|---|---|---|---|---|
| 01-LLM大模型网关 | 统一管理LLM调用、成本控制、模型切换 | 71% (5/7) | P0 | ⏳ 待实现 |
| 02-文档处理引擎 | PDF/Docx/Txt提取、OCR、表格提取 | 86% (6/7) | P0 | ✅ 已实现 |
| 03-RAG引擎 | 向量检索、语义搜索、RAG问答 | 43% (3/7) | P1 | ✅ 已实现 |
| 04-数据ETL引擎 | Excel JOIN、数据清洗、数据转换 | 29% (2/7) | P2 | ⏳ 待实现 |
| 05-医学NLP引擎 | 医学实体识别、术语标准化 | 14% (1/7) | P2 | ⏳ 待实现 |
🎯 设计原则
1. 可复用性
- 多个业务模块共享
- 避免重复开发
2. 独立部署
- 可以独立为微服务
- 支持独立扩展
3. 高内聚
- 每个能力职责单一
- 接口清晰
4. 领域知识
- 包含业务领域知识
- 不是纯技术组件
📊 复用率分析
LLM网关 - 71%复用率(最高优先级)
- AIA(AI智能问答)
- ASL(AI智能文献)
- PKB(个人知识库)
- DC(数据清洗)
- RVW(稿件审查)
文档处理引擎 - 86%复用率(已实现)
- ASL、PKB、DC、SSA、ST、RVW
RAG引擎 - 43%复用率(已实现)
- AIA、ASL、PKB
📚 快速导航
快速上下文
- [AI对接] 通用能力快速上下文.md - 2-3分钟了解通用能力层
核心能力
🔗 相关文档
最后更新: 2025-11-06
维护人: 技术架构师