Skip to content
v2.6.5 — Personal Scripts, Runtime CLI, Recovery Contracts & Power Policy
npm version GitHub stars npm downloads AGPL-3.0 License

Cognitive Memory
for AI Agents

Give your AI agent a brain that remembers, learns, and protects itself from repeating mistakes. F1 0.588 on LoCoMo — +55% vs GPT-4. Built on the Atkinson-Shiffrin memory model with 150+ MCP tools.

$ npx nexo-brain init
150+
MCP Tools
25
Categories
768
Vector Dimensions
15
Autonomous Processes
0
Data Sent Externally

Works where you work

Three ways to connect NEXO Brain to your AI workflow. Same cognitive engine, different entry points.

MCP Server

Native Model Context Protocol server. Works with Claude Code, Claude Desktop, and any MCP-compatible client out of the box.

Universal

OpenClaw Memory System

Replaces OpenClaw's default memory with full cognitive architecture. Deep integration with the agent lifecycle and tool registry.

OpenClaw

ClawHub Skill

One-click install from the ClawHub marketplace. Browse, install, and start using cognitive memory in seconds.

One-Click

Everything an AI agent needs to think

Not just storage — a complete cognitive architecture that learns, forgets naturally, detects conflicts, and prevents repeated mistakes.

Atkinson-Shiffrin Memory

Three-store model: Sensory Register captures raw input, STM holds working context with rehearsal, LTM consolidates with semantic vectors. Just like human cognition.

Semantic RAG

Vector search with fastembed (BAAI/bge-base-en-v1.5). Query across all memory stores with cosine similarity. Retrieve what matters, not just what matches.

Metacognitive Guard

Pre-edit checks that inject known errors, real schemas, and blocking rules before your agent writes code. Prevents repeating past mistakes.

Ebbinghaus Decay

Memories naturally fade over time following the Ebbinghaus forgetting curve. Rehearsal strengthens important memories. No manual cleanup needed.

Trust Score

0-100 alignment index that adjusts based on corrections, successes, and proactive actions. Controls internal rigor: low trust = more paranoid checks.

Cognitive Dissonance

Detects when new instructions contradict existing strong memories. Surfaces the conflict and asks for resolution instead of silently overwriting.

Episodic Memory

Change logs, decision records with alternatives and reasoning, session diaries with mental state continuity. Full audit trail of what happened and why.

Plugin System

Hot-reload plugins at runtime. Add new tool categories without restarting the server. Ship your own extensions as Python files.

100% Local

All data stored in local SQLite databases. Vectors computed on-device with ONNX Runtime. Nothing ever leaves your machine. Zero cloud dependencies.

Personality Calibration

5-question onboarding that creates a unique agent personality. Your agent adopts a consistent voice, tone, and behavioral style from day one.

Operational Codex

23 non-negotiable principles every NEXO agent follows. From memory hygiene to error prevention, the codex defines what it means to be a reliable co-operator. See the wiki.

Docker Support

Run NEXO Brain in a container with two commands. Mount your data directory, and the cognitive engine runs isolated and portable across any environment.

Multi-Query Decomposition

Complex questions are automatically split into sub-queries. Each component is retrieved independently, then fused for a higher-quality answer. Improves recall on multi-faceted prompts.

Intelligent Chunking

Adaptive chunking strategy that respects sentence and paragraph boundaries. Produces semantically coherent chunks instead of arbitrary token splits, reducing retrieval noise.

Cross-Encoder Reranking

After initial vector retrieval, a cross-encoder model rescores candidates for precision. The top-k results are reordered by true semantic relevance before being returned to the agent.

Session Summaries

Automatic end-of-session summarization that distills key decisions, errors, and follow-ups into a compact diary entry. The next session starts with full context, not a cold slate.

Hybrid Search

Combined vector + BM25 keyword search via SQLite FTS5. Best of both worlds: semantic understanding for concept-level retrieval plus exact keyword matching for precise lookups.

768-dim Embeddings

Upgraded from 384 to 768 dimensions (BAAI/bge-base-en-v1.5). Doubled semantic precision for richer memory representations — still CPU-only, no GPU required.

Adaptive Decay

Redundancy-aware Ebbinghaus forgetting curve. Unique memories decay 4x slower than duplicates — no information loss in sparse stores, automatic cleanup in dense ones.

Temporal Indexing

Automatic date extraction and temporal query boosting. "When" questions get smarter filtering — memories are ranked not just by relevance but by recency when context demands it.

Auto-Migration

Transparent 384→768 embedding upgrade on first startup. All existing memories are re-embedded automatically with zero user action required — no data loss, no manual steps.

Adaptive Learned Weights

Signal weights learn from real feedback via Ridge regression. 2-week shadow mode validates new weights before promoting. Weight momentum and automatic rollback keep the system stable.

Somatic Markers

Pain memory per file and area. Guard warns on HIGH RISK (>0.5) and CRITICAL (>0.8). Validated recovery on clean checks — the system forgets pain when the problem is fixed.

6-Signal Personality

