Give your AI agent a brain that remembers, learns, and protects itself from repeating mistakes. Built on the Atkinson-Shiffrin memory model.
$ npx nexo-brain init
Not just storage — a complete cognitive architecture that learns, forgets naturally, detects conflicts, and prevents repeated mistakes.
Three-store model: Sensory Register captures raw input, STM holds working context with rehearsal, LTM consolidates with semantic vectors. Just like human cognition.
Vector search with fastembed (BAAI/bge-small-en-v1.5). Query across all memory stores with cosine similarity. Retrieve what matters, not just what matches.
Pre-edit checks that inject known errors, real schemas, and blocking rules before your agent writes code. Prevents repeating past mistakes.
Memories naturally fade over time following the Ebbinghaus forgetting curve. Rehearsal strengthens important memories. No manual cleanup needed.
0-100 alignment index that adjusts based on corrections, successes, and proactive actions. Controls internal rigor: low trust = more paranoid checks.
Detects when new instructions contradict existing strong memories. Surfaces the conflict and asks for resolution instead of silently overwriting.
Change logs, decision records with alternatives and reasoning, session diaries with mental state continuity. Full audit trail of what happened and why.
Hot-reload plugins at runtime. Add new tool categories without restarting the server. Ship your own extensions as Python files.
All data stored in local SQLite databases. Vectors computed on-device with ONNX Runtime. Nothing ever leaves your machine. Zero cloud dependencies.
Based on the Atkinson-Shiffrin model from cognitive psychology, adapted for AI agents.
Every piece of information flows through three stores, each with its own retention rules and access patterns.
Every aspect of cognitive operation exposed as MCP tools. Compatible with Claude Code and any MCP client.
RAG retrieve, trust, dissonance, sentiment, metrics
Change logs, decisions, session diaries, recall
Error patterns, categorized, searchable
People, services, URLs, relationships
Time-based alerts with priority levels
Deferred verification tasks
Secure local credential storage
Learned behavioral patterns
Pre-edit checks, blocking rules
Inter-session communication
Startup, heartbeat, coordination
Hot-reload extensions at runtime
One command to install. NEXO Brain sets up the MCP server, SQLite databases, and cognitive engine automatically.
Open source, MIT licensed, and built for builders who want their AI to actually remember.