fix: increase RAG search top_k from 3 to 10
With only 3 results, passport queries often miss family members since all passport files have similar low relevance scores. Increasing to 10 ensures all related documents are included in LLM context. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2
bot.py
2
bot.py
@@ -336,7 +336,7 @@ class DocumentRAG:
|
|||||||
self.use_local_rag = bool(self.rag_endpoint)
|
self.use_local_rag = bool(self.rag_endpoint)
|
||||||
self.enabled = bool(self.rag_endpoint) or bool(portal_url and bot_api_key)
|
self.enabled = bool(self.rag_endpoint) or bool(portal_url and bot_api_key)
|
||||||
|
|
||||||
async def search(self, query: str, top_k: int = 3, api_key: str | None = None, org_slug: str | None = None, matrix_user_id: str | None = None) -> list[dict]:
|
async def search(self, query: str, top_k: int = 10, api_key: str | None = None, org_slug: str | None = None, matrix_user_id: str | None = None) -> list[dict]:
|
||||||
if not self.enabled or not matrix_user_id:
|
if not self.enabled or not matrix_user_id:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user