Vibe, corrections, brevity, topic, tool errors, and git diff. Emergency bypass for urgent sessions. Severity-weighted decay keeps personality calibrated over time without manual resets.

Evolution System

Weekly self-improvement cycle. Analyzes patterns, proposes changes, validates via snapshot/rollback. Circuit breakers and budget caps for safety.

Runtime CLI

nexo chat to launch Claude Code, nexo update to sync the cognitive engine, nexo doctor for unified diagnostics. One binary, full control from any terminal.

Personal Scripts

First-class managed scripts with lifecycle tracking, schedule associations, and recovery awareness. 9 MCP tools for create, reconcile, sync, classify, and schedule management.

Startup Preflight

Health checks before every interactive session. Safe migrations, dependency verification, and environment validation ensure the cognitive engine starts clean every time.

Recovery Contracts

Boot and wake catch-up for core and personal jobs. Explicit recovery contracts define what runs after sleep, restart, or missed schedules — no silent failures.

NEXO Brain Architecture Infographic

Personal Scripts, Runtime CLI, Recovery Contracts & Power Policy

Your scripts become first-class citizens. A real CLI binary controls the cognitive engine. Recovery contracts ensure nothing is lost on sleep or restart.

Runtime CLI

nexo chat to launch Claude Code with NEXO as operator, nexo update to sync the engine, nexo doctor for unified diagnostics. One binary, full control from any terminal.

Personal Scripts Registry

Scripts tracked in a first-class SQLite registry with 9 MCP tools for full lifecycle: create, schedule, reconcile, sync, classify. Your automations are now managed entities, not loose files.

Recovery Contracts

Boot and wake catch-up with explicit contracts for core and personal jobs. Every background process declares its recovery behavior — no silent failures after sleep or restart.

Startup Preflight

Health checks and safe migrations before every interactive session. Dependency verification and environment validation ensure the cognitive engine starts clean.

Platform-Aware Power Policy

macOS power assertions, sleep inhibit on Linux, and intelligent scheduling that adapts to battery state. Background processes respect the platform's power constraints.

Managed Evolution Hardening

Evolution can now modify core behavior modules with automatic rollback followups. Fixed false-positive watchdog tamper detection. Safe self-improvement of the cognitive engine.

View full changelog →

Up and running in 60 seconds

One command to install. NEXO Brain sets up the MCP server, SQLite databases, and cognitive engine automatically. A 5-question personality calibration creates your agent's unique voice.

Terminal
# Install NEXO Brain
$ npx nexo-brain init

# That's it. Open Claude Code and your agent has memory.
# NEXO Brain auto-configures the MCP server.

# Verify it's working:
$ claude -p "call nexo_status"

# Or run with Docker:
$ docker build -t nexo-brain .
$ docker run -v ~/.nexo:/data nexo-brain

# Optional: Start with a personality template
$ npx nexo-brain init --template operator

Find NEXO Brain everywhere

Available on major MCP directories and package registries.

Everything you need to know

Common questions about NEXO Brain, how it works, and how to get started.

