Tools
Evolution
Self-evolution plugin for OpenClaw - learns from errors and improves itself
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