diff --git a/backend/app/agent/agent_service.py b/backend/app/agent/agent_service.py index 4e15210..e5127b9 100644 --- a/backend/app/agent/agent_service.py +++ b/backend/app/agent/agent_service.py @@ -37,6 +37,9 @@ class AIAgentService: if rag_tool: self.tools.append(rag_tool) self.tools_by_name[rag_tool.name] = rag_tool + # 关键:设置全局 RAG 工具,供 rag_nodes.py 使用 + from app.main_graph.nodes.rag_nodes import set_global_rag_tool + set_global_rag_tool(rag_tool) # 2. 构建各模型的 Graph(使用新版 React 模式) chat_services = get_all_chat_services()