Self-Improving Agent v2 for Openclaw

A three-layer learning system that enables AI agents to learn from execution errors and automatically generate reusable skills from successful complex tasks.

haiqingge
v2.0.0
Apr 14, 2026
0
769
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install haiqing-self-improving-agent

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install haiqing-self-improving-agent using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Self-Improving Agent v2?

The Self-Improving Agent v2 is a sophisticated learning framework for AI agents, inspired by the Hermes Agent "Do-Learn-Correct" loop. It transforms standard agent interactions into a persistent learning experience by capturing errors, corrections, and successful patterns. This skill ensures that your agent becomes progressively more efficient by using Openclaw Skills to build a personalized knowledge base and an automated library of custom-generated tools.

By implementing a three-layer system—passive capture, proactive checking, and proactive skill generation—this tool addresses the common problem of AI agents repeating the same mistakes. It moves beyond simple memory by actively proposing the creation of new, reusable skills whenever it detects a successful multi-step workflow or a recurring task pattern, significantly boosting long-term productivity.

Self-Improving Agent v2 Use Cases

  • Preventing recurring command failures by automatically logging and referencing successful fixes.
  • Preserving user-specific coding styles and preferences across different sessions through correction logging.
  • Converting complex, successful multi-step workflows into permanent Openclaw Skills for future use.
  • Identifying and automating repetitive task patterns by generalizing them into reusable templates.

How Self-Improving Agent v2 Works

  1. Passive Capture: The system monitors all agent actions, logging command failures to errors.jsonl and manual user corrections to corrections.jsonl.
  2. Proactive Checking: Before executing any new command, the agent scans its memory index to identify relevant best practices or previous errors to avoid.
  3. Evaluation: Upon successful completion of a complex task (typically over 10 steps) or a task repeated 3+ times, the agent evaluates if the workflow should be solidified.
  4. Proactive Skill Generation: The agent asks for user confirmation to generate a new skill, creating a dedicated directory with a SKILL.md and necessary scripts.
  5. Registration: The new tool is registered in the skills-registry.json, allowing it to be automatically recommended or triggered during future similar tasks.

Self-Improving Agent v2 Setup

To get started with the Self-Improving Agent and manage your Openclaw Skills, set up the directory structure and initialize the memory logs:

# Create the memory and skill generation directories
mkdir -p ~/.openclaw/memory/self-improving
mkdir -p ~/.openclaw/skills-generated

# Log an initial correction to test the system
python3 log_correction.py --topic "code style" --wrong "double quotes" --correct "single quotes"

# Verify memory before running commands
python3 check_memory.py --command "npm install"

Self-Improving Agent v2 Data Schema & Taxonomy

The skill manages information using a structured taxonomy within the Openclaw Skills environment:

File/Folder Description Format
errors.jsonl Logs of failed commands, error messages, and successful fixes. JSONL
corrections.jsonl Tracks user-provided corrections regarding logic or style. JSONL
best_practices.jsonl Stores high-value shortcuts and optimal execution methods. JSONL
skills_registry.json A central registry for all auto-generated skills and their triggers. JSON
skills-generated/ The storage location for new SKILL.md files and executable scripts. Directory

Self-Improving Agent v2 Advanced Features

  • Multi-Layer Learning: Combines automatic error logging with proactive skill synthesis for a complete intelligence lifecycle.
  • Hermes-Inspired Solidification: Detects successful complex tasks and proposes turning them into permanent Openclaw Skills.
  • Pattern Recognition: Automatically identifies when a task pattern has been repeated three times and suggests template generalization.
  • Heartbeat Scans: Proactively analyzes memory files to detect knowledge blind spots or outdated tool configurations.
  • Human-in-the-loop Control: Ensures all generated skills are reviewed by a human before being added to the permanent registry.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*