Xpersona
B

brainmd

CLAWHUB · Unverified

Neuroplastic self-modifying runtime for AI agents. Creates a file-based 'brain' that learns from interactions: reflexes (fast-path responses), habits (learne... Skill: brainmd Owner: p0lish Summary: Neuroplastic self-modifying runtime for AI agents. Creates a file-based 'brain' that learns from interactions: reflexes (fast-path responses), habits (learne... Tags: latest:0.1.3 Version history: v0.1.3 | 2026-03-26T08:50:05.834Z | user Rewrote SKILL.md with concrete OpenClaw wiring instructions, pathway weight guide, dream.js integration, bootstrapping checklist v0.1.2 | 2026-0

62
Rank
84
Safety
1.0k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s171cfdte6rt5vsb4j37q962kn83ncye:brainmd
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-p0lish-brainmd/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

58,292 characters of source documentation, loaded on request.

Extracted files

4 files captured from the source.

SKILL.md

---
name: brainmd
description: "Neuroplastic self-modifying runtime for AI agents. Creates a file-based 'brain' that learns from interactions: reflexes (fast-path responses), habits (learned patterns), weighted pathways (reinforcement), and a cortex (self-review loop). Use when: setting up adaptive agent behavior, creating learning loops, building persistent behavioral memory, or making an agent that improves over time."
---

# brainmd

*File-based nervous system for AI agents. Behaviors that work get stronger. Behaviors that fail get weaker. Unused patterns decay. Mistakes leave scars.*

---

## What It Is

brainmd gives your agent a persistent behavioral memory that survives session restarts. It's not a knowledge base — it's muscle memory. It tracks *how* the agent behaves, not *what* it knows.

Three layers complement each other:

| Layer | File | Purpose |
|---|---|---|
| **brainmd** | `brain/weights/pathways.json` | Behavioral reinforcement — what works, what doesn't |
| **Long-term memory** | `MEMORY.md` | Semantic facts — decisions, people, context |
| **Daily log** | `memory/YYYY-MM-DD.md` | Episodic notes — what happened today |

brainmd is the only layer that self-modifies. The others are written by the agent, not evolved by it.

---

## Installation

```bash
clawhub install brainmd
```

Then initialize the brain in your workspace:

```bash
cd ~/.openclaw/workspace
./skills/brainmd/scripts/init-brain.sh brain/
```

This creates:

```
brain/
├── reflexes/           # Fast-path decision scripts
├── habits/
│   └── preferences.json
├── weights/
│   └── pathways.json   # ← the core state file
├── cortex/
│   └── review.js       # ← the self-review engine
└── mutations/          # Immutable audit log
```

---

## Wiring Into OpenClaw

### Step 1 — AGENTS.md

Add a startup check so the agent reads its neural state at session start:

```markdown
## 🧠 brainmd — Consult Your Brain

After reading memory files, check your neural state:

```bash
node ~/.openclaw/workspace/brain/cortex/review.js status
```

Before acting on anything non-trivial, scan for relevant pathways:
- Weak pathways (< 0.5) = you've failed here before. Be careful, double-check.
- Strong pathways (> 0.8) = proven patterns. Trust them, act fast.
- Dying pathways (decaying) = you're forgetting something. Re-evaluate.

After notable outcomes, record them:
```bash
node brain/cortex/review.js record "pathway-name" true/false "what happened"
```
```

### Step 2 — HEARTBEAT.md

Wire the review cycle into your heartbeat so it runs automatically:

```markdown
## 🧠 brainmd Self-Check (every heartbeat)

```bash
node ~/.openclaw/workspace/brain/cortex/review.js review
node ~/.openclaw/workspace/brain/cortex/review.js status
```

On each heartbeat, ask yourself:
1. Did I make a mistake since last check? → `record <pathway> false "what happened"`
2. Did something work well? → `record <pathway> true "what worked"`
3. Did a new pattern emerge? → let neurogenesis create it
```

### Step 3 — S

README.md

# 🧠 brainmd

**Neuroplastic runtime for AI agents.** File-based behavioral learning.

An AI agent's memory resets every session. brainmd gives it scar tissue.

---

## What is this?

brainmd is a lightweight system that lets AI agents learn from their own behavior over time. No ML pipeline, no vector database, no training runs — just JSON files, shell scripts, and a self-review loop.

Every behavior becomes a **pathway** with a weight between 0 and 1. Pathways that succeed get stronger. Pathways that fail get weaker. Unused pathways decay. New situations create new pathways automatically (neurogenesis). Everything is logged.

Think of it as a nervous system made of files.

## Architecture

```
brain/
├── reflexes/       # Fast-path automatic responses
│   └── timing.js   # When to notify vs stay quiet
├── habits/         # Learned behavioral patterns
│   └── preferences.json
├── skills/         # Self-generated micro-scripts
├── weights/        # Pathway strength tracking
│   └── pathways.json     # ← the core state
├── cortex/         # Meta-scripts that modify everything else
│   └── review.js         # ← the self-review engine
└── mutations/      # Immutable audit log (never delete this)
```

## Quick Start

### 1. Initialize

```bash
./scripts/init-brain.sh ~/my-agent/brain
```

This creates the directory structure with empty state files.

### 2. Record behaviors

When something works:
```bash
node cortex/review.js record "reflex:night-silence" true "Didn't ping user at 3 AM — correct call"
```

When something fails:
```bash
node cortex/review.js record "habit:check-files-first" false "Searched the web for info that was already in local files"
```

New pathways are created automatically (neurogenesis) when you record a behavior that doesn't exist yet. Starting weight: 0.30.

### 3. Self-review

Run periodically (heartbeat, cron, whatever):
```bash
node cortex/review.js review
```

The cortex will:
- **Strengthen** pathways with >80% success rate (+0.05)
- **Weaken** pathways with <50% success rate (-0.10)
- **Decay** pathways unused for 7+ days (-0.02)
- **Prune** pathways that hit weight 0

### 4. Check status

```bash
node cortex/review.js status
```

```
🧠 Neural Pathway Status

  ██████████ 0.95 reflex:morning-briefing (100%, 3 fires)
             Batch overnight findings, present at reasonable hour
  ██████████ 0.95 reflex:night-silence (100%, 5 fires)
             Don't notify between 23:00-08:00 unless urgent
  ██████░░░░ 0.60 habit:check-files-before-search (75%, 4 fires)
             Check local files before web searching
  █░░░░░░░░░ 0.10 reflex:fallback-on-ratelimit (0%, 5 fires)
             Keep failing — indicates a bug, not a behavior problem
```

## Pathway Types

| Prefix | Purpose | Decay | Min Weight |
|--------|---------|-------|------------|
| `reflex:` | Automatic, fast-path behaviors | Slow | 0.20 |
| `habit:` | Learned patterns from interaction | Normal | 0 (prunable) |
| `skill:` | Acquired capabilities | Slow | 0.1

_meta.json

{
  "ownerId": "kn7ae42hyr98k12ry0nr9dhrds829ky0",
  "slug": "brainmd",
  "version": "0.1.3",
  "publishedAt": 1774515005834
}

skill-card.md

## Description:

Neuroplastic self-modifying runtime for AI agents that creates a file-based brain for reflexes, habits, weighted pathways, reinforcement, and a cortex self-review loop.

This skill is ready for commercial/non-commercial use.

## Publisher:

[p0lish](https://clawhub.ai/user/p0lish)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and agent operators use brainmd to add persistent file-based behavioral memory to an AI agent, record outcomes as weighted pathways, and run review cycles that strengthen, weaken, decay, or prune behavior patterns.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: The skill is designed to create persistent self-modifying agent behavior and the server security verdict is suspicious because safeguards for unattended use are limited.

Mitigation: Install only when persistent behavioral memory is intentional; keep the brain directory private and require human approval before enabling heartbeat or cron automation.

Risk: Pathway records can influence future actions if raw notes or untrusted pathway text are incorporated into prompts.

Mitigation: Review and sanitize pathway notes before use, avoid placing raw notes in system or developer prompts, and require manual approval for new behavior pathways that affect future decisions.

Risk: Review and prune operations can mutate or remove behavior state.

Mitigation: Review and back up pathways.json before automated review cycles or pruning, and preserve mutation logs for auditability.

## Reference(s):

- [ClawHub skill page](https://clawhub.ai/p0lish/skills/brainmd)
- [Artifact README](artifact/README.md)
- [Artifact skill definition](artifact/SKILL.md)

## Skill Output:

**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]

**Output Format:** [Markdown guidance with shell commands, JavaScript snippets, JSON examples, and generated local files]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Initializes and updates a local file-based brain directory, including pathway state and mutation logs.]

## Skill Version(s):

0.1.3 (source: server release evidence and artifact metadata)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to brainmd and adjacent AI workflows.