Self-Improving Agent v2.0 - 自我进化智能体
**自我反思 + 自我学习 + 自我改进** 的 AI 代理系统。
by davidme6 · published 2026-03-22
$ claw add gh:davidme6/davidme6-self-improving-v2# Self-Improving Agent v2.0 - 自我进化智能体
🎯 技能描述
**自我反思 + 自我学习 + 自我改进** 的 AI 代理系统。
基于 Anthropic 的自我进化理念,结合记忆管理系统,实现:
---
✨ 核心功能
1️⃣ 每日自动反思(3 次)
| 时间 | 内容 | 说明 |
|------|------|------|
| **09:00** | 早晨反思 | 回顾昨天,规划今天 |
| **14:00** | 下午反思 | 上午复盘,调整下午 |
| **21:00** | 晚上反思 | 全天总结,整理记忆 |
**反思模板:**
## 🤔 反思 - [时间]
### 1. 做得好的
- [具体事项]
### 2. 可以改进的
- [错误/不足]
### 3. 学到的新东西
- [新知识/认知]
### 4. 用户偏好更新
- [新偏好/需求变化]
### 5. 后续行动
- [待办事项]---
2️⃣ 对话记录保存
**保存策略:**
| 内容类型 | 保存方式 | 清理策略 |
|---------|---------|---------|
| **文字对话** | 全量保存 | ✅ 永久保存 |
| **图片** | 保存 | ✅ 永久保存 |
| **重要决策** | 提取到 MEMORY.md | ✅ 永久保存 |
| **代码/脚本** | 全量保存 | ✅ 永久保存 |
| **视频** | 临时保存 | 🔄 月清理 |
| **大型文件** | 临时保存 | 🔄 月清理 |
**保存位置:**
📂 workspace/
├── MEMORY.md # 长期记忆(精华,永久)
├── memory/
│ ├── YYYY-MM-DD.md # 每日记忆(永久)
│ └── ...
└── media/
├── images/ # 图片(永久)
└── videos/ # 视频(月清理)---
3️⃣ MEMORY.md 整理
**整理频率:**
**整理内容:**
✅ 应该存入的:
- 重要决策
- 用户偏好
- 长期目标
- 关键人脉/资源
- 核心技能/能力
❌ 不应存入的:
- 临时待办
- 日常闲聊
- 已完成的琐事
- 过时的信息---
🔧 技术实现
系统架构:
self-improving/
├── SKILL.md # 技能说明
├── scripts/
│ ├── memory_manager.py # 记忆管理主脚本
│ ├── daily_reflection.py # 每日反思
│ ├── save_conversation.py # 对话保存
│ └── organize_memory.py # 记忆整理
├── cron/
│ └── reflection_jobs.json # 定时任务配置
└── tests/
└── test_memory.py # 测试脚本Cron 定时任务:
{
"jobs": [
{
"name": "记忆反思 - 早晨 09:00",
"schedule": "0 9 * * *",
"action": "daily_reflection morning"
},
{
"name": "记忆反思 - 下午 14:00",
"schedule": "0 14 * * *",
"action": "daily_reflection afternoon"
},
{
"name": "记忆反思 - 晚上 21:00",
"schedule": "0 21 * * *",
"action": "daily_reflection evening + organize"
}
]
}---
📋 使用方法
安装:
clawhub install self-improving配置:
# 启用定时任务
openclaw cron add self-improving-reflection
# 查看任务状态
openclaw cron list手动使用:
# 保存对话
python scripts/memory_manager.py save "主题" "要点 1" "要点 2"
# 手动反思
python scripts/memory_manager.py reflect [morning|afternoon|evening]
# 整理记忆
python scripts/memory_manager.py organize---
🆚 v1.0 vs v2.0 更新说明
v1.0 功能:
v2.0 新增:
核心改动:
| 模块 | v1.0 | v2.0 | 改进 |
|------|------|------|------|
| **反思频率** | 手动 | 自动 3 次/天 | ⬆️ 自动化 |
| **对话保存** | ❌ | ✅ 全量 | ⬆️ 完整性 |
| **图片保存** | ❌ | ✅ 永久 | ⬆️ 新能力 |
| **视频清理** | ❌ | ✅ 月清理 | ⬆️ 空间管理 |
| **记忆整理** | ❌ | ✅ 自动 | ⬆️ 智能化 |
| **Cron 任务** | ❌ | ✅ 3 个定时 | ⬆️ 自动化 |
---
📊 记忆存储策略
永久保存(不清理):
✅ 所有文字对话
✅ 所有图片
✅ 重要决策
✅ 用户偏好
✅ 代码/脚本
✅ MEMORY.md
✅ memory/YYYY-MM-DD.md月度清理:
🔄 视频文件(>30 天)
🔄 大型附件(>30 天)
🔄 临时文件(>30 天)清理脚本:
# 每月 1 号自动执行
def monthly_cleanup():
# 清理>30 天的视频
cleanup_videos(older_than=30)
# 清理>30 天的大型文件
cleanup_large_files(older_than=30)
# 保留所有文字和图片
preserve_text_and_images()---
🎯 最佳实践
1. 每日反思
2. 对话保存
3. 记忆整理
---
🚀 发布说明
发布到 ClawHub:
clawhub publish self-improving --version 2.0.0发布到 GitHub:
git add .
git commit -m "feat: v2.0 - 完整的自我进化系统"
git tag v2.0.0
git push origin main --tags更新日志:
## [2.0.0] - 2026-03-20
### Added
- 每日自动反思 3 次(09:00/14:00/21:00)
- 对话记录全量保存
- 图片永久保存
- 视频月清理机制
- MEMORY.md 自动整理
- Cron 定时任务系统
### Changed
- 反思从手动改为自动
- 记忆从临时改为永久(文字/图片)
- 清理策略优化
### Improved
- 自动化程度提升
- 记忆管理更智能
- 空间管理更合理---
📄 许可证
MIT License
---
👥 贡献
欢迎提交 Issue 和 PR!
---
*版本:2.0.0*
*最后更新:2026-03-20*
*作者:Jarvis*
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...