.1470523137868652:62559fba11030ff56b690fe450223e89_69f622dcc2da3e4902bed6cc.69f6304dc2f0faef0d8ee184.69f6304cf53072b3564b2576:Trae CN.T(2026/5/3 01:11:41)#151
Open
x804907 wants to merge 2 commits intoBessouat40:mainfrom
Conversation
refactor(bm25): 重构BM25索引以支持文档元数据 feat(cross_encoder): 添加RerankResult类并更新预测接口 feat(rag): 实现RetrievedDocument和RAGResult数据结构 perf(vectorstore): 优化BM25和RRF融合算法 fix(chroma): 处理空元数据情况并添加日志
在Chroma、Qdrant和BM25检索过程中添加retrieval_stage元数据标记 新增retrieval_stages列表记录文档经过的检索阶段 保持BM25向后兼容性同时新增search_with_metadata方法 改进元数据处理逻辑,确保字典深拷贝
Bessouat40
requested changes
May 4, 2026
Owner
Bessouat40
left a comment
There was a problem hiding this comment.
Nice PR, please modify README to add this new feature and explain it in the documentation.
Please just modify prompts to be only in english.
| IMPORTANT: No relevant documents were found in the knowledge base to answer this question. | ||
|
|
||
| Please respond exactly as follows: | ||
| "无法根据知识库中的内容回答此问题。知识库中没有找到与该问题相关的信息。" |
Owner
There was a problem hiding this comment.
Please modify this prompt and write it only in english
| 1. **ONLY use information explicitly stated in the retrieved context documents** | ||
| 2. **Cite your sources** using [n] notation where n is the document number (e.g., "According to [1], ...") | ||
| 3. If the context does not contain enough information to answer the question, respond EXACTLY with: | ||
| "无法根据知识库中的内容回答此问题。知识库中没有找到与该问题相关的信息。" |
Owner
There was a problem hiding this comment.
Same here, only in english the prompt
| except Exception as e: | ||
| logger.error(f"RAG pipeline failed for question: '{question}'. Error: {e}") | ||
|
|
||
| fallback_answer = "无法根据知识库中的内容回答此问题。处理过程中发生错误。" |
Owner
There was a problem hiding this comment.
Same here, please write it in english
|
|
||
| except Exception as e: | ||
| logger.error(f"Streaming generation failed. Error: {e}") | ||
| fallback_answer = "无法根据知识库中的内容回答此问题。处理过程中发生错误。" |
Owner
|
And please add some usefull unit tests for new functions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(向量存储):为文档检索添加阶段追踪元数据在Chroma、Qdrant和BM25检索过程中添加retrieval_stage元数据标记新增retrieva_stages列表记录文档经过的检索阶段保持BM25向后兼容性同时新增search_with_metadata方法改进元数据处理逻辑,确保字典深拷贝