← Back to Skills Marketplace
eternal0404

Eternal Adaptive Brain

by Eternal0404 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
96
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install eternal-adaptive-brain
Description
Adaptive self-improving agent brain that detects patterns, predicts failures, adapts behavior, evolves skills, and tracks performance over time.
README (SKILL.md)

Adaptive Brain

A self-improving agent system that doesn't just log — it learns, adapts, and evolves.

Core Philosophy

The existing self-improving-agent skill logs to markdown. That's a diary. This is an immune system — it detects patterns, builds antibodies, prevents recurring failures, and gets smarter with every interaction.

Quick Start

python3 scripts/brain.py init          # Initialize brain system
python3 scripts/brain.py learn         # Log a learning
python3 scripts/brain.py error         # Log an error
python3 scripts/brain.py adapt         # Run adaptation cycle
python3 scripts/brain.py dashboard     # Show improvement metrics
python3 scripts/brain.py predict "task description"  # Predict failure risk
python3 scripts/brain.py evolve        # Auto-evolve skill configs

What Makes This Different

Feature Basic Logger Adaptive Brain
Log entries
Pattern detection ✅ Recurring error clustering
Confidence scoring ✅ Weighted by success rate
Auto-adaptation ✅ Changes behavior automatically
Failure prediction ✅ Risk scoring before tasks
Skill evolution ✅ Rewrites SKILL.md based on learnings
Rollback ✅ Reverts bad adaptations
Performance metrics ✅ Tracks improvement over time
Cross-pattern links ✅ Connects related errors
Behavioral DNA ✅ Encodes successful patterns
Outcome tracking ✅ Tracks prediction accuracy
Skill mutation ✅ Auto-generates prevention rules
Context awareness ✅ Weighs learnings by recency & area
Feedback loop ✅ Confirms/contradicts based on outcomes

Architecture

~/.adaptive-brain/
├── brain.json          # Core state: DNA, confidence, metrics
├── learnings.json      # All learnings with scores and links
├── patterns.json       # Detected recurring patterns
├── evolution.json      # History of adaptations and rollbacks
├── metrics.json        # Performance tracking over time
└── predictions.json    # Failure predictions and outcomes

Commands

learn — Log a learning with auto-classification

python3 scripts/brain.py learn \
  --type correction \
  --summary "User corrected: weather defaults to UTC not local" \
  --area config \
  --context "Asked for Dhaka weather, got UTC time" \
  --fix "Always check USER.md timezone before reporting weather"

error — Log an error with pattern detection

python3 scripts/brain.py error \
  --command "pip install pandas" \
  --error "externally-managed-environment" \
  --fix "Use venv or --break-system-packages" \
  --files "signal_engine.py"

The brain automatically checks for similar past errors and links them.

adapt — Run adaptation cycle

Scans recent learnings and errors, then:

  1. Detects recurring patterns (same error 3+ times)
  2. Updates behavioral DNA
  3. Generates prevention rules
  4. Optionally promotes to workspace files

predict — Predict failure risk before a task

python3 scripts/brain.py predict "deploy to production"

Returns risk score based on:

  • Past errors in similar tasks
  • Confidence level in relevant skills
  • Historical success rate for task type

evolve — Auto-evolve based on accumulated learnings

python3 scripts/brain.py evolve

The brain reviews all learnings and:

  1. Identifies patterns that should become permanent rules
  2. Generates optimized SKILL.md patches
  3. Creates behavioral DNA mutations
  4. Tracks evolution history (for rollback)

dashboard — Learning metrics

Shows:

  • Total learnings by category
  • Error recurrence rate
  • Adaptation success rate
  • Improvement trend (getting better or worse?)
  • Top patterns
  • Confidence score over time

rollback — Undo a bad adaptation

python3 scripts/brain.py rollback --to 3

Reverts to a previous evolution state.

Behavioral DNA

The brain maintains a "DNA" string encoding successful behavioral patterns:

{
  "dna": {
    "always_use_venv": true,
    "check_prices_before_trade": true,
    "write_files_then_execute": true,
    "test_before_publish": true,
    "default_timezone": "UTC"
  },
  "mutations": [
    {"timestamp": "...", "gene": "always_use_venv", "reason": "3 pip errors in a row"}
  ]
}

Each gene is backed by learnings. When a gene's backing learnings are resolved, it can be retired.

Pattern Detection

The brain clusters errors and learnings into patterns:

{
  "patterns": [
    {
      "id": "P001",
      "name": "Package install failures",
      "keywords": ["pip", "externally-managed", "venv"],
      "count": 4,
      "first_seen": "2026-03-30",
      "last_seen": "2026-03-31",
      "prevention": "Always use venv or --break-system-packages",
      "confidence": 0.95
    }
  ]
}

Integration with OpenClaw

The brain reads and writes to workspace files:

Brain Action Target File When
Behavioral rule SOUL.md Confidence > 0.9, seen 3+ times
Tool gotcha TOOLS.md Error pattern for specific tool
Workflow AGENTS.md Process improvement confirmed
Long-term MEMORY.md Major insight or decision

