Commit Graph

28 Commits

Author SHA1 Message Date
c9bf21be0e fix: 修复 RAG 无限循环问题和导入错误
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Has been cancelled
主要修复:
1. 修复 RAG 推理无限循环问题(大小写不匹配 + 缺少已检索结果检查)
2. 修复 intent_classifier.py 的绝对导入错误
3. 删除旧的 start.sh 脚本,添加新的启动脚本
4. 优化路由逻辑和状态管理
2026-05-04 18:59:15 +08:00
9841f47432 refactor: 重构RAG核心组件,简化代码结构和测试文件
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Failing after 6m53s
2026-05-04 17:58:10 +08:00
4209386c77 refactor: 统一导入方式,移除 sys.path 操作
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Failing after 6m22s
- 重构所有模块导入,移除 sys.path.insert
- 统一使用 from backend.xxx 的绝对导入方式
- rag_core 包内使用相对导入(from .xxx)
- 移动 visualize_graph.py 到 tools/ 目录
- 添加必要的 __init__.py 文件
- 清理废弃文档和脚本
2026-05-04 12:55:45 +08:00
82dde7113e 修改rag,实现混合检索
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 5m42s
2026-05-04 04:28:32 +08:00
80cda1362a 🗑️ 删除旧的 graph_builder.py
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Has been cancelled
- 保留最新的 main_graph/utils/main_graph_builder.py
- agent_service.py 已在使用新文件
- 旧文件是没有混合路由的老版本
2026-05-03 17:20:28 +08:00
a5fc9cd5d8 完整的混合路由优化系统
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 6m8s
1. 双模型服务 (llm + smallLLM)
   - 增加 get_small_llm_service() 函数
   - 支持智谱/DeepSeek 小模型作为轻量级选项

2. 前置混合路由
   - 规则快速分流(无 LLM,超快速)
   - 轻量级意图分类(smallLLM)
   - 快速路径:fast_chitchat, fast_rag, fast_tool

3. 自动升级机制
   - 快速路径失败 → 自动回到 React 循环
   - SSE 事件增强:intent_classified, path_decision, fast_path_*, escalation

4. 向后兼容
   - build_react_main_graph(use_hybrid_router=True/False)
   - 可选择启用或禁用混合路由

5. 更新 intent.py
   - 支持 use_small_llm 参数
   - 保留原有完整功能供 React 循环使用
2026-05-03 16:45:46 +08:00
3f6bbdec92 给关键节点添加思考过程输出
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 6m41s
- react_reason_node: 直接发送自定义推理事件
- web_search_node: 添加开始/完成/错误事件
- rag_retrieve_node: 添加开始/完成/重试/错误事件
- 子图包装器: 添加子图开始/完成/错误事件
2026-05-02 09:23:07 +08:00
afddea61f8 恢复循环推理架构,子图执行完回到react_reason
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 6m37s
- 恢复子图→react_reason的边
- 保持intent.py中的逻辑:检测到subgraph_completed就返回DIRECT_RESPONSE
- 保持llm_call中的逻辑:检测到final_result就直接返回
2026-05-02 09:11:38 +08:00
2893accbc4 修复三个问题:1. 子图执行后的无限循环 2. llm_call没有输出 3. 思考打印两次
- 子图执行后直接进入finalize,避免回到react_reason循环
- llm_call节点检查是否已有final_result,避免重复调用LLM
- 直接在react_reason_node中通过adispatch_custom_event发送推理事件,避免通过state传递导致重复
2026-05-02 09:00:34 +08:00
26b15aa4e5 feat: 新增 react_reason 循环思考过程的流式显示
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 5m38s
- 修改 react_nodes.py,在推理时保存推理过程到状态
- 修改 agent_service.py,检测并发送推理过程事件到前端
- 修改 chat_area.py,接收并显示推理过程
- 修改 useChat.ts,添加对推理过程事件的支持
2026-05-02 07:48:45 +08:00
a3e2a5aea4 修复状态兼容性问题: 移除 dict 解包操作
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 5m35s
2026-05-02 00:44:23 +08:00
563dea91d4 修复函数名错误:set_global_mem0_client -> set_mem0_client
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 6m4s
2026-05-02 00:25:32 +08:00
2403ce70a1 修复导入错误:更新 router.py 到 MainGraphState
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Failing after 7m44s
2026-05-02 00:07:11 +08:00
5d0a6e4aba 清理冗余注释
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Has been cancelled
2026-05-01 23:41:23 +08:00
9386b9fa7a 彻底重构状态系统:整合所有旧状态到 MainGraphState,修复所有节点
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Failing after 6m35s
2026-05-01 23:20:31 +08:00
9a58eb8e6d 简化图架构:暂时移除记忆相关节点,先让系统工作起来
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 5m40s
2026-05-01 23:09:10 +08:00
615b4b6eed 修复状态兼容性问题:让旧节点同时支持 dict 和 dataclass
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 6m39s
2026-05-01 22:45:42 +08:00
1f177f7dfd 整合旧图和新图:添加完整的记忆检索、总结和完成流程
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 5m42s
2026-05-01 15:43:45 +08:00
229cfa67a2 修改架构:llm_call后增加观察环节注释
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 5m56s
2026-05-01 15:00:17 +08:00
4ee769a79f 重构架构:恢复统一的 llm_call 节点,移除错误的 final_response 节点
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 5m50s
2026-05-01 14:01:48 +08:00
9ed946cbe3 修复: final_response_node 调用 LLM 并支持流式输出
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 6m36s
2026-05-01 13:42:12 +08:00
f95f5cb8f5 update: 日志级别改为DEBUG,推理步数改为40
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 5m37s
2026-05-01 10:49:19 +08:00
4a881ea32d fix: 修复导入路径
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 5m56s
2026-05-01 00:36:30 +08:00
7a08aacced refactor: 重命名文件更清晰,调整最大推理步数为10
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Failing after 6m49s
- subgraph_builder.py → main_graph_builder.py
- service.py → agent_service.py
- 调整 max_steps 从 40 → 10
- 更新所有相关导入
2026-05-01 00:24:00 +08:00
3e438b6e1c feat: 完善联网搜索功能集成到React模式
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 6m3s
2026-04-30 23:18:08 +08:00
4fe6b68819 添加公共工具:联网搜索(DuckDuckGo)和可视化图表(Mermaid)
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 10m38s
2026-04-29 23:10:15 +08:00
d6805d1db8 修复重构后的导入错误和缺失模块
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Failing after 6m26s
2026-04-29 17:23:20 +08:00
ef5113bffb refactor: 重构目录结构 - 简化层级
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Has been cancelled
2026-04-29 12:52:41 +08:00