What is NEXO Brain?
NEXO Brain is an open-source cognitive memory system for AI agents. It gives your AI persistent memory across sessions using the Atkinson-Shiffrin memory model (Sensory Register, Short-Term Memory, Long-Term Memory), with 150+ MCP tools, a runtime CLI (nexo command), unified doctor diagnostics, Skills v2 with executable modes, personal scripts registry with 9 lifecycle tools, Claude Code plugin structure, managed evolution, an always-on dashboard with 23 modules, a full nervous system of 14 autonomous processes, and metacognitive error prevention.
How does NEXO Brain work?
NEXO Brain implements the Atkinson-Shiffrin multi-store memory model from cognitive psychology. Information flows through three stores: Sensory Register (immediate context), Short-Term Memory (session-level working memory), and Long-Term Memory (persistent vector-indexed storage with Ebbinghaus decay). Memories are encoded as vectors, retrieved via RAG, and strengthened or forgotten naturally over time.
What is MCP (Model Context Protocol)?
MCP (Model Context Protocol) is an open standard by Anthropic that lets AI agents connect to external tools and data sources. NEXO Brain exposes all its cognitive capabilities as MCP tools, so any MCP-compatible client (Claude Code, Claude Desktop, Cursor, etc.) can use persistent memory, knowledge graphs, and error prevention natively.
How do I install NEXO Brain?
Run npx nexo-brain init in your terminal. The installer automatically configures your MCP client (Claude Code or Claude Desktop), downloads the embedding model, and creates the SQLite databases. No API keys or cloud accounts required.
Is NEXO Brain free and open-source?
Yes, NEXO Brain is fully open-source under the AGPL-3.0 license. The complete source code is available on GitHub. You can use it, modify it, and contribute to it freely.
Does my data leave my machine?
No. NEXO Brain runs 100% locally on your machine. All data is stored in local SQLite databases, and the vector embedding model (ONNX Runtime) runs on your CPU. Zero data is sent to any external server, cloud, or API.
What LLMs and clients does it work with?
NEXO Brain works with any MCP-compatible client, including Claude Code, Claude Desktop, Cursor, Windsurf, and more. It is LLM-agnostic -- it provides memory infrastructure, not inference.
What vector embedding model does it use?
NEXO Brain uses BAAI/bge-base-en-v1.5, a 768-dimensional embedding model running locally via ONNX Runtime on CPU. No GPU required. The model is downloaded automatically during installation.
How is it different from just using context windows?
Context windows are ephemeral -- they reset every session. NEXO Brain provides persistent memory that survives across sessions, with natural forgetting (Ebbinghaus decay), rehearsal-based strengthening, a metacognitive guard that prevents repeating known errors, and a knowledge graph for entity relationships.
What is the metacognitive guard?
The metacognitive guard (nexo_guard_check) is a pre-action safety system. Before your agent edits code or makes changes, it checks for known errors, blocking rules, and relevant learnings. It prevents the agent from repeating mistakes it has already encountered.
What is trust scoring?
Trust scoring is a 0-100 alignment index that reflects how well the agent aligns with the user's expectations. Corrections lower it, successful proactive actions raise it. When trust is low, the system becomes more cautious. When high, it operates more fluidly.
What is cognitive dissonance detection?
When the agent receives a new instruction that contradicts an existing strong memory, NEXO Brain detects the conflict automatically. It surfaces the contradiction so the user can decide whether it is a permanent change or a one-time exception, preventing silent overwrites of established knowledge.
Can I use NEXO Brain with Docker?
Yes. A Dockerfile is included in the repository for containerized deployments. You can run NEXO Brain in a Docker container for isolated environments, CI/CD pipelines, or server-side agent deployments.
What is the knowledge graph?
The knowledge graph stores typed relationships between entities (people, services, projects, files). It enables neighbor traversal, path finding, and contextual queries like "what is connected to this project?" -- giving the agent structural understanding beyond flat vector search.
How does Ebbinghaus decay work?
Based on Hermann Ebbinghaus's forgetting curve research, memories in NEXO Brain naturally decay over time if not accessed. Each retrieval (rehearsal) strengthens the memory and resets its decay timer. Frequently accessed memories become long-term; unused ones gradually fade -- mimicking how human memory works.
What are somatic markers?
Inspired by Antonio Damasio's somatic marker hypothesis, these are "pain memories" associated with specific files or areas. When the agent encounters repeated errors in a file, the somatic marker increases, making the guard more cautious in that area. It is emotional memory for code.
How does the plugin system work?
NEXO Brain supports hot-reload plugins -- Python files dropped into the plugins/ directory are automatically loaded at startup. You can add, remove, or update plugins at runtime without restarting the server. Each plugin can register new MCP tools.
What is the LoCoMo benchmark score?
On the LoCoMo long-conversation memory benchmark, NEXO Brain achieves an F1 score of 0.588, which is 55% higher than GPT-4 Turbo's 128K context window (0.379). This demonstrates that structured cognitive memory significantly outperforms raw context length for long-term retention.
Can I use NEXO Brain in production?
Yes. NEXO Brain is designed for continuous, production-grade operation. It runs 24/7 with 14 autonomous processes (nightly decay, deep sleep analysis, watchdog monitoring, immune system, synthesis, backup, prevent-sleep, and more), handles concurrent sessions, and includes backup/restore capabilities.
What are LaunchAgent templates?
NEXO Brain v2.0.0 ships with 14 auto-installed processes via LaunchAgent plists on macOS and systemd timers on Linux. All processes (watchdog, cognitive decay, deep sleep, evolution, prevent-sleep, tcc-approve, backup, etc.) are configured automatically during installation. Customizable via schedule.json.
What is Dashboard v2?
The NEXO Dashboard is an always-on FastAPI-powered web interface at localhost:6174 with 23 modules across multiple pages: overview, operations, calendar, inbox, and CRUD interfaces for managing memories. It includes sidebar navigation, trust score widget, and auto-starts on boot for continuous monitoring.
How do I migrate to v2.0?
Run npx nexo-brain init and the installer handles everything automatically. For v2.0, your code and data are cleanly separated: code stays in the repo, personal data in NEXO_HOME (~/.nexo/). All 14 autonomous processes are auto-installed, and existing data is preserved. The migration is non-destructive.
What is the nervous system?
The nervous system is a collection of 14 autonomous processes that run on schedule without user intervention: watchdog, immune system, daily synthesis, backup, catchup, cognitive decay, postmortem, self-audit, sleep, deep sleep, evolution, followup hygiene, prevent-sleep, tcc-approve, and auto-close-sessions. All are auto-installed and customizable via schedule.json.
Is there a community?
Yes! Find us on GitHub for issues, discussions, and contributions. Follow @NEXOBRAIN on X/Twitter for updates, releases, and development insights. The project welcomes contributions and sponsorships.

Give your agent a mind

Open source, AGPL-3.0 licensed, and built for builders who want their AI to actually remember.

Translate this page