微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🧠

持续进化,越用越智能

Self Improving Agent · v3.2.0
效率 安全 B 级 作者 leohuang8688 公开目录收录
1.1k 下载 0 安装 2.2k 收藏 1 浏览

简介

OpenClaw 自学习代理系统,通过持续分析交互、错误和恢复过程自动优化性能,实现经验驱动的智能进化。

原始描述

Self-improving agent system for OpenClaw. Enables continuous learning from interactions, errors, and recoveries. Automatically improves performance over time.

通过你的 Agent 添加

安装目录:self-improving-agent/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/self-improving-agent-47445/
Codex CLI~/.codex/skills/self-improving-agent-47445/
DeepSeek Harness~/.agents/skills/self-improving-agent-47445/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

技能正文


name: self-improving-agent description: Self-improving agent system for OpenClaw. Enables continuous learning from interactions, errors, and recoveries. Automatically improves performance over time.

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

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

machine-learningautomationopenclawcli-toolproductivityself-improvement

同类 Skill