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.
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.
- 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.mdstate blocks - Automatic Lossless-Claw detection, compatibility gating, and artifact integration
- CLI surfaces for memory sync, rebuilds, and Lossless-Claw installation/ops
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:
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_candidatesfrom 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:
src/lcm_runtime.tspython/openclaw_memory/integration/lossless_adapter.pypython/openclaw_memory/integration/lossless_sync.pyspecs/001-authoritative-memory-backend/data-model.md
- v1.6.0-enterprise-intelligence (Current):
90a2a97feat: BrainClaw v1.6.0 - Two-Pass Extraction, Numeric Normalization, and Hybrid Retrieval Optimization - v1.5.0-intel-perfection:
236aba8feat: BrainClaw Perfection 2026+ Audit - Relationship Enhancement, Thematic Consolidation, and Knowledgebase UI - v1.5.0-intel:
e81051afeat: Phase 12 Factual HybridGraph UI (BrainClaw Memory, Lossless Memories, Knowledgebase, Self-learning Entries) - v1.5.0:
5db43b1feat: 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.
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:
- OpenClaw version is supported
plugins.slots.memory=brainclawplugins.slots.contextEngine=lossless-claw- Lossless-Claw is present in
plugins.installs - Lossless-Claw is registered and enabled in the active runtime
- Required Lossless-Claw tools are available, or a supported fallback path exists
Supported compatibility states:
not_installedinstalled_compatibleinstalled_degradedinstalled_incompatibleinstalled_unreachable
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_describeThe 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.
from openclaw_memory.testing import generate_synthetic_documents- Benchmark replication of research results
- Custom integration tests for downstream applications
- Graph densification experiments to evaluate retrieval performance
On a running OpenClaw install:
brainclaw memory sync
brainclaw lcm status
brainclaw lcm sync --mode incremental
brainclaw rebuild --target neo4jFor 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
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:
losslessClawEnabledlosslessClawPluginPathlosslessClawDbPathlosslessClawBootstrapOnStartlosslessClawPollIntervalMslosslessClawDrillDownEnabledlosslessClawArtifactQuotaByteslosslessClawAnchorByteCaplosslessClawLargeFileModelosslessClawTrustMode
For OpenClaw deployments, preserve runtime state during rollout:
- do not recreate production with an empty
./datamount - do not run destructive volume commands such as
docker compose down -v - do not hand-edit
data/openclaw.jsonorplugins.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
npm install
npm run build
npm test
pip install -r requirements.txt
PYTHONPATH=python pytest -q