让AI从错误中学习,越用越聪明。参考 Hermes Agent 的"做-学-改"循环,实现主动式记忆与技能生成。
errors.jsonlcorrections.jsonlbest_practices.jsonlCore insight from Hermes Agent: When a complex task succeeds, proactively propose generating a reusable Skill.
skills-generated/✅ 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
bash
# 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"
text
~/.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
ScenarioActionTypeCommand failsLog to errorsPassiveUser correctsLog to correctionsPassiveComplex task succeeds (>10 steps)Propose Skill generationProactiveSame task done 3+ timesAuto-generalize to templateProactiveHeartbeat scanDetect knowledge blind spotsProactiveNew tool/skill learnedSolidify to skills-generatedProactive
json
{
"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
}
]
}
text
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
FeatureHermesOursAuto-solidify✅ Fully automatic⚠️ User confirms firstPattern recognition✅ Auto-generalize⚠️ Trigger-basedSkill qualityHighMedium (needs human review)Execution environmentSelf-contained sandboxExternal dependencies
Our advantage: User-controlled, transparent, no irreversible actions.
v2 Updated 2026-04-14: Added proactive Skill generation layer (inspired by Hermes Agent)