← Back to Plugins
Tools

Evolution

muse2019 By muse2019 👁 3 views ▲ 0 votes

Self-evolution plugin for OpenClaw - learns from errors and improves itself

GitHub

Install

npm install
npm

Configuration Example

{
  "plugins": ["openclaw-evolution"]
}

README

# OpenClaw Evolution Plugin

A self-evolution plugin for OpenClaw that enables the AI assistant to learn from errors and improve itself over time.

## Features

- **Error-Driven Learning**: Automatically analyzes errors and generates improvement proposals
- **Periodic Analysis**: Scheduled framework and metrics analysis
- **Manual Triggers**: User can request evolution at any time
- **Risk-Based Approval**: Four-level system (L0-L3) for safe self-modification
- **Rollback Support**: Every change can be undone

## Installation

```bash
cd ~/.openclaw/plugins
git clone <repository-url> openclaw-evolution
cd openclaw-evolution
npm install
npm run build
```

Then add to your OpenClaw config:

```json
{
  "plugins": ["openclaw-evolution"]
}
```

## Usage

### Manual Evolution

```
User: ่ฟ›ๅŒ–ไธ€ไธ‹
User: ่‡ชๆˆ‘ๆ”น่ฟ›
User: /evolve
```

### Check Status

```
User: ่ฟ›ๅŒ–็Šถๆ€
User: /evolution_status
```

### Rollback

```
User: ๅ›žๆปšไธŠไธ€ไธช่ฟ›ๅŒ–
User: /evolution_rollback <id> <reason>
```

## Risk Levels

| Level | Name | Behavior | Examples |
|-------|------|----------|----------|
| L0 | Auto | Execute without confirmation | Typo fixes, phrasing improvements |
| L1 | Ask | Show preview, ask for confirmation | New skills, instruction changes |
| L2 | Suggest | Generate report only | Deletions, behavior changes |
| L3 | Forbidden | Never modify | Secrets, auth data |

## Safety Mechanisms

### Path Restrictions

- **Allowed**: skills, preferences, memory
- **Blocked**: auth, secrets, .env files

### Rate Limits

Prevents excessive modifications per hour/day.

### Rollback

Every evolution records before/after snapshots for easy rollback.

## Configuration

Edit `config/evolution-config.json`:

```json
{
  "enabled": true,
  "triggers": {
    "error": { "threshold": 3, "cooldownMinutes": 30 },
    "timer": { "intervalHours": 24 }
  },
  "limits": {
    "L0": { "perHour": 10, "perDay": 50 },
    "L1": { "perHour": 5, "perDay": 20 }
  }
}
```

## Architecture

```
openclaw-evolution/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ index.ts          # Plugin entry
โ”‚   โ”œโ”€โ”€ engine.ts         # Core orchestrator
โ”‚   โ”œโ”€โ”€ types.ts          # Type definitions
โ”‚   โ”œโ”€โ”€ triggers/         # Error, timer, manual triggers
โ”‚   โ”œโ”€โ”€ analyzers/        # Root cause, framework, metrics
โ”‚   โ”œโ”€โ”€ classifiers/      # Risk classification
โ”‚   โ”œโ”€โ”€ executors/        # L0-L3 execution handlers
โ”‚   โ”œโ”€โ”€ storage/          # Error log, evolution log, metrics
โ”‚   โ””โ”€โ”€ safety/           # Path checker, rate limiter, rollback
โ”œโ”€โ”€ skills/evolve/        # SKILL.md definition
โ”œโ”€โ”€ config/               # Default configuration
โ””โ”€โ”€ dist/                 # Compiled output
```

## License

MIT
tools

Comments

Sign in to leave a comment

Loading comments...