RSI Loop - Recursive Self-Improvement
name: rsi-loop
by bowen31337 · published 2026-04-01
$ claw add gh:bowen31337/bowen31337-rsi-loop---
name: rsi-loop
description: >
Recursive Self-Improvement (RSI) loop for EvoClaw agents. Provides a structured
observe→analyze→synthesize→deploy pipeline that enables agents to detect their own
failure patterns and generate concrete improvement proposals (new skills, routing fixes,
SOUL.md updates, memory improvements). Use when: (1) logging a task outcome (success/fail/quality),
(2) running periodic self-improvement analysis, (3) reviewing or deploying improvement proposals,
(4) integrating RSI into EvoClaw hub/edge agents via MQTT, (5) checking agent health score,
(6) any mention of "self-improvement", "recursive improvement", "fix my own mistakes",
"improvement loop", or "agent evolution". Core EvoClaw primitive.
---
# RSI Loop - Recursive Self-Improvement
Four-stage pipeline: **Observe → Analyze → Synthesize → Deploy**
Quick Start
# Log an outcome
uv run python skills/rsi-loop/scripts/rsi_cli.py log \
--task code_generation --success true --quality 4 --model glm-4.7
# Full cycle (detect patterns + generate + deploy quick wins)
uv run python skills/rsi-loop/scripts/rsi_cli.py cycle
# Status dashboard
uv run python skills/rsi-loop/scripts/rsi_cli.py statusData Layout
skills/rsi-loop/data/
├── outcomes.jsonl # All logged turn outcomes
├── patterns.json # Latest analysis output
└── proposals/ # Improvement proposals (one JSON per proposal)
├── abc12345.json # draft/approved/rejected/deployed
└── ...Stage 1: Observer — Log Outcomes
Log every significant task at completion. Be honest about quality (1=terrible, 5=perfect).
# Successful task
uv run python skills/rsi-loop/scripts/rsi_cli.py log \
--task code_generation --success true --quality 4
# Failed task with issues
uv run python skills/rsi-loop/scripts/rsi_cli.py log \
--task code_debug --success false --quality 2 \
--issues skill_gap rate_limit \
--notes "No Rust-specific debug skill, kept hitting context limits"**Task types:** code_generation, code_debug, code_review, architecture_design, file_ops,
web_search, memory_retrieval, skill_creation, cron_management, api_integration,
data_analysis, message_routing, infrastructure_ops, documentation, general_qa,
trading, monitoring, blockchain, unknown
**Issue types:** rate_limit, model_fallback, tool_error, wrong_output, incomplete_task,
context_loss, memory_miss, skill_gap, bad_routing, slow_response, over_confirmation,
repeated_mistake, missing_tool, wrong_model_tier, compaction_lost_context, other
Stage 2: Analyzer — Detect Patterns
uv run python skills/rsi-loop/scripts/analyzer.py --days 7 --top 5Outputs ranked patterns by impact score = (frequency/total) × quality_deficit.
Saves to `data/patterns.json`.
Stage 3: Synthesizer — Generate Proposals
# Generate proposals from latest patterns
uv run python skills/rsi-loop/scripts/synthesizer.py generate --top 5
# Review proposals
uv run python skills/rsi-loop/scripts/synthesizer.py list
# Show full proposal detail
uv run python skills/rsi-loop/scripts/synthesizer.py show <proposal_id>
# Approve for deployment
uv run python skills/rsi-loop/scripts/synthesizer.py approve <proposal_id>Stage 4: Deployer — Apply Improvements
# Dry run (see what would happen)
uv run python skills/rsi-loop/scripts/deployer.py deploy <id> --dry-run
# Deploy a specific proposal
uv run python skills/rsi-loop/scripts/deployer.py deploy <id>
# Deploy all approved proposals
uv run python skills/rsi-loop/scripts/deployer.py deploy-all**Action types and what they do:**
Full Cycle (Automated)
# Run full cycle, auto-deploy anything estimated < 20 minutes effort
uv run python skills/rsi-loop/scripts/deployer.py full-cycle \
--days 7 --auto-approve-below-mins 20
# Or use the CLI shortcut
uv run python skills/rsi-loop/scripts/rsi_cli.py cycleCron Job (Weekly RSI)
Set up automated weekly analysis:
# Every Sunday at 3 AM AEST
openclaw cron add --name "Weekly RSI Cycle" \
--cron "0 3 * * 0" \
--tz "Australia/Sydney" \
--model "anthropic-proxy-4/glm-4.7" \
--system-event "Run RSI cycle: uv run python skills/rsi-loop/scripts/rsi_cli.py cycle --days 7"EvoClaw Integration
For fleet-wide RSI across all hub/edge agents, see:
Proactive Logging Protocol
Log outcomes for every significant task. Rule of thumb:
This builds the dataset that makes RSI work.
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...