S

Skill 详情

Self Improving Agent

OpenClaw自改进代理系统,支持从交互、错误及恢复中持续学习,自动优化性能。

来源平台:SkillHub
来源标识:SkillHub/self-improver
源文件:原始说明
AI 平台与模型 热门 SkillHub 高 风险 下载 716安装 34 SkillHub
来源平台SkillHub
文档版本3.2.1
热度热门
排名信号下载 716
概述 安装 文档 下载

快速判断

OpenClaw自改进代理系统,支持从交互、错误及恢复中持续学习,自动优化性能。

最后校验2026-05-27
来源平台SkillHub
安全提示
下载副本ZIP 可用

适合任务

  • 按 SkillHub 收录说明复用成熟任务流程。
  • 通过下载包离线阅读完整 Skill 内容。
  • 结合热度指标优先评估常用 Skill。

输入与输出

输入:任务目标、上下文材料、文件路径、约束条件或需要处理的内容。

输出:按 Skill 说明生成的文档、代码、检查结果、计划、建议或操作步骤。

示例任务

  • 使用 Self Improving Agent 帮我处理当前任务,并说明需要准备哪些输入。
  • 根据 Self Improving Agent 的说明,先列出使用前的安全检查项。

安装方式

  1. 下载本站提供的 Skill ZIP 并解压。
  2. 把解压后的 Skill 目录放入当前 AI 工具支持的 skills 目录。
  3. 如需在线查看原始内容,可打开 GitHub 的 SKILL.md

在线原始地址:skillhub-self-improver/SKILL.md

风险边界

SkillHub 提供了源站安全报告入口,但本站不替代人工审查。使用前仍需检查权限、外部依赖和敏感数据边界。

SKILL.md 文档介绍

Self-Improving Agent

A continuous learning agent system for OpenClaw that learns from:

  • Interactions - Learn from every conversation
  • Errors - Learn from mistakes to avoid them
  • Recoveries - Learn what works to recover successfully

---

✨ Features

  • 🧠 Continuous Learning - Learns from every interaction
  • Error Learning - Learns from mistakes to avoid repetition
  • Recovery Learning - Learns successful recovery patterns
  • 🔄 Auto-Improvement - Automatically applies improvements
  • 📚 Memory System - Stores and retrieves learnings
  • 🔌 Hook System - Extensible hook system for custom improvements
  • 📊 Progress Tracking - Track improvement over time
  • 🔧 Python CLI - Easy to use command-line interface
  • 🧩 OpenClaw Skill - Seamless integration with OpenClaw

---

🚀 Quick Start

Prerequisites

  • Python 3.10+
  • OpenClaw installed
  • pip or uv package manager

Installation

As OpenClaw Skill

# Clone to OpenClaw skills directory
cd ~/.openclaw/workspace/skills
git clone https://github.com/leohuang8688/self-improving-agent.git

Auto-learning is enabled by default! After each OpenClaw session, the agent will automatically learn and improve.

As Python Package

# Clone the repository
git clone https://github.com/leohuang8688/self-improving-agent.git
cd self-improving-agent

# Install with pip
pip install -e .

# Or install with uv
uv pip install -e .

Basic Usage

Automatic Mode (Recommended)

Just use OpenClaw normally! Learning happens automatically after each session, error, or recovery.

# Start OpenClaw
openclaw

# Use it normally...

# Exit OpenClaw
# → Auto-learning triggers automatically!

Manual Mode

# Run the self-improving agent
python -m self_improving_agent run

# Learn from last session
python -m self_improving_agent learn

# Learn from errors
python -m self_improving_agent learn-errors

# Learn from recoveries
python -m self_improving_agent learn-recoveries

# Review all learnings
python -m self_improving_agent review

# Export learnings to file
python -m self_improving_agent export

---

📖 Commands

run - Run the Agent

Executes the self-improving agent with all applied improvements.

python -m self_improving_agent run --workspace /path/to/workspace

learn - Learn from Session

Analyzes the last session and extracts learnings.

python -m self_improving_agent learn --verbose

learn-errors - Learn from Errors

Analyzes error logs and extracts learnings.

python -m self_improving_agent learn-errors --verbose

learn-recoveries - Learn from Recoveries

Analyzes recovery logs and extracts successful patterns.

python -m self_improving_agent learn-recoveries --verbose

review - Review Learnings

Reviews all stored learnings.

python -m self_improving_agent review --verbose

export - Export Learnings

Exports all learnings to a markdown file.

python -m self_improving_agent export

---

🪝 Hook System

Available Hooks

onSessionEnd(session)

  • Triggered: When session ends
  • Purpose: Post-session learning, cleanup, save state
  • Parameter: session - Session object

onError(error)

  • Triggered: When an error occurs
  • Purpose: Error logging, learning from mistakes
  • Parameter: error - Error object

onRecovery()

  • Triggered: When recovering from error
  • Purpose: Learn successful recovery patterns
  • Parameter: None

---

📝 Learning Types

1. Session Learning

  • Triggered by: onSessionEnd
  • Learns from: Conversation patterns, user preferences
  • Stored in: learnings/sessions.json

2. Error Learning

  • Triggered by: onError
  • Learns from: Mistakes, errors, failures
  • Stored in: learnings/errors.json
  • Purpose: Avoid repeating mistakes

3. Recovery Learning

  • Triggered by: onRecovery
  • Learns from: Successful recoveries
  • Stored in: learnings/recoveries.json
  • Purpose: Repeat successful recovery patterns

---

📁 Project Structure

self-improving-agent/
├── src/
│   ├── hooks.py              # Hook manager
│   └── ...
├── hooks/
│   └── error_learning.py     # Error learning hook
├── learnings/
│   ├── sessions.json         # Session learnings
│   ├── errors.json           # Error learnings
│   └── recoveries.json       # Recovery learnings
├── main.py
├── README.md
└── SKILL.md

---

🔧 Configuration

In OpenClaw configuration file:

{
  "hooks": {
    "internal": {
      "enabled": true,
      "entries": {
        "self-improve": {
          "enabled": true
        },
        "error-learning": {
          "enabled": true
        }
      }
    }
  }
}

---

📊 Learning Files

learnings/errors.json

[
  {
    "timestamp": "2026-03-15T12:30:00",
    "error_type": "ValueError",
    "error_message": "Invalid parameter",
    "context": {
      "traceback": "..."
    }
  }
]

learnings/recoveries.json

[
  {
    "timestamp": "2026-03-15T12:35:00",
    "recovery_method": "automatic_recovery"
  }
]

---

🎯 Best Practices

1. Review learnings regularly - Review and apply learnings weekly

2. Export learnings - Export learnings for backup

3. Apply learnings - Apply learnings to improve future performance

4. Clean old learnings - Remove outdated learnings periodically

---

📝 License

MIT License

👨‍💻 Author

PocketAI for Leo - OpenClaw Community

建议反馈