Local cognitive runtime with a shared brain across Claude Code, Codex, Claude Desktop, and other MCP clients. Persistent memory, durable workflow runs, selectable terminal and automation backends, overnight learning, self-healing background jobs, startup preflight, and doctor diagnostics. 150+ MCP tools. Benchmarked on LoCoMo (F1 0.588, +55% vs GPT-4).
NEXO Brain transforms any MCP-compatible AI agent from a stateless assistant into a cognitive partner that remembers, learns, forgets, adapts, and builds a relationship with you over time.
Watch the overview on YouTube Β· Watch the full deep-dive
Start here:
- 5-minute quickstart
- Workflow quickstart
- Recent memory fallbacks + live system catalog
- Supported client guides
- Docker setup
- Architecture visuals
- Memory classes
- Session portability
- Python SDK
- Reference verticals
- Measured compare scorecard
- Memory benchmark harness
- Public contribution guide
Every time you close a session, everything is lost. Your agent doesn't remember yesterday's decisions, repeats the same mistakes, and starts from zero. NEXO Brain fixes this with a cognitive architecture modeled after how human memory actually works.
Shared brain is now the baseline:
- Claude Code remains the recommended path because it still has the deepest hook integration and the most battle-tested headless automation surface.
- Codex is supported both as an interactive terminal client and as the background automation backend.
- Claude Desktop can point at the same local brain through MCP.
That means NEXO now manages not only the shared runtime and MCP wiring, but also the startup layer around it:
nexo chatopens the configured client instead of assuming Claude Code forever.- Claude Code and Codex both get managed bootstrap files:
~/.claude/CLAUDE.md~/.codex/AGENTS.md
- Those files now use an explicit
CORE/USERcontract, so NEXO can update product rules inCOREwhile preserving operator-specific instructions inUSER. - For Codex specifically,
nexo chatand Codex headless automation inject the current bootstrap explicitly, so Codex starts as NEXO even when plain global Codex startup is inconsistent about global instructions. - Deep Sleep now reads both Claude Code and Codex transcript stores, so overnight analysis still works even when the user spends the day in Codex.
Versions 2.6.14 through 2.7.0 established the practical shared-brain baseline: managed Claude/Codex bootstrap, Codex config sync, transcript-aware Deep Sleep, 60-day long-horizon analysis, weekly/monthly summary artifacts, retrieval auto-mode, and the first measured engineering loop.
Versions 3.0.0 and 3.0.1 close the next execution gap:
- protocol discipline is now a runtime contract, not just instructions:
nexo_task_opennexo_task_close- persistent
protocol_debt - enforceable
Cortexgates
- durable execution is now first-class:
- resumable workflow runs
- checkpoints
- replay
- retries
- durable goals
- conditioned learnings on critical files are now real guardrails across Claude hooks, Codex transcript audits, and headless automation prompts
- repair/correction work now routes through canonical learning capture instead of depending on the model to remember to document after the fact
- runtime truth is stricter:
- no more healthy-looking warning storms
- no more silent Deep Sleep schema drift
- keep-alive jobs report alive/degraded/duplicated honestly
- public proof is stronger:
- measured compare scorecard
- external and internal ablations
cost_per_solved_task- SDK/API/quickstart surface
Versions 3.1.7 through 3.2.0 close the recent-memory gap:
- recent operational continuity is now first-class through
hot contextandrecent events - the runtime can build a reusable pre-action bundle instead of reconstructing the last few hours from diaries and durable recall only
- when even that misses, NEXO now exposes raw transcript fallback tools for Claude Code and Codex session stores
- NEXO can now inspect itself through a live system catalog derived from canonical sources instead of relying only on stale docs or operator memory
| Capability | Claude Code | Codex | Claude Desktop |
|---|---|---|---|
| Shared brain / MCP runtime | Yes | Yes | Yes |
| Managed bootstrap document | ~/.claude/CLAUDE.md |
~/.codex/AGENTS.md |
Not applicable |
| Global startup bootstrap sync | Native via hooks + bootstrap | Managed via bootstrap + Codex config initial_messages + mcp_servers.nexo |
Managed MCP-only shared-brain metadata |
nexo chat terminal client |
Yes | Yes | No |
| Background automation backend | Recommended | Supported | No |
| Raw transcript source for Deep Sleep | Yes | Yes | No |
| Native hook depth | Deepest | Partial, compensated | None |
| Runtime doctor parity audit | Yes | Yes | Shared-brain only |
| Recommended today | Yes | Supported | Shared-brain companion |
| Client | Status | Integration style | Notes |
|---|---|---|---|
| Claude Code | First-class | Managed install + hooks + bootstrap | Deepest NEXO parity today |
| Codex | First-class | Managed install + bootstrap + transcript parity | Best non-Claude terminal path |
| Claude Desktop | Companion | MCP-only shared brain | Useful as read/chat companion |
| Cursor | Documented companion | MCP + .cursor/rules |
Good editor pairing; no Deep Sleep transcript parity yet |
| Windsurf | Documented companion | MCP + .windsurf/rules or repo AGENTS.md |
Native MCP support, manual companion mode |
| Gemini CLI | Adapter included | MCP + GEMINI.md |
Best when you want Gemini as a shared-brain companion, not the primary NEXO runtime |
AI coding agents are powerful but amnesic:
- No memory β closes a session, forgets everything
- Repeats mistakes β makes the same error you corrected yesterday
- No context β can't connect today's work with last week's decisions
- Reactive β waits for instructions instead of anticipating needs
- No learning β doesn't improve from experience
- No safety β stores anything it's told, including poisoned or redundant data
NEXO Brain implements the Atkinson-Shiffrin memory model from cognitive psychology (1968) β the same model that explains how human memory works:
What you say and do
|
+---> Sensory Register (raw capture, 48h)
| |
| +---> Attention filter: "Is this worth remembering?"
| |
| v
+---> Short-Term Memory (7-day half-life)
| |
| +---> Used often? --> Consolidate to Long-Term Memory
| +---> Not accessed? --> Gradually forgotten
|
+---> Long-Term Memory (60-day half-life)
|
+---> Active: instantly searchable by meaning
+---> Dormant: faded but recoverable ("oh right, I remember now!")
+---> Near-duplicates auto-merged to prevent clutter
This isn't a metaphor. NEXO Brain literally implements Ebbinghaus forgetting curves, rehearsal-based reinforcement, and memory consolidation during automated "sleep" processes.
| Without NEXO Brain | With NEXO Brain |
|---|---|
| Memory gone after each session | Persistent across sessions with natural decay and reinforcement |
| Repeats the same mistakes | Checks "have I made this mistake before?" before every action |
| Keyword search only | Finds memories by meaning, not just words |
| Starts cold every time | Resumes from the mental state of the last session |
| Same behavior regardless of context | Adapts tone and approach based on your mood |
| No relationship | Trust score that evolves β makes fewer redundant checks as alignment grows |
| Stores everything blindly | Prediction error gating rejects redundant information at write time |
| Vulnerable to memory poisoning | 4-layer security pipeline scans every memory before storage |
| No proactive behavior | Context-triggered reminders fire when topics match, not just by date |
NEXO Brain uses Ebbinghaus forgetting curves β memories naturally fade over time unless reinforced by use. This isn't a bug, it's how useful memory works:
- A lesson learned yesterday is strong. If you never encounter it again, it fades β because it probably wasn't important.
- A lesson accessed 5 times in 2 weeks gets promoted to long-term memory β because repeated use proves it matters.
- A dormant memory can be reactivated if something similar comes up β the "oh wait, I remember this" moment.
On top of that baseline, NEXO now keeps a lightweight per-memory profile:
- stability slows decay for memories that keep surviving retrieval and reinforcement
- difficulty speeds decay slightly for memories that tend to be weak, noisy, or harder to reuse correctly
That keeps the core Ebbinghaus model, but makes decay more individual and less purely global.
NEXO Brain doesn't search by keywords. It searches by meaning using vector embeddings (fastembed, 768 dimensions).
Example: If you search for "deploy problems", NEXO Brain will find a memory about "SSH connection timeout on production server" β even though they share zero words. This is how human associative memory works.
Retrieval is now also smarter by default:
- HyDE auto mode expands conceptual or ambiguous queries when that improves recall
- Spreading activation auto mode adds a shallow associative boost for concept-heavy searches
- Exact lookup heuristics keep both off for literal file paths, IDs, stack traces, and other precision-sensitive queries
Before every code change, NEXO Brain asks itself: "Have I made a mistake like this before?"
It searches its memory for related errors, warnings, and lessons learned. If it finds something relevant, it surfaces the warning BEFORE acting β not after you've already broken production.
When you give an instruction that contradicts established knowledge, NEXO Brain doesn't silently obey or silently resist. It verbalizes the conflict:
"My memory says you prefer Tailwind over plain CSS, but you're asking me to write inline styles. Is this a permanent change or a one-time exception?"
You decide: paradigm shift (permanent change), exception (one-time), or override (old memory was wrong).
Some memories look identical but apply to different contexts. "How to deploy" for Project A is different from Project B. NEXO Brain detects discriminating entities (different OS, platform, language) and links them as siblings instead of merging them:
"Applying the Linux deploy procedure. Note: there's a sibling for macOS that uses a different port."
NEXO Brain tracks alignment with you through a trust score:
- You say thanks --> score goes up --> reduces redundant verification checks
- Makes a mistake you already taught it --> score drops --> becomes more careful, checks more thoroughly
- The score doesn't control permissions β you're always in control. It's a mirror that helps calibrate rigor.
NEXO Brain reads your tone (keywords, message length, urgency signals) and adapts:
- Frustrated? --> Ultra-concise mode. Zero explanations. Just solve the problem.
- In flow? --> Good moment to suggest that backlog item from last Tuesday.
- Urgent? --> Immediate action, no preamble.
Like a human brain, NEXO Brain has automated processes that run while you're not using it:
| Time | Process | Human Analogy |
|---|---|---|
| 03:00 | Decay + memory consolidation + merge duplicates + dreaming | Deep sleep consolidation |
| 04:00 | Clean expired data, prune redundant memories | Synaptic pruning |
| 07:00 | Self-audit, health checks, metrics | Waking up + orientation |
| 23:30 | Process day's events, extract patterns | Pre-sleep reflection |
| Boot | Catch-up: run anything missed while computer was off | -- |
If your Mac was asleep during any scheduled process, NEXO Brain catches up in order when it wakes.
Deep Sleep now also mixes recent context with older context across a 60-day horizon. Instead of only looking at the immediate past, it can surface:
- recurring multi-week themes
- cross-domain links between older learnings and current failures
- stale followups and topics that keep being mentioned but never formalized
- weighted project pressure based on diary activity, followups, learnings, and decision outcomes
It now also writes weekly and monthly Deep Sleep summaries so the overnight system can reuse higher-horizon signals instead of rediscovering everything from scratch every day.
The Cortex is a middleware cognitive layer that makes the agent think before acting. It implements architectural inhibitory control β the agent cannot bypass reasoning.
User message β Fast Path check β Simple chat? β Respond directly
β Action needed? β Cortex activates
β
Generate cognitive state
(goal, plan, unknowns, evidence)
β
Middleware validates
ββ Unknowns? β ASK mode (tools blocked)
ββ No plan? β PROPOSE mode (read-only)
ββ Plan + evidence β ACT mode (full access)
| Feature | What It Does |
|---|---|
| Inhibitory Control | Physically restricts tools based on reasoning quality. Unknowns β can only ask. No plan β can only propose. Evidence + verification β can act. |
| Event-Driven Activation | Only activates on tool intent, ambiguity, destructive actions, or retries. Simple chat has zero overhead. |
| Trust-Gated Escalation | Low trust score β requires more evidence before allowing "act" mode. Trust builds through successful execution. |
| Core Rules Injection | Automatically surfaces relevant behavioral rules based on task type. |
| Activation Metrics | Tracks modes, inhibition rates, and task types for continuous improvement. |
The Cortex was designed through a 3-way AI debate (Claude Opus 4.6 + GPT-5.4 + Gemini 3.1 Pro) and validated against 6 months of real production failures.
Memory and guardrails are not enough if long work still restarts from zero.
NEXO now ships a durable workflow runtime for multi-step and cross-session execution:
nexo_workflow_opencreates a persistent run with step metadata, idempotency key, priority, and shared statenexo_workflow_updaterecords replayable checkpoints, retry metadata, approval gates, and the current actionable statenexo_workflow_resumetells the agent what to do next without guessingnexo_workflow_replayreconstructs the recent execution history honestly instead of pretending the run is still in memorynexo_workflow_listkeeps active and blocked work visible so it does not disappear into reminders or prose notes
This is the bridge between "good memory" and "reliable execution": tasks can now preserve state, retries, approval gates, and next action across interruptions.
NEXO Brain automatically preserves session context when Claude Code compacts conversations. Using PreCompact and PostCompact hooks:
- PreCompact: Saves a complete session checkpoint to SQLite (task, files, decisions, errors, reasoning thread, next step)
- PostCompact: Re-injects a structured Core Memory Block into the conversation, so the session continues seamlessly
This means long sessions (8+ hours) feel like one continuous conversation instead of restarting after each compaction.
How it works:
- Configure the hooks in your Claude Code
settings.json - NEXO Brain's heartbeat automatically maintains the checkpoint
- When compaction happens, the PreCompact hook reads the checkpoint and injects a recovery block
- The session continues from exactly where it left off
Setup:
{
"hooks": {
"PreCompact": [{
"matcher": "*",
"hooks": [{"type": "command", "command": "bash $NEXO_HOME/hooks/pre-compact.sh", "timeout": 10}]
}],
"PostCompact": [{
"matcher": "*",
"hooks": [{"type": "command", "command": "bash $NEXO_HOME/hooks/post-compact.sh", "timeout": 10}]
}]
}
}2 new MCP tools: nexo_checkpoint_save (manual or hook-triggered checkpoint), nexo_checkpoint_read (retrieves the latest checkpoint for context injection).
NEXO Brain provides 150+ MCP tools across 23 categories. These features implement cognitive science concepts that go beyond basic memory:
| Feature | What It Does |
|---|---|
| Prediction Error Gating | Only novel information is stored. Redundant content that matches existing memories is rejected at write time, keeping your memory clean without manual curation. |
| Security Pipeline | 4-layer defense against memory poisoning: injection detection, encoding analysis, behavioral anomaly scoring, and credential scanning. Every memory passes through all four layers before storage. |
| Quarantine Queue | New facts enter quarantine status and must pass a promotion policy before becoming trusted knowledge. Prevents unverified information from influencing decisions. Automated nightly processing promotes, rejects, or expires items. |
| Secret Redaction | Auto-detects and redacts API keys, tokens, passwords, and other sensitive data before storage. Secrets never reach the vector database. |
| Feature | What It Does |
|---|---|
| Pin / Snooze / Archive | Granular lifecycle states for memories. Pin = never decays (critical knowledge). Snooze = temporarily hidden (revisit later). Archive = cold storage (searchable but inactive). |
| Intelligent Chunking | Adaptive chunking that respects sentence and paragraph boundaries. Produces semantically coherent chunks instead of arbitrary token splits, reducing retrieval noise. |
| Adaptive Decay | Decay rate still follows Ebbinghaus as the base model, but now also adapts per memory using stability and difficulty profiles. Frequently reinforced memories become stickier; fragile memories fade sooner. |
| Auto-Migration | Formal schema migration system (schema_migrations table) tracks all database changes. Safe, reversible schema evolution for production systems β upgrades never lose data. |
| Auto-Merge Duplicates | Batch cosine deduplication during the 03:00 sleep cycle. Respects sibling discrimination β similar memories about different contexts are kept separate. |
| Memory Dreaming | Discovers hidden connections between recent memories during the 03:00 sleep cycle and now feeds a 60-day long-horizon Deep Sleep blend, so older patterns can reappear when they become relevant again. |
| Feature | What It Does |
|---|---|
| Hot Context 24h | Keeps active topics, blockers, and waiting states fresh across sessions, clients, cron ticks, and channel changes. This is the shared recent-memory substrate for operational continuity. |
| Pre-Action Context Bundle | Loads recent contexts, recent events, related reminders, and related followups before acting, so continuity is explicit instead of prompt-only. |
| Transcript Fallback | When recent-memory capture is thin or missing, NEXO can now search and read recent Claude Code / Codex transcripts directly through MCP instead of pretending the conversation is lost. |
| Live System Catalog | NEXO can now inspect its own current surface β core tools, plugin tools, skills, scripts, crons, projects, and artifacts β through a live catalog derived from canonical sources at read time. |
| Feature | What It Does |
|---|---|
| HyDE Query Expansion | Generates hypothetical answer embeddings for richer semantic search. NEXO now auto-enables HyDE for conceptual or ambiguous queries while keeping literal lookups conservative. |
| Hybrid Search (FTS5+BM25+RRF) | Combines dense vector search with BM25 keyword search via Reciprocal Rank Fusion. Outperforms pure semantic search on precise terminology and code identifiers. |
| 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. |
| 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. |
| Temporal Indexing | Memories are indexed by time in addition to semantics. Time-sensitive queries ("what did we decide last Tuesday?") use temporal proximity scoring alongside semantic similarity. |
| Spreading Activation | Graph-based co-activation network. NEXO now auto-enables a shallow spreading pass for concept-heavy queries, improving contextual recall without turning every exact lookup into a fuzzy search. |
| Recall Explanations | Transparent score breakdown for every retrieval result. Shows exactly why a memory was returned: semantic similarity, recency, access frequency, and co-activation bonuses. |
| Feature | What It Does |
|---|---|
| Prospective Memory | Context-triggered reminders that fire when conversation topics match, not just by date. "Remind me about X when we discuss Y" works naturally. |
| Hook Auto-capture | Extracts decisions, corrections, and factual statements from conversations automatically. You don't need to explicitly say "remember this" β the system detects what's worth storing. |
| 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. |
| Smart Startup | Pre-loads relevant cognitive memories at session boot by composing a query from pending followups, due reminders, and last session's topics. Every session starts with the right context β not a cold search. |
| Context Packets | Bundles all area knowledge (learnings, recent changes, active followups, preferences, cognitive memories) into a single injectable packet for subagent delegation. Subagents never start blind again. |
| Auto-Prime by Topic | Heartbeat detects project/area keywords in conversation and automatically surfaces the most relevant learnings. No explicit memory query needed β context arrives proactively. |
NEXO Brain was evaluated on LoCoMo (ACL 2024), a long-term conversation memory benchmark with 1,986 questions across 10 multi-session conversations.
| System | F1 | Adversarial | Hardware |
|---|---|---|---|
| NEXO Brain v0.5.0 | 0.588 | 93.3% | CPU only |
| GPT-4 (128K full context) | 0.379 | β | GPU cloud |
| Gemini Pro 1.0 | 0.313 | β | GPU cloud |
| LLaMA-3 70B | 0.295 | β | A100 GPU |
| GPT-3.5 + Contriever RAG | 0.283 | β | GPU |
+55% vs GPT-4. Running entirely on CPU.
Key findings:
- Outperforms GPT-4 (128K full context) by 55% on F1 score
- 93.3% adversarial rejection rate β reliably says "I don't know" when information isn't available
- 74.9% recall across 1,986 questions
- Open-domain F1: 0.637 | Multi-hop F1: 0.333 | Temporal F1: 0.326
- Runs on CPU with 768-dim embeddings (BAAI/bge-base-en-v1.5) β no GPU required
- First MCP memory server benchmarked on a peer-reviewed dataset
Full results in benchmarks/locomo/results/.
NEXO Brain doesn't just respond β it runs 13 core recovery-aware background jobs plus optional helpers, like a biological nervous system. They handle maintenance, health monitoring, and self-improvement without any user interaction:
| Script | Schedule | What It Does |
|---|---|---|
| cognitive-decay | 03:00 daily | Ebbinghaus decay + memory consolidation + duplicate merging + dreaming |
| sleep | 04:00 daily | Synaptic pruning, expired data cleanup |
| deep-sleep | 04:30 daily | 4-phase overnight pipeline: CollectβExtractβSynthesizeβApply. Analyzes all sessions, detects emotional patterns, abandoned projects, productivity issues, and auto-creates learnings |
| self-audit | 07:00 daily | Health checks, guard stats, trust score review, metrics |
| postmortem | 23:30 daily | Session consolidation, extract patterns from day's events |
| catchup | On boot | Runs any missed scheduled processes (Mac was off/asleep) |
| tcc-approve | On boot (macOS) | Auto-approve macOS permissions for Claude Code updates |
| prevent-sleep | Always (daemon) | Keeps machine awake for nocturnal processes (caffeinate/systemd-inhibit) |
| evolution | Weekly (Sun) | Self-improvement proposals β NEXO suggests and applies enhancements |
| followup-hygiene | Weekly (Sun) | Normalizes statuses, flags stale followups, cleans orphans |
| learning-housekeep | 03:15 daily | Dedup learnings, adjust weights by usage, process overdue reviews, reconcile decision outcomes |
| immune | Every 30 min | Quarantine processing, memory promotion/rejection, synaptic pruning |
| synthesis | 06:00 daily | Memory synthesis β discovers cross-memory patterns |
| watchdog | Every 30 min | Monitors services, LaunchAgents, and infrastructure health |
| auto-close-sessions | Every 5 min | Cleans stale sessions |
Core processes are defined in src/crons/manifest.json and auto-synced to your system by nexo_update. On macOS they run via LaunchAgents; on Linux via systemd user timers. tcc-approve, prevent-sleep, and backup are platform/personal helpers β not in the manifest but listed above for completeness. Personal crons (your own scripts) are never touched by the sync. If your Mac was asleep during a scheduled process, the catch-up script re-runs everything in order when it wakes.
Deep Sleep is a 4-phase pipeline that runs at 4:30 AM and makes NEXO smarter while you sleep:
Phase 1: COLLECT (Python)
βββ Reads all session transcripts from the day
βββ Splits each session into individual .txt files
βββ Gathers DB state (followups, learnings, trust)
Phase 2: EXTRACT (Opus, one call per session)
βββ 8 types of findings per session:
β βββ Uncaptured corrections (user corrected agent, no learning saved)
β βββ Self-corrected errors (knowledge gaps to fix)
β βββ Unformalised ideas (mentioned but never tracked)
β βββ Missed commitments (promised but no followup)
β βββ Protocol violations (guard_check, heartbeat, change_log)
β βββ Emotional signals (frustration, flow, satisfaction)
β βββ Abandoned projects (started but not finished)
β βββ Productivity patterns (corrections, proactivity, tool efficiency)
βββ Outputs per-session JSON with findings + emotional timeline
Phase 3: SYNTHESIZE (Opus, one call)
βββ Cross-session patterns (same error in 5 sessions = systemic)
βββ Daily mood arc with score (0.0 = terrible day, 1.0 = great day)
βββ Recurring triggers (what causes frustration vs flow)
βββ Productivity analysis (corrections, tool efficiency)
βββ Abandoned project detection
βββ Morning agenda (prioritized)
βββ Calibration recommendations
Phase 4: APPLY (Python)
βββ Auto-creates learnings from high-confidence findings
βββ Creates followups for unfinished work
βββ Updates mood_history in calibration.json (30-day rolling)
βββ Generates session-tone.json (emotional guidance for next session)
βββ Writes morning-briefing.md
Deep Sleep generates a session-tone.json that tells NEXO how to behave next morning:
- Agent made many mistakes yesterday β Acknowledge them, show what was learned, demonstrate improvement
- User had a bad day (mood < 40%) β Supportive approach, lighter start, avoid known frustration triggers
- User had a great day (mood > 70%) β Reinforce momentum, reference wins, push ambitious goals
- Agent was too reactive β Be proactive today, don't wait for instructions
This is read by nexo_smart_startup and injected into every session's context. NEXO adapts its personality based on real behavioral data, not just configuration.
All core crons are defined in src/crons/manifest.json. When you run nexo_update, the sync script:
- Installs new crons from the manifest
- Updates changed schedules/intervals
- Removes crons no longer in the manifest (only core ones)
- Never touches personal crons you created yourself
Every cron execution is tracked in the cron_runs table via a universal wrapper. Use nexo_schedule_status to see what ran overnight:
β
deep-sleep: 1/1 OK, 4523s avg β 37 sessions, 259 findings
β
immune: 48/48 OK, 2s avg
β evolution: 0/1 OK β CLI timeout
Add personal crons from conversation with nexo_schedule_add β generates LaunchAgent (macOS) or systemd timer (Linux) automatically.
Deep Sleep automatically extracts reusable procedures from successful multi-step tasks and stores them as skills with full procedural content (steps, gotchas, markdown).
Pipeline: trace β draft β published β archived. Trust rises with successful use, decays without it. No human approval gates.
7 MCP tools: nexo_skill_create, nexo_skill_match, nexo_skill_get, nexo_skill_result, nexo_skill_list, nexo_skill_merge, nexo_skill_stats.
A web interface at localhost:6174 with 6 interactive pages for visual insight into your brain's state:
| Page | What It Shows |
|---|---|
| Overview | System health at a glance β memory counts, trust score, active sessions, recent changes |
| Graph | Interactive D3.js visualization of the knowledge graph (nodes, edges, clusters) |
| Memory | Browse and search all memory stores (STM, LTM, sensory, archived) |
| Somatic | Pain map per file/area β see which parts of your codebase cause the most errors |
| Adaptive | Personality signals, learned weights, and current mode |
| Sessions | Active and historical sessions with timeline and diary entries |
Built with FastAPI backend and D3.js frontend. Dashboard files are installed to NEXO_HOME/dashboard/ but must be started manually:
python3 ~/.nexo/dashboard/app.pyThis opens localhost:6174 in your browser. Add --port 8080 to change the port or --no-browser to skip auto-opening.
Memory alone doesn't make a co-operator. What makes the difference is the behavioral loop β the automated discipline that ensures every session starts informed, runs with guardrails, and ends with self-reflection.
7 hooks fire automatically at key moments in every Claude Code session:
| Hook | When | What It Does |
|---|---|---|
| SessionStart (timestamp) | Session opens | Writes session timestamp for staleness detection |
| SessionStart (briefing) | Session opens | Generates briefing from SQLite: overdue reminders, today's tasks, pending followups, active sessions. Cleans up post-mortem flags. |
| Stop | Session ends | Mandatory post-mortem: self-critique (5 questions), session buffer entry, followup creation, proactive seeds for next session |
| PostToolUse (capture) | After each tool call | Captures meaningful mutations to the Sensory Register + auto-diary every 10 tool calls |
| PostToolUse (inbox) | After each tool call | Inter-terminal inbox delivery between parallel sessions |
| PreCompact | Before context compression | Saves full session checkpoint to SQLite β task, files, decisions, errors, reasoning thread + emergency diary |
| PostCompact | After context compression | Re-injects Core Memory Block so the session continues seamlessly from where it left off |
Session starts
β
SessionStart hook generates briefing
β
Operator reads diary, reminders, followups
β
Heartbeat on every interaction (sentiment, context shifts)
β
Guard check before every code edit
β
PreCompact hook saves full checkpoint if conversation is compressed
β
PostCompact hook re-injects Core Memory Block β session continues seamlessly
β
Stop hook triggers mandatory post-mortem:
- Self-critique: 5 questions about what could be better
- Session buffer: structured entry for the reflection engine
- Followups: anything promised gets scheduled
- Proactive seeds: what can the next session do without being asked?
β
Reflection engine processes buffer (after 3+ sessions)
β
Nocturnal processes: decay, consolidation, self-audit, dreaming
After 3+ sessions accumulate, the stop hook triggers nexo-reflection.py:
- Extracts recurring tasks, error patterns, mood trends
- Updates
user_model.jsonwith observed behavior - No LLM required β runs as pure Python
Existing users upgrading from any previous version:
npx nexo-brain # detects current version, migrates automatically- Updates hooks, core files, plugins, scripts, and LaunchAgent templates
- Runs database schema migrations automatically
- Never touches your data (memories, learnings, preferences)
- Saves updated CLAUDE.md as reference (doesn't overwrite customizations)
NEXO Brain includes a local CLI that runs independently of any single terminal client:
nexo chatβ launch a NEXO terminal client; if both Claude Code and Codex are available, it asks every time which one to open and puts the last-used client firstnexo updateβ sync runtime from source, run migrations, reconcile schedulesnexo doctor --tier runtimeβ boot/runtime/deep diagnostics with--fixmodenexo scripts listβ list all personal scripts and their statusnexo scripts reconcileβ align declared schedules with actual LaunchAgents/systemdnexo -vβ show installed runtime version
The CLI lives at NEXO_HOME/bin/nexo and is added to your PATH during install.
Scripts in NEXO_HOME/scripts/ are first-class managed entities:
- Tracked in SQLite with metadata, categories, and schedule associations
- Inline metadata in scripts declares name, runtime, schedule, and recovery policy
nexo scripts create NAMEscaffolds a new script with the correct templatenexo scripts reconcilecreates/repairs LaunchAgents from declared metadatanexo scripts syncdiscovers filesystem state and updates the registrynexo doctor --tier runtimedetects orphaned schedules, missing plists, and drift
Personal scripts are completely separate from core NEXO processes. The crons/manifest.json defines core; everything in NEXO_HOME/scripts/ is personal.
Core and personal jobs now declare explicit recovery contracts in crons/manifest.json:
| Field | Purpose |
|---|---|
recovery_policy |
catchup, restart, restart_daemon, or skip |
run_on_boot |
Re-run when the machine starts |
run_on_wake |
Re-run after sleep/resume |
idempotent |
Safe to re-run without side effects |
max_catchup_age |
Maximum age of a missed window to still catch up |
If the Mac was asleep during a scheduled window, catchup detects the gap from cron_runs (not a state file) and re-executes eligible jobs once. Interval-based personal scripts get a single recovery run, not repeated ticks.
For personal daemon-style helpers, recovery_policy=restart_daemon plus schedule_required=true declares an official KeepAlive schedule. NEXO can now reconcile and repair those daemons instead of treating them as unmanaged legacy LaunchAgents.
Before nexo chat or MCP server start, NEXO runs a preflight check:
- Apply power policy (caffeinate on macOS, systemd-inhibit on Linux)
- Run safe local migrations and backfills
- Sync personal scripts registry
- For dev-linked runtimes: check if source repo is behind, pull if safe, sync to runtime
This replaces the old "blind startup" where NEXO entered without verifying runtime health.
A bi-temporal entity-relationship graph with 988 nodes and 896 edges. Entities and relationships carry both valid-time (when the fact was true) and system-time (when it was recorded), enabling temporal queries like "what did we know about X last Tuesday?". BFS traversal discovers multi-hop connections between concepts. Event-sourced edges with smart dedup (ADD/UPDATE/NOOP) prevent redundant writes while preserving full history.
4 MCP tools: nexo_kg_query (SPARQL-like queries), nexo_kg_path (shortest path between entities), nexo_kg_neighbors (direct connections), nexo_kg_stats (graph metrics).
Full Linux support and Windows via WSL. The installer detects the platform and configures the appropriate process manager (LaunchAgents on macOS, catch-up on startup for Linux). PEP 668 compliance (venv on Ubuntu 24.04+). Session keepalive prevents phantom sessions during long tasks. Opportunistic maintenance runs cognitive processes when resources are available.
Windows users: NEXO Brain requires WSL (Windows Subsystem for Linux). Install WSL first, then run
npx nexo-braininside the Ubuntu/WSL terminal.
A new abstraction layer routes storage operations through a unified interface, making the system multi-tenant ready. Each operator's data is isolated while sharing the same cognitive engine.
Signal weights learn from real user feedback via Ridge regression. A 2-week shadow mode observes before activating. Weight momentum (85/15 blend) prevents personality whiplash. Automatic rollback if correction rate doubles.
