nexo-brain 2.6.5 → 2.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +911 -143
- package/bin/nexo-brain.js +256 -0
- package/package.json +1 -1
- package/src/auto_close_sessions.py +24 -4
- package/src/auto_update.py +45 -6
- package/src/cli.py +136 -3
- package/src/db/_episodic.py +5 -16
- package/src/doctor/providers/runtime.py +5 -0
- package/src/evolution_cycle.py +51 -1
- package/src/plugins/episodic_memory.py +1 -1
- package/src/plugins/personal_plugins.py +135 -0
- package/src/plugins/update.py +25 -3
- package/src/public_contribution.py +396 -0
- package/src/runtime_power.py +416 -0
- package/src/scripts/nexo-evolution-run.py +394 -2
- package/templates/plugin-template.py +36 -0
package/README.md
CHANGED
|
@@ -1,220 +1,988 @@
|
|
|
1
|
-
# NEXO Brain
|
|
1
|
+
# NEXO Brain — Your AI Gets a Brain
|
|
2
2
|
|
|
3
|
-
[](LICENSE)
|
|
3
|
+
[](https://www.npmjs.com/package/nexo-brain)
|
|
4
|
+
[](https://github.com/wazionapps/nexo/blob/main/benchmarks/locomo/results/)
|
|
5
|
+
[](https://github.com/snap-research/locomo/issues/33)
|
|
7
6
|
[](https://github.com/wazionapps/nexo/stargazers)
|
|
7
|
+
[](https://www.gnu.org/licenses/agpl-3.0)
|
|
8
8
|
|
|
9
|
-
>
|
|
9
|
+
> Local cognitive runtime for Claude Code — persistent memory, overnight learning, runtime CLI, recovery-aware background jobs, startup preflight, and doctor diagnostics. 150+ MCP tools. Benchmarked on LoCoMo (F1 0.588, +55% vs GPT-4). Submitted to the Claude Code plugin marketplace.
|
|
10
10
|
|
|
11
|
-
NEXO Brain
|
|
11
|
+
**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.**
|
|
12
12
|
|
|
13
13
|
<p align="center">
|
|
14
14
|
<a href="https://www.youtube.com/watch?v=IBs7zh7ZMG0">
|
|
15
|
-
<img src="assets/nexo-brain-infographic-v5.png" alt="NEXO Brain
|
|
15
|
+
<img src="assets/nexo-brain-infographic-v5.png" alt="NEXO Brain Architecture" width="700">
|
|
16
16
|
</a>
|
|
17
17
|
</p>
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<a href="https://nexo-brain.com/features/benchmark/">See benchmark</a>
|
|
25
|
-
·
|
|
26
|
-
<a href="https://nexo-brain.com">Website</a>
|
|
27
|
-
</p>
|
|
19
|
+
[Watch the overview on YouTube](https://www.youtube.com/watch?v=IBs7zh7ZMG0) · [Watch the full deep-dive](https://www.youtube.com/watch?v=bKAfowyyy5M)
|
|
20
|
+
|
|
21
|
+
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.
|
|
22
|
+
|
|
23
|
+
## The Problem
|
|
28
24
|
|
|
29
|
-
|
|
25
|
+
AI coding agents are powerful but amnesic:
|
|
26
|
+
- **No memory** — closes a session, forgets everything
|
|
27
|
+
- **Repeats mistakes** — makes the same error you corrected yesterday
|
|
28
|
+
- **No context** — can't connect today's work with last week's decisions
|
|
29
|
+
- **Reactive** — waits for instructions instead of anticipating needs
|
|
30
|
+
- **No learning** — doesn't improve from experience
|
|
31
|
+
- **No safety** — stores anything it's told, including poisoned or redundant data
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
## The Solution: A Cognitive Architecture
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
NEXO Brain implements the **Atkinson-Shiffrin memory model** from cognitive psychology (1968) — the same model that explains how human memory works:
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
```
|
|
38
|
+
What you say and do
|
|
39
|
+
|
|
|
40
|
+
+---> Sensory Register (raw capture, 48h)
|
|
41
|
+
| |
|
|
42
|
+
| +---> Attention filter: "Is this worth remembering?"
|
|
43
|
+
| |
|
|
44
|
+
| v
|
|
45
|
+
+---> Short-Term Memory (7-day half-life)
|
|
46
|
+
| |
|
|
47
|
+
| +---> Used often? --> Consolidate to Long-Term Memory
|
|
48
|
+
| +---> Not accessed? --> Gradually forgotten
|
|
49
|
+
|
|
|
50
|
+
+---> Long-Term Memory (60-day half-life)
|
|
51
|
+
|
|
|
52
|
+
+---> Active: instantly searchable by meaning
|
|
53
|
+
+---> Dormant: faded but recoverable ("oh right, I remember now!")
|
|
54
|
+
+---> Near-duplicates auto-merged to prevent clutter
|
|
55
|
+
```
|
|
41
56
|
|
|
42
|
-
|
|
57
|
+
This isn't a metaphor. NEXO Brain literally implements Ebbinghaus forgetting curves, rehearsal-based reinforcement, and memory consolidation during automated "sleep" processes.
|
|
43
58
|
|
|
44
|
-
|
|
59
|
+
## What Makes NEXO Brain Different
|
|
45
60
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
61
|
+
| Without NEXO Brain | With NEXO Brain |
|
|
62
|
+
|---------------------|-----------------|
|
|
63
|
+
| Memory gone after each session | Persistent across sessions with natural decay and reinforcement |
|
|
64
|
+
| Repeats the same mistakes | Checks "have I made this mistake before?" before every action |
|
|
65
|
+
| Keyword search only | Finds memories by **meaning**, not just words |
|
|
66
|
+
| Starts cold every time | Resumes from the mental state of the last session |
|
|
67
|
+
| Same behavior regardless of context | Adapts tone and approach based on your mood |
|
|
68
|
+
| No relationship | Trust score that evolves — makes fewer redundant checks as alignment grows |
|
|
69
|
+
| Stores everything blindly | Prediction error gating rejects redundant information at write time |
|
|
70
|
+
| Vulnerable to memory poisoning | 4-layer security pipeline scans every memory before storage |
|
|
71
|
+
| No proactive behavior | Context-triggered reminders fire when topics match, not just by date |
|
|
52
72
|
|
|
53
|
-
##
|
|
73
|
+
## How the Brain Works
|
|
54
74
|
|
|
55
|
-
|
|
75
|
+
### Memory That Forgets (And That's a Feature)
|
|
56
76
|
|
|
57
|
-
|
|
58
|
-
| --- | --- | --- |
|
|
59
|
-
| **NEXO Brain benchmark build** | **0.588** | **CPU only** |
|
|
60
|
-
| GPT-4 (128K) | 0.379 | GPU cloud |
|
|
61
|
-
| Gemini Pro 1.0 | 0.313 | GPU cloud |
|
|
62
|
-
| LLaMA-3 70B | 0.295 | A100 GPU |
|
|
63
|
-
| GPT-3.5 + Contriever | 0.283 | GPU |
|
|
77
|
+
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:
|
|
64
78
|
|
|
65
|
-
|
|
79
|
+
- A lesson learned yesterday is strong. If you never encounter it again, it fades — because it probably wasn't important.
|
|
80
|
+
- A lesson accessed 5 times in 2 weeks gets promoted to long-term memory — because repeated use proves it matters.
|
|
81
|
+
- A dormant memory can be reactivated if something similar comes up — the "oh wait, I remember this" moment.
|
|
66
82
|
|
|
67
|
-
|
|
83
|
+
### Semantic Search (Finding by Meaning)
|
|
68
84
|
|
|
69
|
-
|
|
70
|
-
|
|
85
|
+
NEXO Brain doesn't search by keywords. It searches by **meaning** using vector embeddings (fastembed, 768 dimensions).
|
|
86
|
+
|
|
87
|
+
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.
|
|
88
|
+
|
|
89
|
+
### Metacognition (Thinking About Thinking)
|
|
90
|
+
|
|
91
|
+
Before every code change, NEXO Brain asks itself: **"Have I made a mistake like this before?"**
|
|
92
|
+
|
|
93
|
+
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.
|
|
94
|
+
|
|
95
|
+
### Cognitive Dissonance
|
|
96
|
+
|
|
97
|
+
When you give an instruction that contradicts established knowledge, NEXO Brain doesn't silently obey or silently resist. It **verbalizes the conflict**:
|
|
98
|
+
|
|
99
|
+
> "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?"
|
|
100
|
+
|
|
101
|
+
You decide: **paradigm shift** (permanent change), **exception** (one-time), or **override** (old memory was wrong).
|
|
102
|
+
|
|
103
|
+
### Sibling Memories
|
|
104
|
+
|
|
105
|
+
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:
|
|
106
|
+
|
|
107
|
+
> "Applying the Linux deploy procedure. Note: there's a sibling for macOS that uses a different port."
|
|
108
|
+
|
|
109
|
+
### Trust Score (0-100)
|
|
110
|
+
|
|
111
|
+
NEXO Brain tracks alignment with you through a trust score:
|
|
112
|
+
|
|
113
|
+
- **You say thanks** --> score goes up --> reduces redundant verification checks
|
|
114
|
+
- **Makes a mistake you already taught it** --> score drops --> becomes more careful, checks more thoroughly
|
|
115
|
+
- **The score doesn't control permissions** — you're always in control. It's a mirror that helps calibrate rigor.
|
|
116
|
+
|
|
117
|
+
### Sentiment Detection
|
|
118
|
+
|
|
119
|
+
NEXO Brain reads your tone (keywords, message length, urgency signals) and adapts:
|
|
120
|
+
|
|
121
|
+
- **Frustrated?** --> Ultra-concise mode. Zero explanations. Just solve the problem.
|
|
122
|
+
- **In flow?** --> Good moment to suggest that backlog item from last Tuesday.
|
|
123
|
+
- **Urgent?** --> Immediate action, no preamble.
|
|
124
|
+
|
|
125
|
+
### Sleep Cycle
|
|
126
|
+
|
|
127
|
+
Like a human brain, NEXO Brain has automated processes that run while you're not using it:
|
|
128
|
+
|
|
129
|
+
| Time | Process | Human Analogy |
|
|
130
|
+
|------|---------|---------------|
|
|
131
|
+
| 03:00 | Decay + memory consolidation + merge duplicates + dreaming | Deep sleep consolidation |
|
|
132
|
+
| 04:00 | Clean expired data, prune redundant memories | Synaptic pruning |
|
|
133
|
+
| 07:00 | Self-audit, health checks, metrics | Waking up + orientation |
|
|
134
|
+
| 23:30 | Process day's events, extract patterns | Pre-sleep reflection |
|
|
135
|
+
| Boot | Catch-up: run anything missed while computer was off | -- |
|
|
136
|
+
|
|
137
|
+
If your Mac was asleep during any scheduled process, NEXO Brain catches up in order when it wakes.
|
|
138
|
+
|
|
139
|
+
## Cognitive Cortex
|
|
140
|
+
|
|
141
|
+
The Cortex is a middleware cognitive layer that makes the agent **think before acting**. It implements architectural inhibitory control — the agent cannot bypass reasoning.
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
User message → Fast Path check → Simple chat? → Respond directly
|
|
145
|
+
→ Action needed? → Cortex activates
|
|
146
|
+
↓
|
|
147
|
+
Generate cognitive state
|
|
148
|
+
(goal, plan, unknowns, evidence)
|
|
149
|
+
↓
|
|
150
|
+
Middleware validates
|
|
151
|
+
├─ Unknowns? → ASK mode (tools blocked)
|
|
152
|
+
├─ No plan? → PROPOSE mode (read-only)
|
|
153
|
+
└─ Plan + evidence → ACT mode (full access)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
| Feature | What It Does |
|
|
157
|
+
|---------|-------------|
|
|
158
|
+
| **Inhibitory Control** | Physically restricts tools based on reasoning quality. Unknowns → can only ask. No plan → can only propose. Evidence + verification → can act. |
|
|
159
|
+
| **Event-Driven Activation** | Only activates on tool intent, ambiguity, destructive actions, or retries. Simple chat has zero overhead. |
|
|
160
|
+
| **Trust-Gated Escalation** | Low trust score → requires more evidence before allowing "act" mode. Trust builds through successful execution. |
|
|
161
|
+
| **Core Rules Injection** | Automatically surfaces relevant behavioral rules based on task type. |
|
|
162
|
+
| **Activation Metrics** | Tracks modes, inhibition rates, and task types for continuous improvement. |
|
|
163
|
+
|
|
164
|
+
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.
|
|
165
|
+
|
|
166
|
+
## Context Continuity (Auto-Compaction)
|
|
167
|
+
|
|
168
|
+
NEXO Brain automatically preserves session context when Claude Code compacts conversations. Using PreCompact and PostCompact hooks:
|
|
169
|
+
|
|
170
|
+
- **PreCompact**: Saves a complete session checkpoint to SQLite (task, files, decisions, errors, reasoning thread, next step)
|
|
171
|
+
- **PostCompact**: Re-injects a structured Core Memory Block into the conversation, so the session continues seamlessly
|
|
172
|
+
|
|
173
|
+
This means long sessions (8+ hours) feel like one continuous conversation instead of restarting after each compaction.
|
|
174
|
+
|
|
175
|
+
**How it works:**
|
|
176
|
+
1. Configure the hooks in your Claude Code `settings.json`
|
|
177
|
+
2. NEXO Brain's heartbeat automatically maintains the checkpoint
|
|
178
|
+
3. When compaction happens, the PreCompact hook reads the checkpoint and injects a recovery block
|
|
179
|
+
4. The session continues from exactly where it left off
|
|
180
|
+
|
|
181
|
+
**Setup:**
|
|
182
|
+
```json
|
|
183
|
+
{
|
|
184
|
+
"hooks": {
|
|
185
|
+
"PreCompact": [{
|
|
186
|
+
"matcher": "*",
|
|
187
|
+
"hooks": [{"type": "command", "command": "bash $NEXO_HOME/hooks/pre-compact.sh", "timeout": 10}]
|
|
188
|
+
}],
|
|
189
|
+
"PostCompact": [{
|
|
190
|
+
"matcher": "*",
|
|
191
|
+
"hooks": [{"type": "command", "command": "bash $NEXO_HOME/hooks/post-compact.sh", "timeout": 10}]
|
|
192
|
+
}]
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
2 new MCP tools: `nexo_checkpoint_save` (manual or hook-triggered checkpoint), `nexo_checkpoint_read` (retrieves the latest checkpoint for context injection).
|
|
198
|
+
|
|
199
|
+
## Cognitive Features
|
|
200
|
+
|
|
201
|
+
NEXO Brain provides **150+ MCP tools** across 20+ categories. These features implement cognitive science concepts that go beyond basic memory:
|
|
202
|
+
|
|
203
|
+
### Input Pipeline
|
|
204
|
+
|
|
205
|
+
| Feature | What It Does |
|
|
206
|
+
|---------|-------------|
|
|
207
|
+
| **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. |
|
|
208
|
+
| **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. |
|
|
209
|
+
| **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. |
|
|
210
|
+
| **Secret Redaction** | Auto-detects and redacts API keys, tokens, passwords, and other sensitive data before storage. Secrets never reach the vector database. |
|
|
211
|
+
|
|
212
|
+
### Memory Management
|
|
213
|
+
|
|
214
|
+
| Feature | What It Does |
|
|
215
|
+
|---------|-------------|
|
|
216
|
+
| **Pin / Snooze / Archive** | Granular lifecycle states for memories. Pin = never decays (critical knowledge). Snooze = temporarily hidden (revisit later). Archive = cold storage (searchable but inactive). |
|
|
217
|
+
| **Intelligent Chunking** | Adaptive chunking that respects sentence and paragraph boundaries. Produces semantically coherent chunks instead of arbitrary token splits, reducing retrieval noise. |
|
|
218
|
+
| **Adaptive Decay** | Decay rate adapts per memory based on access patterns: frequently-accessed memories decay slower, rarely-accessed ones fade faster. Prevents permanent clutter while keeping active knowledge sharp. |
|
|
219
|
+
| **Auto-Migration** | Formal schema migration system (schema_migrations table) tracks all database changes. Safe, reversible schema evolution for production systems — upgrades never lose data. |
|
|
220
|
+
| **Auto-Merge Duplicates** | Batch cosine deduplication during the 03:00 sleep cycle. Respects sibling discrimination — similar memories about different contexts are kept separate. |
|
|
221
|
+
| **Memory Dreaming** | Discovers hidden connections between recent memories during the 03:00 sleep cycle. Surfaces non-obvious patterns like "these three bugs all relate to the same root cause." |
|
|
222
|
+
|
|
223
|
+
### Retrieval
|
|
224
|
+
|
|
225
|
+
| Feature | What It Does |
|
|
226
|
+
|---------|-------------|
|
|
227
|
+
| **HyDE Query Expansion** | Generates hypothetical answer embeddings for richer semantic search. Instead of searching for "deploy error", it imagines what a helpful memory about deploy errors would look like, then searches for that. |
|
|
228
|
+
| **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. |
|
|
229
|
+
| **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. |
|
|
230
|
+
| **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. |
|
|
231
|
+
| **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. |
|
|
232
|
+
| **Spreading Activation** | Graph-based co-activation network. Memories retrieved together reinforce each other's connections, building an associative web that improves over time. |
|
|
233
|
+
| **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. |
|
|
234
|
+
|
|
235
|
+
### Proactive
|
|
236
|
+
|
|
237
|
+
| Feature | What It Does |
|
|
238
|
+
|---------|-------------|
|
|
239
|
+
| **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. |
|
|
240
|
+
| **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. |
|
|
241
|
+
| **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. |
|
|
242
|
+
| **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. |
|
|
243
|
+
| **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. |
|
|
244
|
+
| **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. |
|
|
245
|
+
|
|
246
|
+
## Benchmark: LoCoMo (ACL 2024)
|
|
247
|
+
|
|
248
|
+
NEXO Brain was evaluated on [LoCoMo](https://github.com/snap-research/locomo) (ACL 2024), a long-term conversation memory benchmark with 1,986 questions across 10 multi-session conversations.
|
|
249
|
+
|
|
250
|
+
| System | F1 | Adversarial | Hardware |
|
|
251
|
+
|---|---|---|---|
|
|
252
|
+
| **NEXO Brain v0.5.0** | **0.588** | **93.3%** | **CPU only** |
|
|
253
|
+
| GPT-4 (128K full context) | 0.379 | — | GPU cloud |
|
|
254
|
+
| Gemini Pro 1.0 | 0.313 | — | GPU cloud |
|
|
255
|
+
| LLaMA-3 70B | 0.295 | — | A100 GPU |
|
|
256
|
+
| GPT-3.5 + Contriever RAG | 0.283 | — | GPU |
|
|
257
|
+
|
|
258
|
+
**+55% vs GPT-4. Running entirely on CPU.**
|
|
259
|
+
|
|
260
|
+
**Key findings:**
|
|
261
|
+
- Outperforms GPT-4 (128K full context) by 55% on F1 score
|
|
262
|
+
- 93.3% adversarial rejection rate — reliably says "I don't know" when information isn't available
|
|
263
|
+
- 74.9% recall across 1,986 questions
|
|
264
|
+
- Open-domain F1: 0.637 | Multi-hop F1: 0.333 | Temporal F1: 0.326
|
|
265
|
+
- Runs on CPU with 768-dim embeddings (BAAI/bge-base-en-v1.5) — no GPU required
|
|
266
|
+
- First MCP memory server benchmarked on a peer-reviewed dataset
|
|
267
|
+
|
|
268
|
+
Full results in [`benchmarks/locomo/results/`](benchmarks/locomo/results/).
|
|
269
|
+
|
|
270
|
+
## Nervous System (v2.0.0)
|
|
271
|
+
|
|
272
|
+
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:
|
|
273
|
+
|
|
274
|
+
| Script | Schedule | What It Does |
|
|
275
|
+
|--------|----------|-------------|
|
|
276
|
+
| **cognitive-decay** | 03:00 daily | Ebbinghaus decay + memory consolidation + duplicate merging + dreaming |
|
|
277
|
+
| **sleep** | 04:00 daily | Synaptic pruning, expired data cleanup |
|
|
278
|
+
| **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 |
|
|
279
|
+
| **self-audit** | 07:00 daily | Health checks, guard stats, trust score review, metrics |
|
|
280
|
+
| **postmortem** | 23:30 daily | Session consolidation, extract patterns from day's events |
|
|
281
|
+
| **catchup** | On boot | Runs any missed scheduled processes (Mac was off/asleep) |
|
|
282
|
+
| **tcc-approve** | On boot (macOS) | Auto-approve macOS permissions for Claude Code updates |
|
|
283
|
+
| **prevent-sleep** | Always (daemon) | Keeps machine awake for nocturnal processes (caffeinate/systemd-inhibit) |
|
|
284
|
+
| **evolution** | Weekly (Sun) | Self-improvement proposals — NEXO suggests and applies enhancements |
|
|
285
|
+
| **followup-hygiene** | Weekly (Sun) | Normalizes statuses, flags stale followups, cleans orphans |
|
|
286
|
+
| **learning-housekeep** | 03:15 daily | Dedup learnings, adjust weights by usage, process overdue reviews, reconcile decision outcomes |
|
|
287
|
+
| **immune** | Every 30 min | Quarantine processing, memory promotion/rejection, synaptic pruning |
|
|
288
|
+
| **synthesis** | 06:00 daily | Memory synthesis — discovers cross-memory patterns |
|
|
289
|
+
| **watchdog** | Every 30 min | Monitors services, LaunchAgents, and infrastructure health |
|
|
290
|
+
| **auto-close-sessions** | Every 5 min | Cleans stale sessions |
|
|
291
|
+
|
|
292
|
+
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.
|
|
293
|
+
|
|
294
|
+
## Deep Sleep v2 — Overnight Learning (v2.1.0)
|
|
295
|
+
|
|
296
|
+
Deep Sleep is a 4-phase pipeline that runs at 4:30 AM and makes NEXO smarter while you sleep:
|
|
297
|
+
|
|
298
|
+
```
|
|
299
|
+
Phase 1: COLLECT (Python)
|
|
300
|
+
├── Reads all session transcripts from the day
|
|
301
|
+
├── Splits each session into individual .txt files
|
|
302
|
+
└── Gathers DB state (followups, learnings, trust)
|
|
303
|
+
|
|
304
|
+
Phase 2: EXTRACT (Opus, one call per session)
|
|
305
|
+
├── 8 types of findings per session:
|
|
306
|
+
│ ├── Uncaptured corrections (user corrected agent, no learning saved)
|
|
307
|
+
│ ├── Self-corrected errors (knowledge gaps to fix)
|
|
308
|
+
│ ├── Unformalised ideas (mentioned but never tracked)
|
|
309
|
+
│ ├── Missed commitments (promised but no followup)
|
|
310
|
+
│ ├── Protocol violations (guard_check, heartbeat, change_log)
|
|
311
|
+
│ ├── Emotional signals (frustration, flow, satisfaction)
|
|
312
|
+
│ ├── Abandoned projects (started but not finished)
|
|
313
|
+
│ └── Productivity patterns (corrections, proactivity, tool efficiency)
|
|
314
|
+
└── Outputs per-session JSON with findings + emotional timeline
|
|
315
|
+
|
|
316
|
+
Phase 3: SYNTHESIZE (Opus, one call)
|
|
317
|
+
├── Cross-session patterns (same error in 5 sessions = systemic)
|
|
318
|
+
├── Daily mood arc with score (0.0 = terrible day, 1.0 = great day)
|
|
319
|
+
├── Recurring triggers (what causes frustration vs flow)
|
|
320
|
+
├── Productivity analysis (corrections, tool efficiency)
|
|
321
|
+
├── Abandoned project detection
|
|
322
|
+
├── Morning agenda (prioritized)
|
|
323
|
+
└── Calibration recommendations
|
|
324
|
+
|
|
325
|
+
Phase 4: APPLY (Python)
|
|
326
|
+
├── Auto-creates learnings from high-confidence findings
|
|
327
|
+
├── Creates followups for unfinished work
|
|
328
|
+
├── Updates mood_history in calibration.json (30-day rolling)
|
|
329
|
+
├── Generates session-tone.json (emotional guidance for next session)
|
|
330
|
+
└── Writes morning-briefing.md
|
|
71
331
|
```
|
|
72
332
|
|
|
73
|
-
|
|
333
|
+
### Session Tone — Emotional Intelligence
|
|
74
334
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
335
|
+
Deep Sleep generates a `session-tone.json` that tells NEXO how to behave next morning:
|
|
336
|
+
|
|
337
|
+
- **Agent made many mistakes yesterday** → Acknowledge them, show what was learned, demonstrate improvement
|
|
338
|
+
- **User had a bad day (mood < 40%)** → Supportive approach, lighter start, avoid known frustration triggers
|
|
339
|
+
- **User had a great day (mood > 70%)** → Reinforce momentum, reference wins, push ambitious goals
|
|
340
|
+
- **Agent was too reactive** → Be proactive today, don't wait for instructions
|
|
341
|
+
|
|
342
|
+
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.
|
|
343
|
+
|
|
344
|
+
## Cron Manifest & Scheduler (v2.4.0)
|
|
345
|
+
|
|
346
|
+
All core crons are defined in `src/crons/manifest.json`. When you run `nexo_update`, the sync script:
|
|
347
|
+
- **Installs** new crons from the manifest
|
|
348
|
+
- **Updates** changed schedules/intervals
|
|
349
|
+
- **Removes** crons no longer in the manifest (only core ones)
|
|
350
|
+
- **Never touches** personal crons you created yourself
|
|
351
|
+
|
|
352
|
+
Every cron execution is tracked in the `cron_runs` table via a universal wrapper. Use `nexo_schedule_status` to see what ran overnight:
|
|
353
|
+
|
|
354
|
+
```
|
|
355
|
+
✅ deep-sleep: 1/1 OK, 4523s avg — 37 sessions, 259 findings
|
|
356
|
+
✅ immune: 48/48 OK, 2s avg
|
|
357
|
+
❌ evolution: 0/1 OK — CLI timeout
|
|
358
|
+
```
|
|
80
359
|
|
|
81
|
-
|
|
360
|
+
Add personal crons from conversation with `nexo_schedule_add` — generates LaunchAgent (macOS) or systemd timer (Linux) automatically.
|
|
361
|
+
|
|
362
|
+
## Skill Auto-Creation (v2.4.0)
|
|
363
|
+
|
|
364
|
+
Deep Sleep automatically extracts reusable procedures from successful multi-step tasks and stores them as skills with full procedural content (steps, gotchas, markdown).
|
|
365
|
+
|
|
366
|
+
Pipeline: `trace → draft → published → archived`. Trust rises with successful use, decays without it. No human approval gates.
|
|
367
|
+
|
|
368
|
+
7 MCP tools: `nexo_skill_create`, `nexo_skill_match`, `nexo_skill_get`, `nexo_skill_result`, `nexo_skill_list`, `nexo_skill_merge`, `nexo_skill_stats`.
|
|
369
|
+
|
|
370
|
+
## Dashboard (v1.6.0)
|
|
371
|
+
|
|
372
|
+
A web interface at `localhost:6174` with 6 interactive pages for visual insight into your brain's state:
|
|
373
|
+
|
|
374
|
+
| Page | What It Shows |
|
|
375
|
+
|------|-------------|
|
|
376
|
+
| **Overview** | System health at a glance — memory counts, trust score, active sessions, recent changes |
|
|
377
|
+
| **Graph** | Interactive D3.js visualization of the knowledge graph (nodes, edges, clusters) |
|
|
378
|
+
| **Memory** | Browse and search all memory stores (STM, LTM, sensory, archived) |
|
|
379
|
+
| **Somatic** | Pain map per file/area — see which parts of your codebase cause the most errors |
|
|
380
|
+
| **Adaptive** | Personality signals, learned weights, and current mode |
|
|
381
|
+
| **Sessions** | Active and historical sessions with timeline and diary entries |
|
|
382
|
+
|
|
383
|
+
Built with FastAPI backend and D3.js frontend. Dashboard files are installed to `NEXO_HOME/dashboard/` but must be started manually:
|
|
82
384
|
|
|
83
385
|
```bash
|
|
84
|
-
nexo
|
|
386
|
+
python3 ~/.nexo/dashboard/app.py
|
|
85
387
|
```
|
|
86
388
|
|
|
87
|
-
|
|
389
|
+
This opens `localhost:6174` in your browser. Add `--port 8080` to change the port or `--no-browser` to skip auto-opening.
|
|
88
390
|
|
|
391
|
+
## Full Orchestration System
|
|
392
|
+
|
|
393
|
+
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.
|
|
394
|
+
|
|
395
|
+
### Automated Hooks
|
|
396
|
+
|
|
397
|
+
7 hooks fire automatically at key moments in every Claude Code session:
|
|
398
|
+
|
|
399
|
+
| Hook | When | What It Does |
|
|
400
|
+
|------|------|-------------|
|
|
401
|
+
| **SessionStart (timestamp)** | Session opens | Writes session timestamp for staleness detection |
|
|
402
|
+
| **SessionStart (briefing)** | Session opens | Generates briefing from SQLite: overdue reminders, today's tasks, pending followups, active sessions. Cleans up post-mortem flags. |
|
|
403
|
+
| **Stop** | Session ends | Mandatory post-mortem: self-critique (5 questions), session buffer entry, followup creation, proactive seeds for next session |
|
|
404
|
+
| **PostToolUse (capture)** | After each tool call | Captures meaningful mutations to the Sensory Register + auto-diary every 10 tool calls |
|
|
405
|
+
| **PostToolUse (inbox)** | After each tool call | Inter-terminal inbox delivery between parallel sessions |
|
|
406
|
+
| **PreCompact** | Before context compression | Saves full session checkpoint to SQLite — task, files, decisions, errors, reasoning thread + emergency diary |
|
|
407
|
+
| **PostCompact** | After context compression | Re-injects Core Memory Block so the session continues seamlessly from where it left off |
|
|
408
|
+
|
|
409
|
+
### The Session Lifecycle
|
|
410
|
+
|
|
411
|
+
```
|
|
412
|
+
Session starts
|
|
413
|
+
↓
|
|
414
|
+
SessionStart hook generates briefing
|
|
415
|
+
↓
|
|
416
|
+
Operator reads diary, reminders, followups
|
|
417
|
+
↓
|
|
418
|
+
Heartbeat on every interaction (sentiment, context shifts)
|
|
419
|
+
↓
|
|
420
|
+
Guard check before every code edit
|
|
421
|
+
↓
|
|
422
|
+
PreCompact hook saves full checkpoint if conversation is compressed
|
|
423
|
+
↓
|
|
424
|
+
PostCompact hook re-injects Core Memory Block → session continues seamlessly
|
|
425
|
+
↓
|
|
426
|
+
Stop hook triggers mandatory post-mortem:
|
|
427
|
+
- Self-critique: 5 questions about what could be better
|
|
428
|
+
- Session buffer: structured entry for the reflection engine
|
|
429
|
+
- Followups: anything promised gets scheduled
|
|
430
|
+
- Proactive seeds: what can the next session do without being asked?
|
|
431
|
+
↓
|
|
432
|
+
Reflection engine processes buffer (after 3+ sessions)
|
|
433
|
+
↓
|
|
434
|
+
Nocturnal processes: decay, consolidation, self-audit, dreaming
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
### Reflection Engine
|
|
438
|
+
|
|
439
|
+
After 3+ sessions accumulate, the stop hook triggers `nexo-reflection.py`:
|
|
440
|
+
- Extracts recurring tasks, error patterns, mood trends
|
|
441
|
+
- Updates `user_model.json` with observed behavior
|
|
442
|
+
- No LLM required — runs as pure Python
|
|
443
|
+
|
|
444
|
+
### Auto-Migration
|
|
445
|
+
|
|
446
|
+
Existing users upgrading from any previous version:
|
|
89
447
|
```bash
|
|
90
|
-
nexo
|
|
91
|
-
nexo update
|
|
92
|
-
nexo doctor --tier runtime --json
|
|
93
|
-
nexo doctor --tier runtime --fix
|
|
94
|
-
nexo scripts list
|
|
95
|
-
nexo scripts reconcile
|
|
448
|
+
npx nexo-brain # detects current version, migrates automatically
|
|
96
449
|
```
|
|
450
|
+
- Updates hooks, core files, plugins, scripts, and LaunchAgent templates
|
|
451
|
+
- Runs database schema migrations automatically
|
|
452
|
+
- **Never touches your data** (memories, learnings, preferences)
|
|
453
|
+
- Saves updated CLAUDE.md as reference (doesn't overwrite customizations)
|
|
454
|
+
|
|
455
|
+
## Runtime CLI (v2.6.0)
|
|
456
|
+
|
|
457
|
+
NEXO Brain includes a local CLI that runs independently of Claude Code:
|
|
458
|
+
|
|
459
|
+
- `nexo chat` — launch Claude Code with NEXO as the operator
|
|
460
|
+
- `nexo update` — sync runtime from source, run migrations, reconcile schedules
|
|
461
|
+
- `nexo doctor --tier runtime` — boot/runtime/deep diagnostics with `--fix` mode
|
|
462
|
+
- `nexo scripts list` — list all personal scripts and their status
|
|
463
|
+
- `nexo scripts reconcile` — align declared schedules with actual LaunchAgents/systemd
|
|
464
|
+
- `nexo -v` — show installed runtime version
|
|
97
465
|
|
|
98
|
-
|
|
466
|
+
The CLI lives at `NEXO_HOME/bin/nexo` and is added to your PATH during install.
|
|
99
467
|
|
|
100
|
-
|
|
468
|
+
## Personal Scripts Registry (v2.6.0)
|
|
101
469
|
|
|
102
|
-
|
|
470
|
+
Scripts in `NEXO_HOME/scripts/` are first-class managed entities:
|
|
103
471
|
|
|
104
|
-
-
|
|
105
|
-
-
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
472
|
+
- Tracked in SQLite with metadata, categories, and schedule associations
|
|
473
|
+
- Inline metadata in scripts declares name, runtime, schedule, and recovery policy
|
|
474
|
+
- `nexo scripts create NAME` scaffolds a new script with the correct template
|
|
475
|
+
- `nexo scripts reconcile` creates/repairs LaunchAgents from declared metadata
|
|
476
|
+
- `nexo scripts sync` discovers filesystem state and updates the registry
|
|
477
|
+
- `nexo doctor --tier runtime` detects orphaned schedules, missing plists, and drift
|
|
110
478
|
|
|
111
|
-
|
|
479
|
+
Personal scripts are completely separate from core NEXO processes. The `crons/manifest.json` defines core; everything in `NEXO_HOME/scripts/` is personal.
|
|
112
480
|
|
|
113
|
-
##
|
|
481
|
+
## Recovery-Aware Background Jobs (v2.6.2)
|
|
114
482
|
|
|
115
|
-
|
|
483
|
+
Core and personal jobs now declare explicit recovery contracts in `crons/manifest.json`:
|
|
116
484
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
485
|
+
| Field | Purpose |
|
|
486
|
+
|-------|---------|
|
|
487
|
+
| `recovery_policy` | `catchup`, `restart`, or `skip` |
|
|
488
|
+
| `run_on_boot` | Re-run when the machine starts |
|
|
489
|
+
| `run_on_wake` | Re-run after sleep/resume |
|
|
490
|
+
| `idempotent` | Safe to re-run without side effects |
|
|
491
|
+
| `max_catchup_age` | Maximum age of a missed window to still catch up |
|
|
121
492
|
|
|
122
|
-
|
|
493
|
+
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.
|
|
123
494
|
|
|
124
|
-
|
|
125
|
-
- Trust scoring and behavioral calibration
|
|
126
|
-
- Cognitive dissonance when new instructions conflict with prior knowledge
|
|
127
|
-
- Startup context continuity across compaction
|
|
495
|
+
## Startup Preflight (v2.6.2)
|
|
128
496
|
|
|
129
|
-
|
|
497
|
+
Before `nexo chat` or MCP server start, NEXO runs a preflight check:
|
|
130
498
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
-
|
|
499
|
+
1. Apply power policy (caffeinate on macOS, systemd-inhibit on Linux)
|
|
500
|
+
2. Run safe local migrations and backfills
|
|
501
|
+
3. Sync personal scripts registry
|
|
502
|
+
4. For dev-linked runtimes: check if source repo is behind, pull if safe, sync to runtime
|
|
135
503
|
|
|
136
|
-
|
|
504
|
+
This replaces the old "blind startup" where NEXO entered without verifying runtime health.
|
|
137
505
|
|
|
138
|
-
|
|
506
|
+
## Knowledge Graph (v0.8)
|
|
139
507
|
|
|
140
|
-
|
|
508
|
+
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.
|
|
141
509
|
|
|
142
|
-
-
|
|
143
|
-
- Deep Sleep analysis
|
|
144
|
-
- immune and watchdog checks
|
|
145
|
-
- synthesis, self-audit, postmortem
|
|
146
|
-
- catch-up and stale-session cleanup
|
|
510
|
+
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).
|
|
147
511
|
|
|
148
|
-
|
|
512
|
+
### Cross-Platform Support
|
|
513
|
+
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.
|
|
149
514
|
|
|
150
|
-
|
|
515
|
+
> **Windows users:** NEXO Brain requires [WSL (Windows Subsystem for Linux)](https://learn.microsoft.com/en-us/windows/wsl/install). Install WSL first, then run `npx nexo-brain` inside the Ubuntu/WSL terminal.
|
|
151
516
|
|
|
152
|
-
|
|
517
|
+
### Storage Router
|
|
518
|
+
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.
|
|
153
519
|
|
|
154
|
-
|
|
520
|
+
## Learned Weights & Somatic Markers (v0.7.0)
|
|
155
521
|
|
|
156
|
-
|
|
157
|
-
-
|
|
158
|
-
- reconciliation
|
|
159
|
-
- doctor validation
|
|
160
|
-
- recovery policies such as `run_once_on_wake` and `catchup`
|
|
522
|
+
### Adaptive Learned Weights
|
|
523
|
+
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.
|
|
161
524
|
|
|
162
|
-
|
|
525
|
+
### Somatic Markers (Pain Memory)
|
|
526
|
+
Files and areas that cause repeated errors accumulate a risk score (0.0–1.0). The guard system warns on HIGH RISK (>0.5) and CRITICAL RISK (>0.8), lowering thresholds for more paranoid checking. Clean guard checks reduce risk multiplicatively (×0.7). Nightly decay (×0.95) ensures old pain fades.
|
|
163
527
|
|
|
164
|
-
###
|
|
528
|
+
### Adaptive Personality v2
|
|
529
|
+
6 weighted signals: vibe, corrections, brevity, topic, tool errors, git diff. Emergency keywords bypass hysteresis. Severity-weighted decay. Manual override via `nexo_adaptive_override`.
|
|
165
530
|
|
|
166
|
-
|
|
531
|
+
## Quick Start
|
|
532
|
+
|
|
533
|
+
### Claude Code (Primary)
|
|
534
|
+
|
|
535
|
+
```bash
|
|
536
|
+
npx nexo-brain
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
The installer handles everything:
|
|
540
|
+
|
|
541
|
+
```
|
|
542
|
+
How should I call myself? (default: NEXO) > Atlas
|
|
543
|
+
|
|
544
|
+
Can I explore your workspace to learn about your projects? (y/n) > y
|
|
545
|
+
|
|
546
|
+
Keep Mac awake so my cognitive processes run on schedule? (y/n) > y
|
|
547
|
+
|
|
548
|
+
Installing cognitive engine dependencies...
|
|
549
|
+
Setting up NEXO home...
|
|
550
|
+
Scanning workspace...
|
|
551
|
+
- 3 git repositories
|
|
552
|
+
- Node.js project detected
|
|
553
|
+
Configuring MCP server...
|
|
554
|
+
Setting up nervous system...
|
|
555
|
+
13 core recovery-aware jobs configured.
|
|
556
|
+
Dashboard configured at localhost:6174.
|
|
557
|
+
Caffeinate enabled.
|
|
558
|
+
Generating operator instructions...
|
|
559
|
+
|
|
560
|
+
+----------------------------------------------------------+
|
|
561
|
+
| Atlas is ready. Type 'atlas' to start. |
|
|
562
|
+
+----------------------------------------------------------+
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
### Starting a Session
|
|
566
|
+
|
|
567
|
+
After install, use the runtime CLI:
|
|
568
|
+
|
|
569
|
+
```bash
|
|
570
|
+
nexo chat # Launch Claude Code with NEXO as operator
|
|
571
|
+
nexo doctor # Check runtime health
|
|
572
|
+
nexo update # Pull latest version and sync
|
|
573
|
+
nexo scripts list # See your personal scripts
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
Or use the shell alias created during install (e.g. `atlas`), which runs `claude --dangerously-skip-permissions "."` — launching Claude Code with tool-use permissions pre-approved so the operator can act autonomously.
|
|
577
|
+
|
|
578
|
+
Your operator will greet you immediately — adapted to the time of day, resuming from where you left off. No cold starts.
|
|
579
|
+
|
|
580
|
+
### What Gets Installed
|
|
581
|
+
|
|
582
|
+
| Component | What | Where |
|
|
583
|
+
|-----------|------|-------|
|
|
584
|
+
| Cognitive engine | Python: fastembed, numpy, vector search | pip packages |
|
|
585
|
+
| MCP server | 150+ tools for memory, cognition, learning, guard | NEXO_HOME/ |
|
|
586
|
+
| Claude Code Plugin | Submitted to the Claude Code plugin marketplace (Anthropic) | `.claude-plugin/` |
|
|
587
|
+
| Plugins | Guard, episodic memory, cognitive memory, entities, preferences, update, etc. | Code: src/plugins/, Personal: NEXO_HOME/plugins/ |
|
|
588
|
+
| Hooks (7) | SessionStart, Stop, PostToolUse, PreCompact, PostCompact | NEXO_HOME/hooks/ |
|
|
589
|
+
| Nervous system | 13 core recovery-aware jobs + optional helpers (dashboard, prevent-sleep) | NEXO_HOME/scripts/ |
|
|
590
|
+
| Dashboard | Web UI at localhost:6174 (23 modules, dark theme) — opt-in, always-on | NEXO_HOME/dashboard/ |
|
|
591
|
+
| Runtime CLI | `nexo` command: scripts, doctor, skills, update | NEXO_HOME/bin/ |
|
|
592
|
+
| Doctor | Unified diagnostics: boot/runtime/deep tiers, `--fix` mode | src/doctor/ |
|
|
593
|
+
| Skills v2 | Executable skills with guide/execute/hybrid modes, approval levels | NEXO_HOME/skills/ |
|
|
594
|
+
| Startup Preflight | Health checks before every `nexo chat` or server start | Built into CLI |
|
|
595
|
+
| CLAUDE.md | Complete operator instructions (Codex, hooks, guard, trust, memory) | ~/.claude/CLAUDE.md |
|
|
596
|
+
| Schedule config | schedule.json with customizable process times and timezone | NEXO_HOME/config/ |
|
|
597
|
+
| Auto-update | Non-blocking startup check (5s max), opt-out via schedule.json | Built into server startup |
|
|
598
|
+
| CLAUDE.md tracker | Version-tracked core sections with safe updates preserving customizations | Built into auto-update |
|
|
599
|
+
| Auto-diary | 3-layer system: PostToolUse every 10 calls, PreCompact emergency, heartbeat DIARY_OVERDUE | Built into hooks |
|
|
600
|
+
| Claude Code config | MCP server + 7 hooks + 15 processes registered | ~/.claude/settings.json |
|
|
601
|
+
|
|
602
|
+
### Runtime CLI
|
|
603
|
+
|
|
604
|
+
After installation or auto-update, NEXO adds `NEXO_HOME/bin` to your shell `PATH`. Open a new terminal and the `nexo` command provides operational tools:
|
|
605
|
+
|
|
606
|
+
```bash
|
|
607
|
+
# Personal Scripts
|
|
608
|
+
nexo scripts list # List your personal scripts
|
|
609
|
+
nexo scripts run my-script # Run a script with injected NEXO env
|
|
610
|
+
nexo scripts doctor # Validate all personal scripts
|
|
611
|
+
nexo scripts call nexo_learning_search --input '{"query":"cron"}' # Call any MCP tool
|
|
612
|
+
|
|
613
|
+
# Skills v2
|
|
614
|
+
nexo skills sync # Sync filesystem skill definitions into SQLite
|
|
615
|
+
nexo skills list # List published/stable skills
|
|
616
|
+
nexo skills get SK-... # Inspect a skill definition
|
|
617
|
+
nexo skills apply SK-... --dry-run --json # Resolve guide/execute/hybrid without running it
|
|
618
|
+
nexo skills approve SK-... --execution-level local --approved-by Francisco # Optional metadata override
|
|
619
|
+
nexo skills evolution # Show text→script and improvement candidates
|
|
620
|
+
|
|
621
|
+
# Unified Doctor
|
|
622
|
+
nexo doctor # Quick boot diagnostics
|
|
623
|
+
nexo doctor --tier all # Full system check (boot + runtime + deep)
|
|
624
|
+
nexo doctor --tier runtime --json # Machine-readable health report
|
|
625
|
+
nexo doctor --fix # Apply deterministic repairs
|
|
626
|
+
```
|
|
167
627
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
-
|
|
171
|
-
|
|
628
|
+
Personal scripts live in `NEXO_HOME/scripts/` with inline metadata. See `docs/writing-scripts.md` for details.
|
|
629
|
+
|
|
630
|
+
Skills v2 combine procedural guides with optional executable scripts. Personal skills live in `NEXO_HOME/skills/`, packaged core skills live in `NEXO_CODE/skills/` during development and `NEXO_HOME/skills-core/` in installed environments, and staged runtime copies live in `NEXO_HOME/skills-runtime/`. Execution is fully autonomous: Deep Sleep can evolve mature guide skills into executable drafts automatically, and runtime execution no longer waits for manual approval. See `docs/skills-v2.md` for the full model.
|
|
631
|
+
|
|
632
|
+
The Doctor system reads existing health artifacts (immune, watchdog, self-audit) without triggering repairs in default mode.
|
|
633
|
+
|
|
634
|
+
### Requirements
|
|
635
|
+
|
|
636
|
+
- **macOS or Linux** (Windows via [WSL](https://learn.microsoft.com/en-us/windows/wsl/install))
|
|
637
|
+
- **Node.js 18+** (for the installer)
|
|
638
|
+
- **Claude Opus (latest version) strongly recommended.** NEXO Brain provides 150+ MCP tools across 20+ categories. This cognitive load requires a top-tier model with large context window. Smaller models (Haiku, Sonnet) may struggle with tool selection and produce inconsistent results. Opus handles all 150+ tools without hesitation.
|
|
639
|
+
- Python 3, Homebrew, and Claude Code are installed automatically if missing.
|
|
172
640
|
|
|
173
641
|
## Architecture
|
|
174
642
|
|
|
175
|
-
|
|
643
|
+
### Unified Code/Data Separation (v2.0.0)
|
|
644
|
+
|
|
645
|
+
NEXO Brain separates **code** (immutable, in the repo or npm package) from **data** (personal, in `NEXO_HOME`):
|
|
646
|
+
|
|
647
|
+
| Path | Contents |
|
|
648
|
+
|------|----------|
|
|
649
|
+
| `src/` (or npm package) | Server, plugins, hooks, scripts — never modified at runtime |
|
|
650
|
+
| `NEXO_HOME/` (default `~/.nexo/`) | Database, config, personal plugins, schedule, backups |
|
|
651
|
+
| `NEXO_HOME/config/schedule.json` | Customizable process schedules, timezone, auto_update flag |
|
|
652
|
+
| `NEXO_HOME/plugins/` | Personal plugins that override or extend repo plugins |
|
|
653
|
+
| `NEXO_HOME/data/` | SQLite databases (nexo.db, cognitive.db), migration state |
|
|
654
|
+
|
|
655
|
+
The plugin loader scans `src/plugins/` first (base), then `NEXO_HOME/plugins/` (personal override by filename). This dual-directory approach lets you extend NEXO without forking the repo.
|
|
656
|
+
|
|
657
|
+
### 150+ MCP Tools across 21+ Categories
|
|
658
|
+
|
|
659
|
+
| Category | Count | Tools | Purpose |
|
|
660
|
+
|----------|-------|-------|---------|
|
|
661
|
+
| Cognitive | 8 | retrieve, stats, inspect, metrics, dissonance, resolve, sentiment, trust | The brain — memory, RAG, trust, mood |
|
|
662
|
+
| Cognitive Input | 5 | prediction_gate, security_scan, quarantine, promote, redact | Input pipeline — gating, security, quarantine |
|
|
663
|
+
| Cognitive Advanced | 8 | hyde_search, spread_activate, explain_recall, dream, prospect, hook_capture, pin, archive | Advanced retrieval, proactive, lifecycle |
|
|
664
|
+
| Guard | 3 | check, stats, log_repetition | Metacognitive error prevention |
|
|
665
|
+
| Episodic | 10 | change_log/search/commit, decision_log/outcome/search, review_queue, diary_write/read, recall | What happened and why |
|
|
666
|
+
| Sessions | 4 | startup, heartbeat, stop, status | Session lifecycle + context shift detection + inter-terminal auto-inbox |
|
|
667
|
+
| Coordination | 7 | track, untrack, files, send, ask, answer, check_answer | Multi-session file coordination + messaging |
|
|
668
|
+
| Reminders | 5 | list, create, update, complete, delete | User's tasks and deadlines |
|
|
669
|
+
| Followups | 4 | create, update, complete, delete | System's autonomous verification tasks |
|
|
670
|
+
| Learnings | 5 | add, search, update, delete, list | Error patterns and prevention rules |
|
|
671
|
+
| Credentials | 5 | create, get, update, delete, list | Local credential storage (plaintext SQLite — protect with filesystem permissions) |
|
|
672
|
+
| Task History | 3 | log, list, frequency | Execution tracking and overdue alerts |
|
|
673
|
+
| Menu | 1 | menu | Operations center with box-drawing UI |
|
|
674
|
+
| Entities | 5 | search, create, update, delete, list | People, services, URLs |
|
|
675
|
+
| Preferences | 4 | get, set, list, delete | Observed user preferences |
|
|
676
|
+
| Agents | 5 | get, create, update, delete, list | Agent delegation registry |
|
|
677
|
+
| Backup | 3 | now, list, restore | SQLite data safety |
|
|
678
|
+
| Evolution | 5 | propose, approve, reject, status, history | Self-improvement proposals |
|
|
679
|
+
| Adaptive & Somatic | 4 | adaptive_weights, adaptive_override, somatic_check, somatic_stats | Learned signal weights + pain memory per file |
|
|
680
|
+
| Knowledge Graph | 4 | kg_query, kg_path, kg_neighbors, kg_stats | Bi-temporal entity-relationship graph |
|
|
681
|
+
| Context Continuity | 2 | checkpoint_save, checkpoint_read | Auto-compaction session preservation |
|
|
682
|
+
| Personal Scripts | 9 | sync, list, create, remove, schedules, unschedule, reconcile, classify, ensure_schedules | Script lifecycle management |
|
|
683
|
+
| Skills | 12 | match, create, get, list, apply, approve, result, stats, evolution_candidates, merge, sync, featured | Reusable procedure library |
|
|
684
|
+
| Schedule | 2 | add, status | Personal cron scheduling |
|
|
685
|
+
| Doctor | 1 | doctor | Runtime diagnostics with --fix |
|
|
686
|
+
| Update | 1 | update | Pull latest code, backup, migrate, verify (with rollback) |
|
|
687
|
+
|
|
688
|
+
### Plugin System
|
|
689
|
+
|
|
690
|
+
NEXO Brain supports hot-loadable plugins with a dual-directory loader. Base plugins live in `src/plugins/` (repo). Personal plugins go in `NEXO_HOME/plugins/` and can override base plugins by filename. Drop a `.py` file in `NEXO_HOME/plugins/`:
|
|
691
|
+
|
|
692
|
+
```python
|
|
693
|
+
# my_plugin.py
|
|
694
|
+
def handle_my_tool(query: str) -> str:
|
|
695
|
+
"""My custom tool description."""
|
|
696
|
+
return f"Result for {query}"
|
|
697
|
+
|
|
698
|
+
TOOLS = [
|
|
699
|
+
(handle_my_tool, "nexo_my_tool", "Short description"),
|
|
700
|
+
]
|
|
701
|
+
```
|
|
702
|
+
|
|
703
|
+
Reload without restarting: `nexo_plugin_load("my_plugin.py")`
|
|
704
|
+
|
|
705
|
+
### Data Privacy
|
|
706
|
+
|
|
707
|
+
- **Everything stays local.** All data in `~/.nexo/`, never uploaded anywhere.
|
|
708
|
+
- **No telemetry.** No analytics. No phone-home.
|
|
709
|
+
- **No cloud dependencies.** Vector search runs on CPU (fastembed), not an API.
|
|
710
|
+
- **Auto-update is resilient.** NEXO checks for updates on startup. If an update fails, it continues with the current version and notifies you. Local migrations (database schema, configuration) always run. Network updates (git pull) can be disabled by setting `auto_update: false` in `NEXO_HOME/config/schedule.json`.
|
|
711
|
+
- **Secret redaction.** API keys and tokens are stripped before they ever reach memory storage.
|
|
712
|
+
|
|
713
|
+
## The Psychology Behind NEXO Brain
|
|
714
|
+
|
|
715
|
+
NEXO Brain isn't just engineering — it's applied cognitive psychology:
|
|
716
|
+
|
|
717
|
+
| Psychological Concept | How NEXO Brain Implements It |
|
|
718
|
+
|----------------------|----------------------|
|
|
719
|
+
| Atkinson-Shiffrin (1968) | Three memory stores: sensory register --> STM --> LTM |
|
|
720
|
+
| Ebbinghaus Forgetting Curve (1885) | Exponential decay: `strength = strength * e^(-lambda * time)` |
|
|
721
|
+
| Rehearsal Effect | Accessing a memory resets its strength to 1.0 |
|
|
722
|
+
| Memory Consolidation | Nightly process promotes frequently-used STM to LTM |
|
|
723
|
+
| Prediction Error | Only surprising (novel) information gets stored — redundant input is gated |
|
|
724
|
+
| Spreading Activation (Collins & Loftus, 1975) | Retrieving a memory co-activates related memories through an associative graph |
|
|
725
|
+
| HyDE (Gao et al., 2022) | Hypothetical document embeddings improve semantic recall |
|
|
726
|
+
| Prospective Memory (Einstein & McDaniel, 1990) | Context-triggered intentions fire when cue conditions match |
|
|
727
|
+
| Metacognition | Guard system checks past errors before acting |
|
|
728
|
+
| Cognitive Dissonance (Festinger, 1957) | Detects and verbalizes conflicts between old and new knowledge |
|
|
729
|
+
| Theory of Mind | Models user behavior, preferences, and mood |
|
|
730
|
+
| Synaptic Pruning | Automated cleanup of weak, unused memories |
|
|
731
|
+
| Associative Memory | Semantic search finds related concepts, not just matching words |
|
|
732
|
+
| Memory Reconsolidation | Dreaming process discovers hidden connections during sleep |
|
|
733
|
+
|
|
734
|
+
## Integrations
|
|
735
|
+
|
|
736
|
+
### Claude Code (Primary)
|
|
737
|
+
|
|
738
|
+
NEXO Brain is designed as an MCP server. Claude Code is the primary supported client:
|
|
739
|
+
|
|
740
|
+
```bash
|
|
741
|
+
npx nexo-brain
|
|
742
|
+
```
|
|
176
743
|
|
|
177
|
-
|
|
178
|
-
- ONNX Runtime for embeddings
|
|
179
|
-
- FastMCP server for tool exposure
|
|
180
|
-
- LaunchAgents on macOS and systemd user units on Linux
|
|
744
|
+
All 150+ tools are available immediately after installation. The installer configures Claude Code's `~/.claude/settings.json` automatically.
|
|
181
745
|
|
|
182
|
-
|
|
746
|
+
### OpenClaw
|
|
183
747
|
|
|
184
|
-
|
|
185
|
-
- **23-module optional dashboard**
|
|
186
|
-
- **13 core recovery-aware jobs**
|
|
187
|
-
- **local-first operation**
|
|
748
|
+
NEXO Brain also works as a cognitive memory backend for [OpenClaw](https://github.com/openclaw/openclaw):
|
|
188
749
|
|
|
189
|
-
|
|
750
|
+
#### MCP Bridge (Zero Code)
|
|
190
751
|
|
|
191
|
-
NEXO
|
|
752
|
+
Add NEXO Brain to your OpenClaw config at `~/.openclaw/openclaw.json`:
|
|
192
753
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
754
|
+
```json
|
|
755
|
+
{
|
|
756
|
+
"mcp": {
|
|
757
|
+
"servers": {
|
|
758
|
+
"nexo-brain": {
|
|
759
|
+
"command": "python3",
|
|
760
|
+
"args": ["~/.nexo/server.py"],
|
|
761
|
+
"env": {
|
|
762
|
+
"NEXO_HOME": "~/.nexo"
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
```
|
|
197
769
|
|
|
198
|
-
|
|
770
|
+
Or via CLI:
|
|
199
771
|
|
|
200
|
-
|
|
772
|
+
```bash
|
|
773
|
+
openclaw mcp set nexo-brain '{"command":"python3","args":["~/.nexo/server.py"],"env":{"NEXO_HOME":"~/.nexo"}}'
|
|
774
|
+
openclaw gateway restart
|
|
775
|
+
```
|
|
201
776
|
|
|
202
|
-
|
|
203
|
-
- Features: <https://nexo-brain.com/features/>
|
|
204
|
-
- Benchmark: <https://nexo-brain.com/features/benchmark/>
|
|
205
|
-
- Changelog: <https://nexo-brain.com/changelog/>
|
|
206
|
-
- Wiki: <https://github.com/wazionapps/nexo/wiki>
|
|
207
|
-
- npm: <https://www.npmjs.com/package/nexo-brain>
|
|
777
|
+
#### ClawHub Skill
|
|
208
778
|
|
|
209
|
-
|
|
779
|
+
```bash
|
|
780
|
+
npx clawhub@latest install nexo-brain
|
|
781
|
+
```
|
|
210
782
|
|
|
211
|
-
|
|
783
|
+
#### Native Memory Plugin
|
|
212
784
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
785
|
+
```bash
|
|
786
|
+
npm install @wazionapps/openclaw-memory-nexo-brain
|
|
787
|
+
```
|
|
788
|
+
|
|
789
|
+
```json
|
|
790
|
+
{
|
|
791
|
+
"plugins": {
|
|
792
|
+
"slots": {
|
|
793
|
+
"memory": "memory-nexo-brain"
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
```
|
|
798
|
+
|
|
799
|
+
This replaces OpenClaw's default memory system with NEXO Brain's full cognitive architecture.
|
|
800
|
+
|
|
801
|
+
### Any MCP Client
|
|
802
|
+
|
|
803
|
+
NEXO Brain works with any application that supports the MCP protocol. Configure it as an MCP server pointing to `server.py` inside `NEXO_HOME` (default `~/.nexo/server.py`), with the `NEXO_HOME` env var set to the same directory.
|
|
804
|
+
|
|
805
|
+
## Listed On
|
|
806
|
+
|
|
807
|
+
| Directory | Type | Link |
|
|
808
|
+
|-----------|------|------|
|
|
809
|
+
| npm | Package | [nexo-brain](https://www.npmjs.com/package/nexo-brain) |
|
|
810
|
+
| Glama | MCP Directory | [glama.ai](https://glama.ai/mcp/servers/@wazionapps/nexo) |
|
|
811
|
+
| mcp.so | MCP Directory | [mcp.so](https://mcp.so/server/nexo/wazionapps) |
|
|
812
|
+
| mcpservers.org | MCP Directory | [mcpservers.org](https://mcpservers.org) |
|
|
813
|
+
| OpenClaw | Native Plugin | [openclaw.com](https://openclaw.ai) |
|
|
814
|
+
| dev.to | Technical Article | [How I Applied Cognitive Psychology to AI Agents](https://dev.to/wazionapps/how-i-applied-cognitive-psychology-to-give-ai-agents-real-memory-2oce) |
|
|
815
|
+
| Claude Code | Plugin (pending review) | Submitted to Anthropic's plugin marketplace |
|
|
816
|
+
| nexo-brain.com | Official Website | [nexo-brain.com](https://nexo-brain.com) |
|
|
817
|
+
|
|
818
|
+
## Support the Project
|
|
819
|
+
|
|
820
|
+
If NEXO Brain is useful to you, consider:
|
|
821
|
+
|
|
822
|
+
- **Star this repo** — it helps others discover the project and motivates continued development
|
|
823
|
+
- **[Sponsor on GitHub](https://github.com/sponsors/wazionapps)** — support ongoing development directly
|
|
824
|
+
- **Share your experience** — tell others how you're using cognitive memory in your AI workflows
|
|
825
|
+
- **Contribute** — see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. Issues and PRs welcome
|
|
826
|
+
|
|
827
|
+
[](https://star-history.com/#wazionapps/nexo&Date)
|
|
828
|
+
|
|
829
|
+
## Changelog
|
|
830
|
+
|
|
831
|
+
### v2.6.5 — Power Helper Hardening, Recovery Contracts (2026-04-04)
|
|
832
|
+
- Power helper semantics explicit and safer: `always_on` = platform helper for best-effort background availability.
|
|
833
|
+
- Catch-up recovery suppresses duplicate relaunches for in-flight `cron_runs`.
|
|
834
|
+
- Runtime update/startup reconciles declared personal schedules automatically.
|
|
835
|
+
|
|
836
|
+
### v2.6.3 — Cron Sync Fix, Hook Migration (2026-04-04)
|
|
837
|
+
- Runtime cron sync skips same-file copies, avoiding `SameFileError` on synced runtimes.
|
|
838
|
+
- Core hook migration normalizes legacy flat entries into Claude Code's required `matcher + hooks[]` format.
|
|
839
|
+
|
|
840
|
+
### v2.6.2 — Startup Preflight, Personal Recovery, Power Policy (2026-04-04)
|
|
841
|
+
- Startup preflight before `nexo chat` and server — safe local migrations, deferred remote updates.
|
|
842
|
+
- Personal managed schedules can declare recovery contracts (wake/boot/catchup).
|
|
843
|
+
- Persisted runtime power policy (`always_on`/`disabled`/`unset`). Installer and `nexo update` prompt once.
|
|
844
|
+
- Packaged installs resolve update root correctly (fixes `vunknown`).
|
|
845
|
+
|
|
846
|
+
### v2.6.0 — Personal Scripts Registry, Plugin Marketplace, Managed Evolution (2026-04-03)
|
|
847
|
+
- **Personal scripts registry**: Scripts in `NEXO_HOME/scripts/` tracked in SQLite with metadata, categories, schedules. Full lifecycle: create, sync, reconcile, schedule, unschedule, remove.
|
|
848
|
+
- **Orchestrator removed from core** (breaking): Was opt-in personal automation adding complexity for all users. Existing users keep their setup in `NEXO_HOME/scripts/`.
|
|
849
|
+
- **Claude Code plugin structure**: `plugin.json`, entry point, packaging for marketplace submission.
|
|
850
|
+
- **`nexo chat`**: Official command to launch Claude Code with NEXO as operator.
|
|
851
|
+
- **Managed Evolution hardening**: Can modify core behavior modules with rollback followups.
|
|
852
|
+
- Cron recovery hardened: TCC diagnostics, keepalive sync, personal schedule catchup.
|
|
853
|
+
|
|
854
|
+
### v2.5.0 — Runtime CLI, Doctor, Skills v2, Day Orchestrator (2026-04-03)
|
|
855
|
+
- **Runtime CLI** (`nexo`): New operational CLI separate from installer. `nexo scripts list/run/doctor/call` for personal scripts, `nexo doctor` for diagnostics, `nexo skills apply` for executable skills, `nexo update` for one-step sync.
|
|
856
|
+
- **Unified Doctor**: Modular diagnostic system with boot/runtime/deep tiers. Report-only by default, deterministic `--fix` mode. MCP tool `nexo_doctor`. LaunchAgent schedule drift detection and reconciliation.
|
|
857
|
+
- **Skills v2**: Executable skills with guide/execute/hybrid modes. Security levels (read-only/local/remote) with explicit approval. Core vs personal vs community directories. Deep Sleep auto-evolution integration.
|
|
858
|
+
- **Day Orchestrator**: Autonomous NEXO cycles every 15 min (8:00-23:00). Launches Claude Code headless with full MCP. Checks followups, emails, infra — acts autonomously, emails user only when needed. Opt-in.
|
|
859
|
+
- **Dashboard always-on**: Web UI at localhost:6174 as persistent LaunchAgent. 23 modules, Jinja2 templating, dark theme. Opt-in.
|
|
860
|
+
- **Personal Scripts Framework**: Auto-discovery in NEXO_HOME/scripts/, inline metadata, runtime detection, forbidden-pattern validation, vendorable helper, template.
|
|
861
|
+
- Configurable operator name (UserContext singleton), watchdog normalized to 30 min, LaunchAgent drift fix.
|
|
862
|
+
|
|
863
|
+
### v2.4.0 — Skills, Cron Scheduler, Security, Full Audit (2026-04-03)
|
|
864
|
+
- **Skill Auto-Creation**: Deep Sleep extracts reusable procedures from sessions. Content stored as markdown with steps and gotchas. Trust pipeline with autonomous quality control.
|
|
865
|
+
- **Cron Scheduler**: execution tracking (`cron_runs` table), `nexo_schedule_status` and `nexo_schedule_add` MCP tools, universal cron wrapper for all processes.
|
|
866
|
+
- **Deep Sleep v2.4**: watermark-based collection (late-night sessions included), per-session checkpointing (crash-safe), retry x3, JSON parsing fix, auto-calibration of personality settings.
|
|
867
|
+
- **Security**: credential redaction in tool logs, transcript sanitization, command injection fix in dashboard, path traversal protection in plugin loader.
|
|
868
|
+
- **Diary filter**: startup only shows human sessions, auto-closed cron sessions filtered out. Email sessions preserved as real interactions.
|
|
869
|
+
- **Preflight CI**: 66 automated checks (py_compile, bash -n, manifest consistency, npm artifact, forbidden markers).
|
|
870
|
+
- **Python 3.9 compat**: `from __future__ import annotations` across 18 files.
|
|
871
|
+
- **Linux**: full systemd timer support, .bashrc alias for interactive shells.
|
|
872
|
+
- Passed 5-phase automated audit: Product, Failure, Security, Packaging, UX.
|
|
873
|
+
|
|
874
|
+
### v2.2.0 — Trust Score v2 (2026-04-01)
|
|
875
|
+
- **Trust Score**: fair daily calibration from Deep Sleep analysis. Score 0-100 based on corrections, autonomy, proactivity.
|
|
876
|
+
- **Cognitive Quarantine**: new memories go through quarantine before promotion to LTM.
|
|
877
|
+
|
|
878
|
+
### v2.0.0 — Unified Architecture (2026-03-31)
|
|
879
|
+
- **Code/data separation**: Code in repo (`src/`), personal data in `NEXO_HOME` (default `~/.nexo/`). `NEXO_HOME` env var required.
|
|
880
|
+
- **Plugin loader dual-directory**: Scans `src/plugins/` (base) then `NEXO_HOME/plugins/` (personal override by filename).
|
|
881
|
+
- **Auto-update on startup**: Non-blocking (5s max), resilient, opt-out via `schedule.json`. Separate from manual `nexo_update` tool.
|
|
882
|
+
- **Auto-diary**: 3-layer system — PostToolUse every 10 calls, PreCompact emergency save, heartbeat DIARY_OVERDUE signal.
|
|
883
|
+
- **CLAUDE.md version tracker**: Section markers enable safe core updates without losing user customizations.
|
|
884
|
+
- **schedule.json**: Customizable process schedules with timezone support and `auto_update` flag.
|
|
885
|
+
- **15 autonomous processes**: Added auto-close-sessions, synthesis, backup, tcc-approve, prevent-sleep (cross-platform).
|
|
886
|
+
- **7 hooks**: SessionStart (timestamp + briefing), Stop, PostToolUse (capture + inbox), PreCompact, PostCompact.
|
|
887
|
+
- **150+ MCP tools**: Added `nexo_update` tool for manual updates with rollback.
|
|
888
|
+
- **Lambda fix**: Decay values were 24x too aggressive (STM: 7h to 7d, LTM: 2.4d to 60d).
|
|
889
|
+
- **Guard scoping**: Was returning 35+ irrelevant blocking rules; now scoped to area and gated to high/critical.
|
|
890
|
+
- **12 rounds of external audit**: ~60 findings resolved.
|
|
891
|
+
|
|
892
|
+
### v1.7.0 — Full Internationalization + Linux Support (2026-03-31)
|
|
893
|
+
- **Full i18n**: All UI strings, error messages, DB status values in English. NLP detection patterns retain bilingual keywords (Spanish + English) for multilingual user support.
|
|
894
|
+
- **Linux support**: systemd user timers (preferred) or crontab fallback for all automated cognitive processes.
|
|
895
|
+
- **Auto-resolve followups**: Change log entries automatically cross-reference and complete matching open followups.
|
|
896
|
+
- **Free-form learning categories**: No more hardcoded category validation — use any category name.
|
|
897
|
+
- **CLAUDE.md template rewrite**: 494 to 127 lines, compact procedural format with full heartbeat signal reactions.
|
|
898
|
+
- **Complete sanitization**: All hardcoded paths use `NEXO_HOME` env var. No credentials or personal data in the distributed package. Migration scripts and maintainer tooling use configurable paths.
|
|
899
|
+
|
|
900
|
+
### v1.6.0 — Nervous System + Dashboard v2 (2026-03-30)
|
|
901
|
+
- **Nervous System**: 11 autonomous scripts (decay, deep sleep, self-audit, catchup, evolution, followup hygiene, immune, watchdog, github monitor, learning validator)
|
|
902
|
+
- **Dashboard v2**: 6 interactive pages at localhost:6174 (Overview, Graph, Memory, Somatic, Adaptive, Sessions)
|
|
903
|
+
- **LaunchAgent Templates**: macOS automation templates included in the package for scheduling the nervous system
|
|
904
|
+
- **Hooks**: 7 total — SessionStart, Stop, PostToolUse, PreCompact, PostCompact
|
|
905
|
+
- **Installer**: Now configures dashboard LaunchAgent, nervous system scripts, and all templates automatically
|
|
906
|
+
|
|
907
|
+
### v1.5.2 — Deep Sleep (2026-03-29)
|
|
908
|
+
- **Deep Sleep**: Reads full session transcripts (not just diary) — finds uncaptured corrections, protocol violations, missed commitments
|
|
909
|
+
- Uses Claude CLI in `--bare` mode (no hooks, no CLAUDE.md interference)
|
|
910
|
+
- Catch-up system re-runs yesterday if the Mac was off
|
|
911
|
+
|
|
912
|
+
### v1.5.0 — Modular Core + Knowledge Graph Search (2026-03-29)
|
|
913
|
+
- **Architecture**: `db.py` refactored into `db/` package (11 modules); `cognitive.py` into `cognitive/` package (6 modules)
|
|
914
|
+
- **KG Boost**: Knowledge Graph connection count influences search result ranking
|
|
915
|
+
- **HNSW Vector Index**: Optional approximate nearest neighbor acceleration (auto-activates above 10,000 memories)
|
|
916
|
+
- **Claim Graph**: Decomposes blob memories into atomic verifiable facts with provenance and contradiction detection
|
|
917
|
+
- **Inter-terminal Auto-inbox (D+)**: `nexo_startup` accepts `claude_session_id` for automatic inbox delivery between parallel terminals
|
|
918
|
+
- **Tests**: 24 pytest tests across 3 suites (cognitive, knowledge graph, migrations)
|
|
919
|
+
|
|
920
|
+
### v1.4.1 — Multi-AI Code Review (2026-03-29)
|
|
921
|
+
- **Fix**: 3 bugs found by GPT-5.4 (Codex CLI) + Gemini 2.5 (Gemini CLI) reviewing full codebase
|
|
922
|
+
- **Security**: Memory sanitization prevents prompt injection via stored content
|
|
923
|
+
- **Migration #13**: Normalizes legacy status values on upgrade
|
|
924
|
+
|
|
925
|
+
### v1.4.0 — The Brain Dreams (2026-03-29)
|
|
926
|
+
- **Major**: All 9 nightly scripts migrated from Python word-overlap to CLI wrapper pattern
|
|
927
|
+
- **Stop Hook v8**: Session-scoped tool counting, buffer fallback removed
|
|
928
|
+
- **Guard**: Behavioral rules section surfaces most-violated rules at session start
|
|
929
|
+
|
|
930
|
+
### v1.3.0 — Evolution System (2026-03-28)
|
|
931
|
+
- **New**: Self-improvement cycle — NEXO proposes and applies improvements weekly
|
|
932
|
+
- Dual-mode: auto (low-risk) and review (owner approval required)
|
|
933
|
+
- Circuit breaker, snapshot/rollback, immutable file protection
|
|
934
|
+
|
|
935
|
+
### v1.2.3 — AGPL-3.0 License (2026-03-27)
|
|
936
|
+
- License changed from MIT to AGPL-3.0
|
|
937
|
+
|
|
938
|
+
### v1.2.1 — Stop Hook Hotfix (2026-03-27)
|
|
939
|
+
- **Fix**: v1.2.0 deleted the flag on approve, causing infinite block loops if session didn't close immediately
|
|
940
|
+
- **Fix**: Removed TTL on flag — it persists until SessionStart cleans it up next session
|
|
941
|
+
- **New**: Trivial sessions (<5 meaningful tool calls) skip post-mortem entirely and approve immediately
|
|
942
|
+
- SessionStart hook now cleans up `.postmortem-complete` flag on session start
|
|
943
|
+
|
|
944
|
+
### v1.2.0 — Blocking Stop Hook (2026-03-27)
|
|
945
|
+
- **Fix**: Stop hook now uses `"decision": "block"` instead of `"approve"` to enforce post-mortem execution
|
|
946
|
+
- Previous behavior: hook injected `systemMessage` but AI had already responded — instructions were never processed
|
|
947
|
+
- New behavior: session close is blocked until AI completes self-critique, session diary, buffer entry, and followups
|
|
948
|
+
- Flag-based mechanism (`.postmortem-complete`) allows second close attempt to succeed
|
|
949
|
+
- Works for all NEXO users, not just specific setups
|
|
950
|
+
|
|
951
|
+
### v1.1.1 — Multi-terminal fix (2026-03-27)
|
|
952
|
+
- **Fix**: PostCompact now reads the correct session's checkpoint in multi-terminal setups
|
|
953
|
+
- Changelog section added to README
|
|
954
|
+
|
|
955
|
+
### v1.1.0 — Context Continuity (2026-03-27)
|
|
956
|
+
- **Context Continuity**: PreCompact/PostCompact hooks preserve session state across compaction events
|
|
957
|
+
- New `session_checkpoints` SQLite table + migration #12
|
|
958
|
+
- New tools: `nexo_checkpoint_save`, `nexo_checkpoint_read`
|
|
959
|
+
- Heartbeat automatically maintains checkpoint every interaction
|
|
960
|
+
- Core Memory Block re-injected post-compaction with task, files, decisions, reasoning thread
|
|
961
|
+
- 115+ total tools at the time, 20 categories
|
|
962
|
+
|
|
963
|
+
### v1.0.0 — Cognitive Cortex + Stable Release (2026-03-26)
|
|
964
|
+
- **Cognitive Cortex**: architectural inhibitory control (ASK/PROPOSE/ACT modes)
|
|
965
|
+
- 30 Core Rules as immutable DNA in SQLite
|
|
966
|
+
- Designed via 3-way AI debate (Claude Opus + GPT-5.4 + Gemini 3.1 Pro)
|
|
967
|
+
- Artifact Registry for operational facts
|
|
968
|
+
- Full benchmark suite (LoCoMo F1: 0.588)
|
|
969
|
+
|
|
970
|
+
### v0.10.0 — Smart Context (2026-03-22)
|
|
971
|
+
- Smart Startup: pre-loads memories from pending followups + diary
|
|
972
|
+
- Context Packet: structured injection for subagents
|
|
973
|
+
- Auto-Prime: keyword-triggered area learnings in heartbeat
|
|
974
|
+
- Diary Archive: permanent subconscious memory (180d+ auto-archived)
|
|
975
|
+
|
|
976
|
+
### v0.9.0 — Cognitive Memory (2026-03-15)
|
|
977
|
+
- Atkinson-Shiffrin memory model (STM → LTM promotion)
|
|
978
|
+
- Semantic RAG with fastembed (BAAI/bge-base-en-v1.5, 768 dims)
|
|
979
|
+
- Trust scoring, sentiment detection, adaptive personality modes
|
|
980
|
+
- Ebbinghaus decay, sister detection, quarantine system
|
|
217
981
|
|
|
218
982
|
## License
|
|
219
983
|
|
|
220
|
-
AGPL-3.0
|
|
984
|
+
AGPL-3.0 -- see [LICENSE](LICENSE)
|
|
985
|
+
|
|
986
|
+
---
|
|
987
|
+
|
|
988
|
+
Created by **Francisco Cerdà Puigserver** & **NEXO** (Claude Opus) · Built by [WAzion](https://www.wazion.com)
|