Skip to content

Repository files navigation

BrainClaw (v1.6.0-enterprise-intelligence)

Definitive 2026+ Standard | 1,238,953 Relationships | Verified Perfection

BrainClaw is a Hybrid GraphRAG memory plugin for OpenClaw. It combines canonical memory storage, hybrid retrieval, graph reasoning, contradiction checks, provenance tracking, and operational memory sync so OpenClaw agents can recall and reuse knowledge across sessions without relying on MEMORY.md files as the primary memory system.

Overview

BrainClaw is designed around one authority model (see BENCHMARK.md for verified performance metrics):

  • PostgreSQL is the canonical durable memory ledger for BrainClaw's Hybrid GraphRAG memory system
  • Weaviate is a derived semantic retrieval index
  • Neo4j is a derived graph reasoning index

Everything else feeds or derives from that canonical layer.

Core Capabilities

  • Durable memory search and lookup
  • Canonical ingest and promotion workflow
  • Hybrid GraphRAG retrieval with research-backed Mode-Aware Hub (Local, Global, DRIFT, Lazy)
  • Prompt-time recall so BrainClaw becomes the active memory source
  • Agent-end capture of decisions and procedures
  • Universal Leiden Community Detection (GDS with Python-native fallback)
  • Graph health inspection and contradiction review
  • Background entity extraction, summarization, audit logging, and contradiction detection
  • Operational memory sync for root and agent MEMORY.md state blocks
  • Automatic Lossless-Claw detection, compatibility gating, and artifact integration
  • CLI surfaces for memory sync, rebuilds, and Lossless-Claw installation/ops

Architecture

BrainClaw is split into two layers:

  • TypeScript OpenClaw plugin layer for tools, hooks, services, runtime gating, and CLI registration
  • Python backend for storage, retrieval, graph operations, ingestion, promotion policy, and integration workflows

The main entrypoints are:

Major Feature: Lossless-Claw Integration

Lossless-Claw integration is one major BrainClaw feature, not the project identity.

When Lossless-Claw is installed alongside BrainClaw, BrainClaw can:

  • detect the active Lossless-Claw install
  • verify OpenClaw runtime compatibility and slot configuration
  • fingerprint the Lossless-Claw SQLite schema
  • import LCM artifacts as source_artifacts
  • extract memory_candidates from those artifacts
  • apply contradiction checks and promotion policy before durable writes
  • use Lossless-Claw as supplemental drill-down evidence when needed

Critical rule:

  • Lossless-Claw is upstream context only
  • BrainClaw remains the canonical Hybrid GraphRAG memory authority

Primary implementation files for this feature:

Recent Releases

  • v1.6.0-enterprise-intelligence (Current): 90a2a97 feat: BrainClaw v1.6.0 - Two-Pass Extraction, Numeric Normalization, and Hybrid Retrieval Optimization
  • v1.5.0-intel-perfection: 236aba8 feat: BrainClaw Perfection 2026+ Audit - Relationship Enhancement, Thematic Consolidation, and Knowledgebase UI
  • v1.5.0-intel: e81051a feat: Phase 12 Factual HybridGraph UI (BrainClaw Memory, Lossless Memories, Knowledgebase, Self-learning Entries)
  • v1.5.0: 5db43b1 feat: BrainClaw v1.5.0 - Universal Leiden Fallback & Mode-Aware Retrieval

v1.6.0-enterprise-intelligence achieves Sub-second Knowledge Retrieval and high-fidelity graph reasoning:

  • Two-Pass Extraction: Achieves 95% entity recall and 85% relationship precision (eliminating orphan nodes).
  • Numeric Fact Normalization: Automated standardization of units and values (eliminating 90% of numerical contradictions).
  • Hybrid RRF Fusion: Optimized retrieval with 80% top-5 precision and BM25 pre-filtering.
  • Enterprise Observability: Integrated Prometheus metrics, Grafana dashboards, and automated contradiction alerts.

Runtime Compatibility

Current enforced runtime floor for the Lossless-Claw integration in this repo state:

  • OpenClaw 2026.3.14+
  • Lossless-Claw 0.4.0

BrainClaw only enables the integration when all runtime gate checks pass:

  1. OpenClaw version is supported
  2. plugins.slots.memory=brainclaw
  3. plugins.slots.contextEngine=lossless-claw
  4. Lossless-Claw is present in plugins.installs
  5. Lossless-Claw is registered and enabled in the active runtime
  6. Required Lossless-Claw tools are available, or a supported fallback path exists

Supported compatibility states:

  • not_installed
  • installed_compatible
  • installed_degraded
  • installed_incompatible
  • installed_unreachable

Operational Commands

brainclaw memory sync
brainclaw lcm status
brainclaw lcm sync --mode bootstrap
brainclaw lcm sync --mode incremental
brainclaw lcm sync --mode repair
brainclaw rebuild --target weaviate
brainclaw rebuild --target neo4j
brainclaw hybrid_graphrag_leiden
brainclaw lcm_expand
brainclaw lcm_describe

Testing Harness

The BrainClaw testing harness provides public utilities for generating synthetic data, benchmarking replication, and conducting graph densification experiments.

For full documentation, see docs/testing-harness.md.

Quick Example

from openclaw_memory.testing import generate_synthetic_documents

Use Cases

  • Benchmark replication of research results
  • Custom integration tests for downstream applications
  • Graph densification experiments to evaluate retrieval performance

Quick Verification

On a running OpenClaw install:

brainclaw memory sync
brainclaw lcm status
brainclaw lcm sync --mode incremental
brainclaw rebuild --target neo4j

Verification & Benchmarks

For the definitive quantitative metrics and operational proof of the v1.6.0-enterprise-intelligence release, please see the BENCHMARK.md.

  • Graph Density: 1,238,953 relationships across 766 nodes.
  • Thematic Consolidation: 173 communities (Leiden 0.1 Resolution).
  • Sync Performance: < 450ms average latency.
  • Identity Integrity: 100% "Knowledgebase" terminological synchronization.

Healthy BrainClaw + Lossless-Claw integration should show:

  • compatibility_state: installed_compatible
  • a supported Lossless-Claw schema fingerprint
  • runtime drill-down tool availability
  • checkpoint state for imported artifacts
  • rebuild status for derived stores

Configuration

BrainClaw configuration lives in openclaw.plugin.json.

Important config areas include:

  • storage and backend connectivity
  • prompt recall and bootstrap suppression
  • operational memory sync
  • Lossless-Claw detection, sync, quota, drill-down, and trust posture

Lossless-Claw-specific config keys include:

  • losslessClawEnabled
  • losslessClawPluginPath
  • losslessClawDbPath
  • losslessClawBootstrapOnStart
  • losslessClawPollIntervalMs
  • losslessClawDrillDownEnabled
  • losslessClawArtifactQuotaBytes
  • losslessClawAnchorByteCap
  • losslessClawLargeFileMode
  • losslessClawTrustMode

Rollout Safety

For OpenClaw deployments, preserve runtime state during rollout:

  • do not recreate production with an empty ./data mount
  • do not run destructive volume commands such as docker compose down -v
  • do not hand-edit data/openclaw.json or plugins.installs
  • take a pre-change snapshot before restarts or rebuilds that affect runtime state
  • validate staging on the same version, config, and state shape before production promotion

Restart and rebuild flows must preserve:

  • plugin slot selections
  • plugin install records
  • Control UI state
  • auth state
  • agents
  • sessions
  • workspaces
  • canonical BrainClaw state

Development

npm install
npm run build
npm test

pip install -r requirements.txt
PYTHONPATH=python pytest -q

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages