OpenClawBrain for Openclaw

A self-regulating, learned memory graph that enables AI agents to evolve through autonomous feedback and policy-gradient routing.

jonathangu
v12.2.1
Feb 28, 2026
0
428
1

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install openclawbrain

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install openclawbrain using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is OpenClawBrain?

OpenClawBrain is a high-performance memory architecture designed to provide AI agents with a dynamic, evolving knowledge base. Unlike static retrieval systems, it utilizes a learned retrieval graph where nodes represent document chunks and edges represent mutable weighted pointers. This structure is essential for developers building sophisticated Openclaw Skills, as it allows agents to learn from interaction outcomes using REINFORCE policy-gradient updates. By redistributing probability mass across edges, OpenClawBrain ensures that retrieval paths are optimized for accuracy and relevance over time.

The system is engineered for resilience and autonomy, incorporating biological-inspired mechanisms such as homeostatic decay and synaptic scaling. These features ensure that the memory graph remains organized and efficient, preventing hub domination and maintaining a healthy ratio of reflex edges. Whether you are building complex coding assistants or autonomous research agents, OpenClawBrain provides the underlying protocol for persistent, self-correcting memory within the ecosystem of Openclaw Skills.

OpenClawBrain Use Cases

  • Creating AI agents that require long-term memory and the ability to self-correct based on previous mistakes.
  • Developing Openclaw Skills that need to navigate large, complex codebases or documentation sets with high precision.
  • Implementing autonomous learning loops where agents refine their own retrieval strategies without human supervision.
  • Optimizing RAG (Retrieval-Augmented Generation) workflows through policy-gradient weight adjustments on document chunks.

How OpenClawBrain Works

  1. The workspace files are analyzed and chunked into nodes based on file type (e.g., Python functions, Markdown headers).
  2. Initial embeddings are generated to create a baseline retrieval graph with weighted edges.
  3. Agents query the graph via a beam search traversal, firing relevant nodes to build context for their tasks.
  4. After an action is performed, a learning update (REINFORCE) is applied to the fired nodes, adjusting edge weights based on a positive or negative outcome.
  5. The system performs autonomous self-learning by injecting new knowledge or inhibitory edges when an agent detects a failure or a new fact.
  6. A background maintenance pipeline runs periodically to scale synaptic weights, prune dead edges, and merge or split nodes for optimal graph health.

OpenClawBrain Setup

To start using this memory graph for your Openclaw Skills, install the core package via pip:

pip install openclawbrain
# Or with OpenAI support
pip install "openclawbrain[openai]"

Initialize your brain by indexing a workspace:

openclawbrain init --workspace ./my-workspace --output ./brain --embedder openai

For production environments, run the daemon to keep the state hot in memory:

openclawbrain daemon --state ./brain/state.json --embed-model text-embedding-3-small

OpenClawBrain Data Schema & Taxonomy

OpenClawBrain organizes information into a specialized graph structure stored in a state.json file. The schema includes:

Component Details
Nodes Individual content chunks with metadata such as ID, type (TEACHING, CORRECTION, DIRECTIVE), and character count.
Edges Weighted pointers between nodes, categorized into Tiers: Reflex (≥ 0.6), Habitual (0.15 - 0.6), Dormant (< 0.15), and Inhibitory (< -0.01).
State Metadata Includes embedder identity, dimension specifications, and graph health metrics to ensure compatibility across Openclaw Skills.
Persistence Atomic writes with .bak failover protection to prevent data corruption during crashes.

OpenClawBrain Advanced Features

  • Policy-Gradient Learning: Uses the REINFORCE algorithm to redistribute edge weights, ensuring retrieval strategies evolve based on success rates.
  • Autonomous Self-Correction: Enables agents to trigger the self-learn command to penalize bad paths and inject inhibitory knowledge dynamically.
  • Self-Regulation: Implements homeostatic decay with adaptive half-lives and synaptic scaling to prevent any single node from dominating the retrieval graph.
  • Tier Hysteresis: Features a habitual band (0.15-0.6) that prevents threshold thrashing, providing stable and predictable agent behavior.
  • Production Daemon: Provides a Unix socket interface for high-speed queries (~500ms), making it ideal for real-time Openclaw Skills applications.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*