docs(agent): 同步 RAG 当前能力文档
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
- 全局异常处理 `GlobalExceptionHandler`。
|
||||
- MyBatis-Plus 审计自动填充 `EntityAuditMetaObjectHandler`。
|
||||
- 附件本地存储配置 `AttachmentProperties`。
|
||||
- 文档解析抽象与 Apache Tika 解析实现。
|
||||
- 系统枚举管理能力(CRUD + 批量新增 + 管理端查询)。
|
||||
- 附件上传能力(本地磁盘 + 元数据持久化)。
|
||||
|
||||
@@ -58,6 +59,11 @@
|
||||
| SysAttachmentController | `common/controller/SysAttachmentController.java` |
|
||||
| SysEnumServiceImpl | `common/service/impl/SysEnumServiceImpl.java` |
|
||||
| SysAttachmentServiceImpl | `common/service/impl/SysAttachmentServiceImpl.java` |
|
||||
| DocumentParserFactory | `common/document/parse/DocumentParserFactory.java` |
|
||||
| TxtDocumentParser | `common/document/parse/impl/TxtDocumentParser.java` |
|
||||
| PdfDocumentParser | `common/document/parse/impl/PdfDocumentParser.java` |
|
||||
| WordDocumentParser | `common/document/parse/impl/WordDocumentParser.java` |
|
||||
| ExcelDocumentParser | `common/document/parse/impl/ExcelDocumentParser.java` |
|
||||
| CommonStatusEnum | `common/enums/CommonStatusEnum.java` |
|
||||
| EnableStatusEnum | `common/enums/EnableStatusEnum.java` |
|
||||
|
||||
@@ -80,7 +86,8 @@
|
||||
|
||||
- 维护 RAG 知识库主数据(CRUD + 编码唯一性校验)。
|
||||
- 维护知识库文档与附件的关联关系。
|
||||
- 定义解析状态、索引状态和 RAG 相关来源常量。
|
||||
- 支持知识文档批量上传、解析入口和解析状态流转。
|
||||
- 定义切片、向量、解析状态、索引状态和 RAG 相关来源常量。
|
||||
|
||||
关键类:
|
||||
|
||||
@@ -88,28 +95,42 @@
|
||||
|----|------|
|
||||
| RagStore | `rag/entity/RagStore.java` |
|
||||
| RagDocument | `rag/entity/RagDocument.java` |
|
||||
| RagChunk | `rag/entity/RagChunk.java` |
|
||||
| RagChunkEmbedding | `rag/entity/RagChunkEmbedding.java` |
|
||||
| RagStoreController | `rag/controller/RagStoreController.java` |
|
||||
| RagDocumentController | `rag/controller/RagDocumentController.java` |
|
||||
| RagStoreServiceImpl | `rag/service/impl/RagStoreServiceImpl.java` |
|
||||
| RagDocumentServiceImpl | `rag/service/impl/RagDocumentServiceImpl.java` |
|
||||
| RagDocumentParseServiceImpl | `rag/service/impl/RagDocumentParseServiceImpl.java` |
|
||||
| RagParseStatusEnum | `rag/enums/RagParseStatusEnum.java` |
|
||||
| RagIndexStatusEnum | `rag/enums/RagIndexStatusEnum.java` |
|
||||
| RagChunkStrategyEnum | `rag/enums/RagChunkStrategyEnum.java` |
|
||||
| RagSystemConstants | `rag/constant/RagSystemConstants.java` |
|
||||
|
||||
接口列表:
|
||||
|
||||
| 方法 | 路径 | 说明 |
|
||||
|------|------|------|
|
||||
| POST | `/api/rag/store/list` | 查询全部知识库 |
|
||||
| POST | `/api/rag/store/query` | 知识库条件查询 |
|
||||
| GET | `/api/rag/store/detail` | 获取知识库详情 |
|
||||
| GET | `/api/rag/store/overview` | 获取知识库总览 |
|
||||
| GET | `/api/rag/store/documentOverview` | 获取单个知识库文档概览 |
|
||||
| POST | `/api/rag/store/save` | 新增/更新知识库 |
|
||||
| POST | `/api/rag/store/delete` | 删除知识库 |
|
||||
| POST | `/api/rag/documents/list` | 查询全部知识文档 |
|
||||
| POST | `/api/rag/documents/query` | 知识文档条件查询 |
|
||||
| GET | `/api/rag/documents/detail` | 获取知识文档详情 |
|
||||
| POST | `/api/rag/documents/save` | 新增/更新知识文档 |
|
||||
| POST | `/api/rag/documents/delete` | 删除知识文档 |
|
||||
| POST | `/api/rag/documents/batchUpload` | 批量上传文档并创建 `rag_document` |
|
||||
| POST | `/api/rag/documents/parse` | 批量解析知识文档 |
|
||||
|
||||
当前边界:
|
||||
|
||||
- 元数据管理层已完成(知识库 CRUD、文档查询)。
|
||||
- 尚未实现"文档上传后自动建档"、"解析入库"、"切片向量化"、"检索问答"等业务流程。
|
||||
- 知识库 CRUD、文档 CRUD、批量上传、Tika 文本解析和状态流转已完成。
|
||||
- 解析结果当前只返回给调用方并更新文档状态,尚未写入 `rag_chunk`。
|
||||
- `rag_chunk`、`rag_chunk_embedding` 的结构层已就绪,尚未实现切片生成、向量化、索引任务和检索问答。
|
||||
|
||||
## 4. 数据模型关系
|
||||
|
||||
@@ -121,8 +142,10 @@
|
||||
| `sys_attachment` | 附件元数据 | 独立,被 rag_document 引用 |
|
||||
| `rag_store` | 知识库主表 | 独立 |
|
||||
| `rag_document` | 知识库文档表 | 关联 `rag_store.id` 和 `sys_attachment.id` |
|
||||
| `rag_chunk` | 知识切片表 | 关联 `rag_store.id` 和 `rag_document.id` |
|
||||
| `rag_chunk_embedding` | 切片向量表 | 关联 `rag_store.id`、`rag_document.id` 和 `rag_chunk.id` |
|
||||
|
||||
`rag_document` 是 RAG 模块与附件模块的连接点。
|
||||
`rag_document` 是 RAG 模块与附件模块的连接点,`rag_chunk` 和 `rag_chunk_embedding` 是下一步检索链路的核心落点。
|
||||
|
||||
## 5. 配置与运行
|
||||
|
||||
@@ -141,15 +164,15 @@
|
||||
|
||||
## 7. 当前不足
|
||||
|
||||
- RAG 尚未进入"可用链路",只有元数据管理层。
|
||||
- RAG 尚未进入"可检索链路",当前完成上传与解析,但未完成切片、向量化和召回。
|
||||
- Agent 运行时相关模型与服务尚未开始建设。
|
||||
- 前端部分页面(工作台、附件管理、知识文档)为占位状态。
|
||||
- 前端部分页面(工作台、附件管理、检索配置、最近任务)为占位或后续能力提示。
|
||||
- 缺少鉴权、租户、操作日志。
|
||||
|
||||
## 8. 建议演进方向
|
||||
|
||||
1. 补 RAG 最小闭环:上传附件 → 建立文档 → 状态流转 → 解析占位。
|
||||
1. 补 RAG 最小检索闭环:解析文本 → 生成切片 → 生成向量 → 检索召回。
|
||||
2. 接入 Spring AI,实现最小模型调用链路。
|
||||
3. 建设 Agent 域模型:Agent、Session、Message、Tool、Task。
|
||||
4. 补齐前端占位页面的表单与联调。
|
||||
5. 衔接模型供应商、工作流编排和前端管理台。
|
||||
4. 补齐索引任务、重试、重建索引和前端任务视图。
|
||||
5. 衔接模型供应商、工作流编排和前端管理台。
|
||||
|
||||
Reference in New Issue
Block a user