Skip to content
v2.1.0 — Deep Sleep v2 & Emotional Intelligence
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 147+ MCP tools.

$ npx nexo-brain init
147+
MCP Tools
22
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.

NEXO Brain Architecture Infographic

Deep Sleep v2 & Emotional Intelligence

Overnight Learning Pipeline

4-phase Deep Sleep: Collect → Extract → Synthesize → Apply. Analyzes all your sessions while you sleep. Finds corrections, errors, abandoned projects, and missed commitments. Auto-creates learnings by morning.

Emotional Intelligence

Detects user mood from sessions: frustration, flow, satisfaction, stress. Daily mood arc with score (0–100%). Knows your frustration triggers and flow triggers. Adapts next-day behavior automatically.

Session Tone

Deep Sleep generates emotional guidance for the next morning. Agent made mistakes? It acknowledges them. You had a bad day? Supportive approach, lighter start. Great day? Push momentum and ambitious goals.

8 Finding Types

Extract detects: uncaptured corrections, self-corrected errors, unformalised ideas, missed commitments, protocol violations, emotional signals, abandoned projects, and productivity patterns.

Cron Manifest

Declarative cron management via manifest.json. Core crons auto-synced on update. Personal crons never touched. PYTHONUNBUFFERED in all plists. No more manual LaunchAgent management.

Productivity Analysis

Tracks corrections per session, proactivity level, tool efficiency. Detects systemic inefficiencies across sessions. Feeds into calibration recommendations for continuous improvement.

Unified Architecture

Code and data fully separated. 15 autonomous processes auto-installed. Auto-update on startup. Auto-diary captures everything. 147+ MCP tools. 12 rounds of external audit with ~60 findings resolved.

Unified Architecture

Code lives in the repo, personal data in NEXO_HOME (~/.nexo/). Clean separation means updates never touch your data and multiple agents can share the same codebase.

15 Autonomous Processes

All processes auto-installed: watchdog, immune, synthesis, backup, catchup, cognitive-decay, postmortem, self-audit, sleep, deep-sleep, evolution, followup-hygiene, prevent-sleep, tcc-approve, auto-close-sessions.

Auto-Update on Startup

Non-blocking update check (5s max) on every server start. Resilient to network failures. Opt-out via schedule.json. No more manual npm updates.

Auto-Diary

3-layer diary system: PostToolUse writes every 10 calls, PreCompact catches emergencies before context eviction, heartbeat triggers on DIARY_OVERDUE. Never lose session context again.

schedule.json

Customizable process schedules with timezone support. Control when each autonomous process runs. Override defaults without editing plist/timer files.

Lambda Decay Fix

Memory decay was 24x too aggressive. STM half-life corrected from 7 hours to 7 days, LTM from 2.4 days to 60 days. Memories now persist as intended.

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 147+ MCP tools, a full nervous system of 15 autonomous processes, a visual dashboard v2, unified code/data architecture, auto-update, auto-diary, knowledge graph search, 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 15 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 15 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?
Dashboard v2 is a FastAPI-powered web interface at localhost:6174 with 6 pages: overview dashboard, operations, calendar, inbox, and CRUD interfaces for managing memories. It includes sidebar navigation, a trust score widget, and static assets for a polished visual experience.
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 15 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 15 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