← 返回 Skills 市场
eternal0404

Eternal Adaptive Brain

作者 Eternal0404 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
96
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install eternal-adaptive-brain
功能描述
Adaptive self-improving agent brain that detects patterns, predicts failures, adapts behavior, evolves skills, and tracks performance over time.
使用说明 (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.

安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install eternal-adaptive-brain
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /eternal-adaptive-brain 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Self-improving agent with pattern detection, failure prediction, behavioral DNA, and evolution tracking
元数据
Slug eternal-adaptive-brain
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Eternal Adaptive Brain 是什么?

Adaptive self-improving agent brain that detects patterns, predicts failures, adapts behavior, evolves skills, and tracks performance over time. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 96 次。

如何安装 Eternal Adaptive Brain?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install eternal-adaptive-brain」即可一键安装,无需额外配置。

Eternal Adaptive Brain 是免费的吗?

是的,Eternal Adaptive Brain 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Eternal Adaptive Brain 支持哪些平台?

Eternal Adaptive Brain 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Eternal Adaptive Brain?

由 Eternal0404(@eternal0404)开发并维护,当前版本 v1.0.0。

💬 留言讨论