freshcrate
Home > MCP Servers > nexo

nexo

NEXO Brain β€” Shared brain for AI agents. Persistent memory, semantic RAG, natural forgetting, metacognitive guard, trust scoring, 150+ MCP tools. Works with Claude Code, Codex, Claude Desktop & any MC

Description

NEXO Brain β€” Shared brain for AI agents. Persistent memory, semantic RAG, natural forgetting, metacognitive guard, trust scoring, 150+ MCP tools. Works with Claude Code, Codex, Claude Desktop & any MCP client. 100% local, open source, free.

README

NEXO Brain β€” Your AI Gets a Brain

npm F1 0.588 on LoCoMo +55% vs GPT-4 GitHub starsLicense: AGPL-3.0

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.

NEXO Brain Architecture

Watch the overview on YouTube Β· Watch the full deep-dive

Start here:

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 Across Clients

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 chat opens 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 / USER contract, so NEXO can update product rules in CORE while preserving operator-specific instructions in USER.
  • For Codex specifically, nexo chat and 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_open
    • nexo_task_close
    • persistent protocol_debt
    • enforceable Cortex gates
  • 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 context and recent 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

Client Capability Matrix

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

Supported Clients

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

The Problem

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

The Solution: A Cognitive Architecture

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.

What Makes NEXO Brain Different

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

How the Brain Works

Memory That Forgets (And That's a Feature)

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.

Semantic Search (Finding by Meaning)

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

Metacognition (Thinking About Thinking)

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.

Cognitive Dissonance

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).

Sibling Memories

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."

Trust Score (0-100)

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.

Sentiment Detection

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.

Sleep Cycle

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.

Cognitive Cortex

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.

Durable Workflow Runtime

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_open creates a persistent run with step metadata, idempotency key, priority, and shared state
  • nexo_workflow_update records replayable checkpoints, retry metadata, approval gates, and the current actionable state
  • nexo_workflow_resume tells the agent what to do next without guessing
  • nexo_workflow_replay reconstructs the recent execution history honestly instead of pretending the run is still in memory
  • nexo_workflow_list keeps 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.

Context Continuity (Auto-Compaction)

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:

  1. Configure the hooks in your Claude Code settings.json
  2. NEXO Brain's heartbeat automatically maintains the checkpoint
  3. When compaction happens, the PreCompact hook reads the checkpoint and injects a recovery block
  4. 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).

Cognitive Features

NEXO Brain provides 150+ MCP tools across 23 categories. These features implement cognitive science concepts that go beyond basic memory:

Input Pipeline

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.

Memory Management

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.

Operational Continuity

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.

Retrieval

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.

Proactive

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.

Benchmark: LoCoMo (ACL 2024)

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/.

Nervous System (v2.0.0)

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 v2 β€” Overnight Learning (v2.1.0)

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

Session Tone β€” Emotional Intelligence

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.

Cron Manifest & Scheduler (v2.4.0)

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.

Skill Auto-Creation (v2.4.0)

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.

Dashboard (v1.6.0)

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.py

This opens localhost:6174 in your browser. Add --port 8080 to change the port or --no-browser to skip auto-opening.

Full Orchestration System

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.

Automated Hooks

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

The Session Lifecycle

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

Reflection Engine

After 3+ sessions accumulate, the stop hook triggers nexo-reflection.py:

  • Extracts recurring tasks, error patterns, mood trends
  • Updates user_model.json with observed behavior
  • No LLM required β€” runs as pure Python

Auto-Migration

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)

Runtime CLI (v2.6.0)

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 first
  • nexo update β€” sync runtime from source, run migrations, reconcile schedules
  • nexo doctor --tier runtime β€” boot/runtime/deep diagnostics with --fix mode
  • nexo scripts list β€” list all personal scripts and their status
  • nexo scripts reconcile β€” align declared schedules with actual LaunchAgents/systemd
  • nexo -v β€” show installed runtime version

The CLI lives at NEXO_HOME/bin/nexo and is added to your PATH during install.

Personal Scripts Registry (v2.6.0)

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 NAME scaffolds a new script with the correct template
  • nexo scripts reconcile creates/repairs LaunchAgents from declared metadata
  • nexo scripts sync discovers filesystem state and updates the registry
  • nexo doctor --tier runtime detects 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.

Recovery-Aware Background Jobs (v2.6.2)

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.

Startup Preflight (v2.6.2)

Before nexo chat or MCP server start, NEXO runs a preflight check:

  1. Apply power policy (caffeinate on macOS, systemd-inhibit on Linux)
  2. Run safe local migrations and backfills
  3. Sync personal scripts registry
  4. 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.

Knowledge Graph (v0.8)

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).

Cross-Platform Support

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-brain inside the Ubuntu/WSL terminal.

Storage Router

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.

Learned Weights & Somatic Markers (v0.7.0)

Adaptive Learned Weights

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.

Somatic Markers (Pain Memory)

