Skip to content

.1470523137868652:62559fba11030ff56b690fe450223e89_69f622dcc2da3e4902bed6cc.69f6304dc2f0faef0d8ee184.69f6304cf53072b3564b2576:Trae CN.T(2026/5/3 01:11:41)#151

Open
x804907 wants to merge 2 commits intoBessouat40:mainfrom
x804907:LLRAG12

Conversation

@x804907
Copy link
Copy Markdown

@x804907 x804907 commented May 2, 2026

feat(向量存储):为文档检索添加阶段追踪元数据在Chroma、Qdrant和BM25检索过程中添加retrieval_stage元数据标记新增retrieva_stages列表记录文档经过的检索阶段保持BM25向后兼容性同时新增search_with_metadata方法改进元数据处理逻辑,确保字典深拷贝

x804907 added 2 commits May 3, 2026 00:40
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方法
改进元数据处理逻辑,确保字典深拷贝
Copy link
Copy Markdown
Owner

@Bessouat40 Bessouat40 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/raglight/rag/rag.py
IMPORTANT: No relevant documents were found in the knowledge base to answer this question.

Please respond exactly as follows:
"无法根据知识库中的内容回答此问题。知识库中没有找到与该问题相关的信息。"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please modify this prompt and write it only in english

Comment thread src/raglight/rag/rag.py
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:
"无法根据知识库中的内容回答此问题。知识库中没有找到与该问题相关的信息。"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, only in english the prompt

Comment thread src/raglight/rag/rag.py
except Exception as e:
logger.error(f"RAG pipeline failed for question: '{question}'. Error: {e}")

fallback_answer = "无法根据知识库中的内容回答此问题。处理过程中发生错误。"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, please write it in english

Comment thread src/raglight/rag/rag.py

except Exception as e:
logger.error(f"Streaming generation failed. Error: {e}")
fallback_answer = "无法根据知识库中的内容回答此问题。处理过程中发生错误。"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, in english please

@Bessouat40
Copy link
Copy Markdown
Owner

And please add some usefull unit tests for new functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants