Files
FilesReadSystem/logs/rag_disable_note.txt
KiriAky 107 e5711b3f05 新增联合上传模板和源文档功能
新增 upload-joint 接口支持模板文件和源文档的一键式联合上传处理,
包括异步文档解析和MongoDB存储功能;前端新增对应API调用方法和UI界
面,优化表格填写流程,支持拖拽上传和实时预览功能。
2026-04-09 20:35:41 +08:00

60 lines
2.2 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

RAG 服务临时禁用说明
========================
日期: 2026-04-08
修改内容:
----------
应需求RAG 向量检索功能已临时禁用,具体如下:
1. 修改文件: backend/app/services/rag_service.py
2. 关键变更:
- 在 RAGService.__init__ 中添加 self._disabled = True 标志
- index_field() - 添加 _disabled 检查,跳过实际索引操作并记录日志
- index_document_content() - 添加 _disabled 检查,跳过实际索引操作并记录日志
- retrieve() - 添加 _disabled 检查,返回空列表并记录日志
- get_vector_count() - 添加 _disabled 检查,返回 0 并记录日志
- clear() - 添加 _disabled 检查,跳过实际清空操作并记录日志
3. 行为变更:
- 所有 RAG 索引构建操作会被记录到日志 ([RAG DISABLED] 前缀)
- 所有 RAG 检索操作返回空结果
- 向量计数始终返回 0
- 实际向量数据库操作被跳过
4. 恢复方式:
- 将 RAGService.__init__ 中的 self._disabled = True 改为 self._disabled = False
- 重新启动服务即可恢复 RAG 功能
目的:
------
保留 RAG 索引构建功能的前端界面和代码结构,暂不实际调用向量数据库 API
待后续需要时再启用。
影响范围:
---------
- /api/v1/rag/search - RAG 搜索接口 (返回空结果)
- /api/v1/rag/status - RAG 状态接口 (返回 vector_count=0)
- /api/v1/rag/rebuild - RAG 重建接口 (仅记录日志)
- Excel/文档上传时的 RAG 索引构建 (仅记录日志)
========================
后续补充 (2026-04-08):
========================
修改文件: backend/app/services/table_rag_service.py
关键变更:
- 在 TableRAGService.__init__ 中添加 self._disabled = True 标志
- build_table_rag_index() - RAG 索引部分被跳过,仅记录日志
- index_document_table() - RAG 索引部分被跳过,仅记录日志
行为变更:
- Excel 上传时MySQL 存储仍然正常进行
- AI 字段描述仍然正常生成(调用 LLM
- 只有向量数据库索引操作被跳过
恢复方式:
- 将 TableRAGService.__init__ 中的 self._disabled = True 改为 self._disabled = False
- 或将 rag_service.py 中的 self._disabled = True 改为 self._disabled = False
- 两者需同时改为 False 才能完全恢复 RAG 功能