← 返回
未分类

Self Improving Agent

AI Self-Improving Agent v2 - Learn from mistakes, corrections, and successes. Three-layer system: passive capture + proactive check + proactive skill generat...
AI自我提升代理 v2 - 从错误、纠正和成功中学习。三层系统:被动捕获 + 主动检查 + 主动技能生成……
haiqingge
未分类 clawhub v2.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 356
下载
💾 0
安装
1
版本
#latest#learning#memory#skill-generation#v2

概述

Self-Improving Agent v2

让AI从错误中学习,越用越聪明。参考 Hermes Agent 的"做-学-改"循环,实现主动式记忆与技能生成。

Three-Layer Learning System

Layer 1: Passive Capture (Automatic)

  • Command fails → errors.jsonl
  • User corrects AI → corrections.jsonl
  • Discover best practice → best_practices.jsonl

Layer 2: Proactive Check (Before Execution)

  • Check relevant memories before running commands
  • Heartbeat scans for knowledge blind spots

Layer 3: Proactive Skill Generation (New - From Hermes)

Core insight from Hermes Agent: When a complex task succeeds, proactively propose generating a reusable Skill.

  • Complex task succeeds (>10 steps) → Propose generating a Skill
  • Same pattern repeats 3+ times → Auto-generalize to template
  • Best practice discovered → Solidify into executable script
  • New tool/skill learned → Save to skills-generated/

Problem Statement

✅ Same command fails repeatedly, AI uses wrong method next time

✅ User corrects AI's style/preference, AI forgets next session

✅ Same pitfall hit repeatedly in the same project

✅ Better approach discovered but not systematically remembered

✅ External tool/API changes, AI still using old knowledge

Complex task succeeds, no one thinks to generate reusable Skill ← NEW

Repeated pattern detected, no auto-generalization mechanism ← NEW

Quick Start

# Install
mkdir -p ~/.openclaw/memory/self-improving
mkdir -p ~/.openclaw/skills-generated

# Log an error
python3 log_error.py --command "npm install xxx" --error "permission denied" --fix "use sudo"

# Log a correction
python3 log_correction.py --topic "code style" --wrong "double quotes" --correct "single quotes"

# Generate a Skill (after successful complex task)
python3 generate_skill.py \
  --name "my-tool" \
  --trigger "related task description" \
  --desc "What this tool does" \
  --files "path/to/file.py" \
  --notes "Important context"

# Check before running
python3 check_memory.py --command "npm install"

File Structure

~/.openclaw/memory/self-improving/
├── errors.jsonl          # Error logs
├── corrections.jsonl     # User corrections
├── best_practices.jsonl  # Best practices
├── skills_registry.json  # Generated skills registry
└── index.json           # Quick index

~/.openclaw/skills-generated/     # Auto-generated Skills
├── my-tool/
│   └── SKILL.md
└── another-tool/
    └── SKILL.md

Proactive Generation Triggers

ScenarioActionType
------------------------
Command failsLog to errorsPassive
User correctsLog to correctionsPassive
Complex task succeeds (>10 steps)Propose Skill generationProactive
Same task done 3+ timesAuto-generalize to templateProactive
Heartbeat scanDetect knowledge blind spotsProactive
New tool/skill learnedSolidify to skills-generatedProactive

Skill Registry Format

{
  "skills": [
    {
      "name": "bbu-config-tool",
      "trigger": "BBU config / TR-069 parameter modification",
      "description": "Modify BBU device confdb_v2.xml via SSH, supports ZTP factory reset",
      "files": ["D:/tools/bbu_config_gui.py"],
      "created_at": "2026-04-14",
      "success_count": 5,
      "last_used": "2026-04-14",
      "auto_trigger": true
    }
  ]
}

Proactive Generation Flow

Task Completed
  ↓
Evaluate: (>10 steps? repeat>3x? general value?)
  ↓ Yes
Ask: "Want me to save this as a reusable Skill?"
  ↓ User confirms
Generate Skill/SKILL.md
  ↓
Register to skills_registry.json
  ↓
Next similar task → Auto-recommend

Comparison with Hermes Agent

FeatureHermesOurs
-----------------------
Auto-solidify✅ Fully automatic⚠️ User confirms first
Pattern recognition✅ Auto-generalize⚠️ Trigger-based
Skill qualityHighMedium (needs human review)
Execution environmentSelf-contained sandboxExternal dependencies

Our advantage: User-controlled, transparent, no irreversible actions.

Notes

  • Generated Skills need human quality review
  • Sensitive info should be masked
  • Periodically clean up outdated Skills
  • After generating Skill, sync to memory index

v2 Updated 2026-04-14: Added proactive Skill generation layer (inspired by Hermes Agent)

版本历史

共 1 个版本

  • v2.0.0 当前
    2026-05-07 21:20 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,062 📥 799,929
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,363 📥 319,046
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 672 📥 324,525