-
|
I observed in Chat, when switch on reasoning mode, the chat won't do the graph rag. It seems not search the knowledge graph. So I searched the code in main branch (also similar in v.0.22.1), the kg_retriever will function in the "else" block of checking "reasoning" option. I wonder why "reasoning" feature is conflicting with "knowledge_graph" search? ragflow/api/db/services/dialog_service.py Line 423 in 5776fa7 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hi @gwyuan! I'm Dosu and I’m helping the ragflow team. This happens because when reasoning mode is enabled, the chat switches to an agentic pipeline (using the DeepResearcher class) that handles its own retrieval logic. In the current implementation, the knowledge graph retriever is not wired into this agent, so even if "use_kg" is set, the knowledge graph is never searched during reasoning. The normal KG retrieval only runs in the non-reasoning path, as you saw in the code. This isn't explicitly documented as a design goal, but it's a result of how the agentic reasoning and retrieval hooks are connected in the codebase. The architectural direction in recent versions was to decouple KG retrieval from the main retrieval path for performance and simplicity—KG search is resource-intensive and meant for advanced use cases, not the default chat flow. If you want KG retrieval during reasoning, you'd need to modify the code to pass the KG retriever into the DeepResearcher agent so it can be used in the reasoning loop. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Hi @gwyuan! I'm Dosu and I’m helping the ragflow team.
This happens because when reasoning mode is enabled, the chat switches to an agentic pipeline (using the DeepResearcher class) that handles its own retrieval logic. In the current implementation, the knowledge graph retriever is not wired into this agent, so even if "use_kg" is set, the knowledge graph is never searched during reasoning. The normal KG retrieval only runs in the non-reasoning path, as you saw in the code. This isn't explicitly documented as a design goal, but it's a result of how the agentic reasoning and retrieval hooks are connected in the codebase. The architectural direction in recent versions was to decouple KG r…