[知识进化] 经验自动沉淀管道 — LLM 提取关键经验 → RAG 入库 #60

Closed
opened 2026-05-10 15:32:18 +08:00 by admin · 0 comments
Owner

目标

从执行日志中自动提取可复用的知识,让一个 Agent 踩过的坑所有 Agent 都能避开。

管道流程

Agent执行日志 → 筛选高质量执行(success=True + user_feedback>=4)→ LLM 提取经验(做了什么、怎么做的、为什么成功、注意事项)→ 结构化知识条目 → Embedding → RAG 向量库 → 原始日志关联(可回溯)

知识条目结构

  • title: 一句话标题(如"处理MySQL 死锁的重试策略")
  • category: bug_fix / best_practice / workaround / optimization
  • tags: ["mysql", "deadlock", "retry"]
  • situation: 什么场景下遇到的问题
  • solution: 怎么解决的
  • caveats: 注意事项
  • source_execution_ids: [原始执行ID]

新增文件

  • backend/app/services/knowledge_extractor.py
  • backend/app/models/knowledge_entry.py
  • Celery 定时任务:每小时运行一次提取管道
## 目标 从执行日志中自动提取可复用的知识,让一个 Agent 踩过的坑所有 Agent 都能避开。 ## 管道流程 Agent执行日志 → 筛选高质量执行(success=True + user_feedback>=4)→ LLM 提取经验(做了什么、怎么做的、为什么成功、注意事项)→ 结构化知识条目 → Embedding → RAG 向量库 → 原始日志关联(可回溯) ## 知识条目结构 - title: 一句话标题(如"处理MySQL 死锁的重试策略") - category: bug_fix / best_practice / workaround / optimization - tags: ["mysql", "deadlock", "retry"] - situation: 什么场景下遇到的问题 - solution: 怎么解决的 - caveats: 注意事项 - source_execution_ids: [原始执行ID] ## 新增文件 - backend/app/services/knowledge_extractor.py - backend/app/models/knowledge_entry.py - Celery 定时任务:每小时运行一次提取管道
admin closed this issue 2026-05-10 17:58:10 +08:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/aiagent#60