Skip to content

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

Removed the "USER:" in the question, reducing the accuracy of the search (#7852)

Solbc578e1e83da
diff --git a/agent/component/retrieval.py b/agent/component/retrieval.py
index 859d65478b..218dae9699 100644
--- a/agent/component/retrieval.py
+++ b/agent/component/retrieval.py
@@ -96,6 +96,7 @@ class Retrieval(ComponentBase, ABC):
rerank_mdl = LLMBundle(kbs[0].tenant_id, LLMType.RERANK, self._param.rerank_id)
if kbs:
+ query = re.sub(r"^user[::\s]*", "", query, flags=re.IGNORECASE)
kbinfos = settings.retrievaler.retrieval(
query,
embd_mdl,