Self Improving Agent CN
AI自我改进与记忆系统 - 解决'同类错误反复犯、用户纠正不长记性'的痛点。自动捕获错误、用户纠正、最佳实践,并转化为长期记忆。
New
Join 0+ developers using this skill
skill
AI & Machine Learning
intermediate
AI自我改进与记忆系统 - 解决'同类错误反复犯、用户纠正不长记性'的痛点。自动捕获错误、用户纠正、最佳实践,并转化为长期记忆。
Real data. Real impact.
Emerging
Developers
Per week
Open source
Skills give you superpowers. Install in 30 seconds.
让AI从错误中学习,越用越聪明。
✅ 命令/操作莫名失败,下次还用同样的错方式
✅ 反复纠正AI的写法、偏好、风格,它下个会话又忘了
✅ 同一个项目里反复踩同一个坑
✅ 发现更好的做法/更优解法,却没有系统化记住
✅ 外部工具/API变动,AI还在用旧知识
✅ 重要经验只存在于当前会话,跨天/跨项目就丢失
# 创建记忆目录 mkdir -p ~/.openclaw/memory/self-improving使用本skill
cat ~/.openclaw/skills/self-improving-agent/SKILL.md
当命令失败时,自动记录到错误库:
# 脚本会自动捕获并记录 python3 ~/.openclaw/skills/self-improving-agent/log_error.py \ --command "npm install xxx" \ --error "permission denied" \ --fix "use sudo or check permissions"
当用户说:
自动记录:
python3 ~/.openclaw/skills/self-improving-agent/log_correction.py \ --topic "代码风格" \ --wrong "用了双引号" \ --correct "项目要求单引号" \ --context "AGENTS.md 第23行"
发现更好的做法时:
python3 ~/.openclaw/skills/self-improving-agent/log_best_practice.py \ --category "security" \ --practice "安装skill前必须审计代码" \ --reason "防止供应链投毒"
# 执行命令前,先检查是否有相关记忆 python3 ~/.openclaw/skills/self-improving-agent/check_memory.py \ --command "npm install"
输出示例:
⚠️ 发现相关记忆: [错误] 2026-03-05: npm install 权限失败 → 改用 sudo 或在用户目录安装 [纠正] 2026-03-04: 项目使用单引号而非双引号
~/.openclaw/memory/self-improving/ ├── errors.jsonl # 错误记录 ├── corrections.jsonl # 用户纠正 ├── best_practices.jsonl # 最佳实践 ├── knowledge_gaps.jsonl # 知识盲区 └── index.json # 快速索引
| 场景 | 自动记录 | 触发词 |
|---|---|---|
| 命令失败 | ✅ errors | 退出码非0 |
| 用户纠正 | ✅ corrections | "不对" "错了" "应该" |
| 更好的方法 | ✅ best_practices | "更好的" "更高效" "最优" |
| 知识过时 | ✅ knowledge_gaps | "过时了" "已废弃" "新版是" |
重要记忆自动同步到:
~/.openclaw/memory/self-improving/ (全局).learnings/ (项目级)AGENTS.md (用户偏好)MEMORY.md (长期记忆)| 功能 | 原self-improvement | 本skill |
|---|---|---|
| 记录错误 | ✅ | ✅ |
| 记录纠正 | ✅ | ✅ 增强版 |
| 自动触发 | ❌ 手动 | ✅ 自动 |
| 跨项目记忆 | ❌ 项目级 | ✅ 全局+项目 |
| 执行前检查 | ❌ | ✅ |
| 知识过时检测 | ❌ | ✅ |
用户: "不对,我说过项目里要用单引号"
AI动作:
corrections.jsonlAGENTS.md 添加代码风格规则AI: 执行
npm install -g xxx
结果: 权限失败
AI动作:
errors.jsonlsudo npm install -g xxx 或本地安装用户: "其实用 pip install -e . 更高效"
AI动作:
best_practices.jsonlCreated: 2026-03-05 by 老二
No automatic installation available. Please visit the source repository for installation instructions.
View Installation Instructions1,500+ AI skills, agents & workflows. Install in 30 seconds. Part of the Torly.ai family.
© 2026 Torly.ai. All rights reserved.