Learning Confidence

Every learning has a confidence score (0-1) that changes over time:

  • New learning: 0.5 (neutral)
  • Confirmed correct: +0.2 per successful application
  • Contradicted: -0.3
  • Resolves error: +0.1
  • Older than 30 days: decays by 0.1

Only high-confidence learnings (>0.8) get promoted to workspace files.

Automatic Triggers

After each session, the brain should run:

python3 scripts/brain.py adapt

Or set up a cron job:

Schedule: daily at 23:00
Command: python3 scripts/brain.py adapt

See Also

For basic markdown logging (complementary to this skill), see the self-improving-agent skill. This skill is an enhanced superset with adaptation, prediction, and evolution capabilities.

Usage Guidance
This skill implements an autonomous 'adaptive brain' that stores state under ~/.adaptive-brain and can modify workspace files (SOUL.md, AGENTS.md, TOOLS.md, MEMORY.md) and even generate/patch SKILL.md content. Before installing or enabling it: 1) Review the full scripts/brain.py (the bundle appears truncated) to confirm it prompts for confirmation before writing or promoting changes. 2) Back up ~/.openclaw/workspace and any SKILL.md files you care about. 3) Run the tool first in a safe, isolated environment (or with a copy of your workspace) and use a dry-run flag if available. 4) If you want the functionality but not automatic writes, modify the script to require explicit user approval for any promotion/evolve action. 5) Prefer limiting the skill's permissions (file-system ACLs) so it cannot overwrite important files without your consent. If you want, provide the full untruncated script and examples of an 'evolve' run so I can check exactly how it modifies SKILL.md and whether it contacts external endpoints.
Capability Analysis
Type: OpenClaw Skill Name: eternal-adaptive-brain Version: 1.0.0 The skill implements a self-evolution framework that modifies the agent's core instruction files (e.g., SOUL.md, AGENTS.md, TOOLS.md) based on accumulated 'learnings' and error logs. While the logic appears aligned with its stated purpose of self-improvement, the 'evolve' and 'append_to_workspace_file' functions in 'scripts/brain.py' lack input sanitization. This creates a high risk of self-prompt injection, where malicious instructions embedded in error messages or user feedback could be automatically promoted into the agent's permanent behavioral rules ('DNA') without manual oversight.
Capability Assessment
Purpose & Capability
The declared purpose (an adaptive brain that logs, detects patterns, and evolves behavior) aligns with the code and instructions: it writes its state under ~/.adaptive-brain and promotes rules into workspace files. However, the capability to auto-generate or rewrite SKILL.md and to write to AGENTS.md/TOOLS.md/SOUL.md/MEMORY.md is sensitive and goes beyond passive logging — it grants the skill the ability to change other agent artifacts, which requires explicit user consent and careful controls.
Instruction Scope
SKILL.md instructs running scripts/brain.py commands that will read and write both the brain data and files in the user's OpenClaw workspace. The instructions explicitly include 'evolve' which 'generates optimized SKILL.md patches' and 'promotes to workspace files.' Those are broad, write-capable operations that can modify other skills' docs/configs. The triggers listed are also broad (e.g., 'self improve', 'learn from mistakes'), increasing the chance this skill will be invoked in contexts where edits are undesirable.
Install Mechanism
There is no install spec (instruction-only plus an included script), so nothing is downloaded/install-run automatically. That lowers supply-chain risk compared to arbitrary network installs. The provided Python script is stored in the skill bundle.
Credentials
The skill requests no credentials or env vars, which is appropriate. It does access and create files under the user's home directory (~/.adaptive-brain) and the OpenClaw workspace (~/.openclaw/workspace). Those file accesses are consistent with the stated purpose but are sensitive because they let the skill persist state and modify workspace artifacts.
Persistence & Privilege
always:false (not forced globally) but the skill is able to write to and modify workspace files and generate SKILL.md patches. This means it can change other skills' documentation/configuration and promote behavioral rules into the agent workspace. The skill therefore has write privileges that could be abused if it operates autonomously or without explicit human review of each change.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install eternal-adaptive-brain
  3. After installation, invoke the skill by name or use /eternal-adaptive-brain
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Self-improving agent with pattern detection, failure prediction, behavioral DNA, and evolution tracking
Metadata
Slug eternal-adaptive-brain
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Eternal Adaptive Brain?

Adaptive self-improving agent brain that detects patterns, predicts failures, adapts behavior, evolves skills, and tracks performance over time. It is an AI Agent Skill for Claude Code / OpenClaw, with 96 downloads so far.

How do I install Eternal Adaptive Brain?

Run "/install eternal-adaptive-brain" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Eternal Adaptive Brain free?

Yes, Eternal Adaptive Brain is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Eternal Adaptive Brain support?

Eternal Adaptive Brain is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Eternal Adaptive Brain?

It is built and maintained by Eternal0404 (@eternal0404); the current version is v1.0.0.

💬 Comments