VersionChangesUrgencyDate
v7.1.4## What's Changed * v7.1.4: fix packaged updater verification order by @wazionapps in https://github.com/wazionapps/nexo/pull/231 **Full Changelog**: https://github.com/wazionapps/nexo/compare/v7.1.3...v7.1.4High4/20/2026
v7.1.1## What's Changed * release: ship v7.1.1 updater hotfix by @wazionapps in https://github.com/wazionapps/nexo/pull/225 **Full Changelog**: https://github.com/wazionapps/nexo/compare/v7.1.0...v7.1.1High4/19/2026
v6.5.0## Plan Consolidado Β· Fase F0.2 β€” operadores ya pueden activar/desactivar cualquier automatizaciΓ³n personal ### CLI nuevo - `nexo scripts enable <name>` / `disable <name>` / `status <name>` β€” todos aceptan `--json`. - Refuse to toggle packaged core scripts; el operador tiene `nexo scripts unschedule` para esa ruta. - Status devuelve `{enabled, classification, core, last_run}`. ### Cron wrapper gate (F0.2.4) - `nexo-cron-wrapper.sh` lee `personal_scripts.enabled` en cada tick. - Si estΓ‘ deshabiHigh4/19/2026
v5.5.2## What's Changed * fix: v5.5.2 β€” auto-repair unloaded LaunchAgents by @wazionapps in https://github.com/wazionapps/nexo/pull/184 * fix: v5.5.2 verify launchagent repairs + model fallback cleanup by @wazionapps in https://github.com/wazionapps/nexo/pull/185 **Full Changelog**: https://github.com/wazionapps/nexo/compare/v5.5.1...v5.5.2High4/15/2026
v5.5.0enforcement_engine.py wraps Claude Code in stream-json mode with real-time monitoring and injection. All ~15 headless crons get enforcement automatically. Falls back gracefully. ## What's Changed * feat: v5.5.0 real-time headless Protocol Enforcer by @wazionapps in https://github.com/wazionapps/nexo/pull/182 **Full Changelog**: https://github.com/wazionapps/nexo/compare/v5.4.9...v5.5.0High4/15/2026
v5.4.9All headless sessions (Deep Sleep, email-monitor, followup-runner, catchup, synthesis, evolution, ~15 scripts) now receive enforcement rules via append_system_prompt automatically. Single integration point in run_automation_prompt() β€” no script modifications needed. Install: npx nexo-brain@latest ## What's Changed * feat: headless Protocol Enforcer via run_automation_prompt by @wazionapps in https://github.com/wazionapps/nexo/pull/180 * feat: v5.4.9 headless Protocol Enforcer release by @wazioHigh4/15/2026
v5.3.20### Fix operator alias lost after update - Migration now restores custom operator shell aliases (e.g. `nora`) in `.zshrc`/`.bash_profile` if lost during a previous update. - Skip alias creation when operator name is "nexo" to avoid shadowing the CLI binary. **Full Changelog**: https://github.com/wazionapps/nexo/compare/v5.3.19...v5.3.20 ## What's Changed * fix: restore operator shell alias after update by @wazionapps in https://github.com/wazionapps/nexo/pull/156 **Full Changelog**: https:/High4/13/2026
v5.1.0## What's Changed * fix(audit-fase1): wal_autocheckpoint + item_read_tokens cleanup (2/9 items) by @wazionapps in https://github.com/wazionapps/nexo/pull/96 * chore(skills): add run-release-final-audit read-only skill by @wazionapps in https://github.com/wazionapps/nexo/pull/97 * fix(auto_update): rotate old backup directories to cap disk usage by @wazionapps in https://github.com/wazionapps/nexo/pull/98 * chore(maintenance): remove dead check_and_run_overdue dispatcher (Learning #194) by @wazioHigh4/11/2026
v3.2.0## Recent memory fallbacks + live system catalog - add public transcript fallback MCP tools: `nexo_transcript_recent`, `nexo_transcript_search`, and `nexo_transcript_read` - share the same transcript parser between Deep Sleep and the public fallback path so overnight analysis and operator-visible recovery stay aligned - add `nexo_system_catalog` and `nexo_tool_explain` for a live runtime map built from canonical sources - document the new continuity ladder across README, docs, changelog, blog, hHigh4/8/2026

Similar Packages

altk-evolveSelf improving agents through iterationsv1.0.10
Auto-claude-code-research-in-sleepARIS βš”οΈ (Auto-Research-In-Sleep) β€” Lightweight Markdown-only skills for autonomous ML research: cross-model review loops, idea discovery, and experiment automation. No framework, no lock-in β€” works wiv0.4.4
LLM-WikiAutonomous knowledge base plugin for Claude Code - captures reserch, ideas, and decisions into an interlinked wiki with reserch-on-miss, semantic search, and a Wikipedia-style web UI. Knowledge compoumain@2026-04-18
AdamAutonomous AI Agent Harness β€” persistent memory, SWARM orchestration, event-driven triggers. The KAIROS pattern, built independently before the Claude Code leak. pip install adam-frameworkv1.0-stable
aiA productive AI coworker that learns, self-improves, and ships work.main@2026-04-21