Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix agentic chat low/medium cannot answer the table content (#18196)

Wang Qi7e536c761471
diff --git a/rag/advanced_rag/harness/tools/search.py b/rag/advanced_rag/harness/tools/search.py
index f3fb1046bd..2753a50bec 100644
--- a/rag/advanced_rag/harness/tools/search.py
+++ b/rag/advanced_rag/harness/tools/search.py
@@ -201,9 +201,9 @@ def _normalize(kbinfos: dict, tenant_ids: list[str] | str | None) -> dict:
async def hybrid_search(tools, query: str, kb_ids: list[str] | None = None, top_n: int = 12, doc_scope: list[str] | None = None, keywords: str = "", use_compiled: bool = False) -> dict:
- if not tools.kb_ids and not kb_ids:
+ target_ids = kb_ids or list(dict.fromkeys(tools.kb_ids + [kb.id for kb in tools.sql_kbs]))
+ if not target_ids:
return {"chunks": [], "doc_aggs": []}
- target_ids = kb_ids or tools.kb_ids
if hasattr(tools, "scoped_doc_ids"):
doc_scope = tools.scoped_doc_ids(doc_scope)
_LOG.info(f'[Hybrid search] Searching the knowledge base for "{query}" (keywords: {keywords})')