loading…
Search for a command to run...
loading…
Persistent semantic memory for AI agents — hybrid SQLite + FTS5 with DAG-based summaries, context compaction, and 7 MCP tools. Open source, self-hosted, zero AP
Persistent semantic memory for AI agents — hybrid SQLite + FTS5 with DAG-based summaries, context compaction, and 7 MCP tools. Open source, self-hosted, zero API cost.
Every AI agent has amnesia. Mnemo Cortex fixes that — and then some. Persistent memory that survives across sessions, searches by meaning, and costs $0 to run.
| 🧠 Deep Recall | Persistent memory across sessions. Semantic search. $0 to run. |
| 🌙 Dreaming | Cross-agent overnight synthesis. Every agent wakes up knowing what the others did. |
| 📚 WikAI | Auto-compiled knowledge base. The wiki is regenerated nightly from Mnemo. Never goes stale. |
| 📬 Sparks Bus | Agent-to-agent messaging with delivery confirmation. A2A-compatible. |
| 🪪 Developer's Passport | Safe behavioral-claim ingestion layer. Review queue + 32 detectors + provenance buckets. Dev-targeted beta. |
| 🔗 Mem0 Bridge | "And Mem0, not instead of Mem0." Use both. |
⌘ Claude Code → 60-second install — Give CC Fluid Memory with Deep Recall
🖥️ Claude Desktop → MCP setup — Works on Windows, Mac, and Linux
🦞 OpenClaw → MCP integration — Give Your ClawdBot a Brain. One Config Line.
📋 What can it do? → Read the full Capabilities doc
Every night, Mnemo reads every connected agent's memories and synthesizes them into a single brief. Each agent wakes up knowing what the others did. No manual relay. No copy-paste. It just happens.
This is the only AI memory system that does cross-agent synthesis. Mem0, Zep, and Letta store memory per agent. Mnemo dreams across all of them.
Already using Mem0? Keep it. Mnemo runs as a fast local working-memory layer in front of your existing Mem0 deployment. When Mnemo has what you need: sub-100ms local recall. When local results are thin: automatic fallback to Mem0 for depth. Writes sync both ways.
"And Mem0" — not "instead of Mem0."
Mem0 makes you choose one shared store. Mnemo lets you architect for your actual privacy and separation needs.
A 3,000+ page wiki layer auto-compiled from Mnemo data. Organized into projects/, entities/, concepts/, and sources/. Searchable through three MCP tools: wiki_search, wiki_read, wiki_index.
The wiki is never edited directly. It's recompiled nightly by mnemo-wiki-compile.py from Mnemo data. Mnemo is the source of truth. The wiki is the study guide. If a page is wrong, fix the source memories in Mnemo and recompile.
The compiler clusters recent memories by topic, passes each cluster + the existing page to gemini-2.5-flash, and writes a fully-rewritten page that integrates the new information without bloating. Cross-references are validated against the live page set — no hallucinated wikilinks. Every page carries a provenance footer listing the Mnemo session IDs that fed it, so any claim is auditable. Per-page failures are isolated; one bad LLM call posts ⚠️ to #alerts and the run continues.
This is the Karpathy/Nate Jones hybrid in production: query-time facts in Mnemo + write-time synthesis in WikAI. Neither Mem0, Zep, nor Letta offer this. See Inspirations below.
A delivery-confirmed messaging system for multi-agent communication. Lives as a module inside Mnemo Cortex at sparks_bus/ AND ships standalone at github.com/GuyMannDude/sparks-bus.
Doctrine: Discord is the doorbell. Mnemo is the mailbox. The tracking ID is the receipt.
Lifecycle visible in #dispatch:
📬 DELIVERED → ✅ PICKED UP → 🔄 LOOP CLOSED
Plus one-shot ⚠️ alerts in #alerts for delivery failures and stale messages. No retry storms.
Two install modes auto-detected at startup:
A2A compatible. Agent Cards live in sparks_bus/agent-cards/ for every agent in the deployment, formatted to Google's A2A spec. Each bus message maps to an A2A Task: tracking_id → task.id, subject → task.name, body → task.input, lifecycle → A2A TaskState. Transport (HTTPS / JSON-RPC) is the v2 roadmap; data shape compatibility is in now. See sparks_bus/A2A.md.
Includes SETUP-PROMPT.md — a self-contained prompt any AI agent can read to bootstrap the entire bus on a fresh deployment. Karpathy's "idea file as publishing format" pattern.
Status: beta. Dev-targeted release. A reference-grade safety layer for developers building agent systems that need to ingest user working-style claims into an agent's context. Observations are recorded as candidates, reviewed, and promoted to stable claims; nothing lands in the user's profile without an explicit promotion step.
What's in the box: 5 MCP tools, a review queue, 32 content detectors (secrets, PII, prompt injection, generic fluff, duplicates), 4 provenance buckets, a policy layer with 4-way disposition outcomes, git-tracked audit, and a 200-entry eval corpus. Current eval: 53.0% accuracy / 0.458 macro-F1.
MCP tools: passport_get_user_context, passport_observe_behavior, passport_list_pending_observations, passport_promote_observation, passport_forget_or_override. Reference integration via stdio MCP at integrations/openclaw-mcp/. See passport/README.md for the 5-minute quickstart.
Designed so the user owns the artifact, not the platform. The possessive in the name is deliberate — it drops when the hosted / browser-AI release for normal users ships. Today's release is for devs who wire MCP subprocesses into their own agent stacks.
Three layers, one source of truth:
| Layer | Role | Analogy |
|---|---|---|
| Mnemo Cortex | Source of truth. Raw facts, sessions, key events. Multi-agent, query-time. | The librarian's filing cabinet |
| WikAI | Compiled view. Auto-generated from Mnemo. Cross-referenced, browsable. Write-time. | The study guide |
| Brain files | Live working memory. Current state, identity, active context per agent. | The sticky notes on your desk |
When they disagree, Mnemo wins. WikAI is always regenerable from Mnemo. Brain files are ephemeral. This split is what lets the system scale: facts go where they're addressable (Mnemo), synthesis goes where it's browsable (WikAI), and active state stays where it can change at the speed of work (brain files).
We did not invent this. We adopted the best ideas in the air, credited them openly, and built on top.
SETUP-PROMPT.md.🤖 ClaudePilot Enabled — AI-guided installation. Designed for Claude (free). Works with ChatGPT, Gemini, and others.
Proven on two live agents — Rocky with six weeks of recall, Alice with one.
OpenClaw Agent ──writes──▶ Session Tape (disk)
│
Watcher Daemon ──reads──▶ Mnemo v2 SQLite
│
Refresher Daemon ◀──reads─────┘
│
writes──▶ MNEMO-CONTEXT.md ──▶ Agent Bootstrap
The full v2.4 stack:
┌─────────────────────────────────────────┐
│ Mnemo Cortex Stack │
└─────────────────────────────────────────┘
Agents (CC, Rocky, Opie, BW, Cliff)
│ ┌──────────────┐
├── recall / save / search ──────────▶│ Mnemo SQLite │ ◀── Source of Truth
│ │ + FTS5 + │
│ │ Embeddings │
│ └──────┬───────┘
│ │
├── bus_send / bus_read / bus_reply ──▶ Sparks Bus ──▶ Discord (#dispatch)
│ (SQLite) 📬 → ✅ → 🔄
│
├── wiki_search / wiki_read ─────────▶ WikAI (3,000+ .md pages)
│ ▲
│ │ auto-compiled nightly
│ │
│ ┌────────┴───────┐
│ │ Dreaming │ 3:15 AM → Dream Brief
│ │ + Wiki │ 3:30 AM → Wiki Pages
│ │ Compiler │
│ └────────────────┘
│
├── passport_* ──────────────────────▶ Passport (user prefs)
│
└── Mem0 Bridge ─────────────────────▶ Mem0 (fallback depth layer)
Built-in deployment verification. No agent runs without verified memory.
mnemo-cortex health
mnemo-cortex health check
=========================
Core Services
API server (http://artforge:50001) ...... OK (v2.1.0, 156 memories, 42ms)
Database ................................. OK (12 sessions (3 hot, 4 warm, 5 cold))
Compaction model ......................... OK (qwen2.5:32b-instruct — responding)
Agents (3 discovered)
rocky .................................... OK (recall returned 5 results (234ms))
cc ....................................... OK (recall returned 3 results (189ms))
opie ..................................... OK (recall returned 4 results (201ms))
Watchers
mnemo-watcher-cc ......................... OK (active, PID 4521)
mnemo-refresh ............................ OK (active, PID 4523)
MCP Registration
openclaw.json ............................ OK (mnemo-cortex registered)
14/14 checks passed
Options: --json (machine-readable) · --quiet (exit code only) · --agents (agent checks only) · --services (watcher checks only) · --check-mcp <path> (validate MCP configs)
Wire to cron: 0 */6 * * * mnemo-cortex health --quiet || your-alert-command
Every agent conversation captured automatically. No manual saves, no hooks, no code changes.
Mnemo watches your agent's session files from the outside and ingests every message as it happens. Two adapter patterns depending on your agent platform:
| Platform | Capture Method | Command |
|---|---|---|
| OpenClaw | Session file watcher (tails JSONL) | mnemo-cortex watch --backfill |
| Claude Code | Session file watcher (same) | mnemo-cortex watch --backfill |
| Claude Desktop | MCP tools (save/recall/search) | Setup guide |
# 1. Start Mnemo (if not already running)
mnemo-cortex start
# 2. Start auto-capture
mnemo-cortex watch --backfill
That's it. Every exchange your agent has is now captured, compressed, and searchable.
Set the MNEMO_AUTO_CAPTURE environment variable to start the watcher automatically whenever Mnemo starts:
# Add to your shell profile (~/.bashrc, ~/.zshrc, etc.)
export MNEMO_AUTO_CAPTURE=true
With this set, mnemo-cortex start also starts the session watcher — no separate watch command needed.
mnemo-cortex status
Look for:
Watcher: running (PID 4521) — auto-capturing sessions
Or check the database directly:
mnemo-cortex recall "what happened today"
Mnemo Cortex v2 is a sidecar memory coprocessor for AI agents. It watches your agent's session files from the outside, ingests every message into a local SQLite database, compresses older messages into summaries via LLM-backed compaction, and writes a MNEMO-CONTEXT.md file that your agent reads at bootstrap.
No hooks. No agent modifications. No cloud dependency. Mnemo keeps your memory on disk — if either process restarts, the data is already there.
MNEMO-CONTEXT.md to the agent's workspace every 5 seconds.Proven on two live OpenClaw agents:
| Agent | Host | Messages | Summaries | Conversations | Recall |
|---|---|---|---|---|---|
| Alice | THE VAULT (Threadripper) | 210+ | 18+ | 5 | 1 week |
| Rocky | IGOR (laptop) | 3,000+ | 429+ | 20+ | 6 weeks |
🤖 ClaudePilot Enabled — Follow the guide in CLAUDEPILOT.md and paste it into claude.ai. Claude becomes your personal installer. No experience needed. Works with ChatGPT, Gemini, and others.
Mnemo Cortex runs on Linux, macOS, and Windows. The core (Python + SQLite) is cross-platform. Platform-specific differences:
| Linux | macOS | Windows | |
|---|---|---|---|
| Server | systemd | launchd / manual | Task Scheduler / manual |
| Claude Code | Full support | Full support | Full support |
| Claude Desktop | Full support | Full support | Full support |
| OpenClaw | Full support | Full support | Full support |
~/.openclaw/agents/<agent>/sessions/ (if using OpenClaw)git clone https://github.com/GuyMannDude/mnemo-cortex.git
cd mnemo-cortex
python -m venv .venv
source .venv/bin/activate
pip install -e .
mkdir -p ~/.mnemo-v2
When editing config files (scripts, .env, openclaw.json, etc.), don't replace the whole file. Instead, show three things:
1. FIND THIS — a few lines of the existing file so you can find the exact spot:
"settings": {
"model": "old-model-name", ← this is what you're changing
"temperature": 0.7
}
2. CHANGE TO THIS — just the line(s) that change:
"model": "new-model-name",
3. VERIFY — the edited section with surrounding context so you can confirm it's right:
"settings": {
"model": "new-model-name", ← changed
"temperature": 0.7
}
Find the landmark, make the edit, visually confirm it matches. Use this method for every config file edit throughout the installation.
Create mnemo-watcher.sh (adjust paths for your agent):
#!/usr/bin/env bash
SESSIONS_DIR="$HOME/.openclaw/agents/main/sessions"
DB="$HOME/.mnemo-v2/mnemo.sqlite3"
CHECKPOINT="$HOME/.mnemo-v2/watcher.offset"
AGENT_ID="rocky" # your agent's name
INTERVAL=2
cd /path/to/mnemo-cortex
source .venv/bin/activate
mkdir -p "$HOME/.mnemo-v2"
LAST_FILE=""
while true; do
NEWEST=$(ls -t "$SESSIONS_DIR"/*.jsonl 2>/dev/null | head -1)
if [[ -z "$NEWEST" ]]; then sleep "$INTERVAL"; continue; fi
if [[ "$NEWEST" != "$LAST_FILE" ]]; then
SESSION_ID=$(basename "$NEWEST" .jsonl)
echo "0" > "$CHECKPOINT"
LAST_FILE="$NEWEST"
echo "[mnemo-watcher] Tracking session: $SESSION_ID"
fi
python3 -c "
from mnemo_v2.watch.session_watcher import SessionWatcher
w = SessionWatcher(\"$DB\", \"$NEWEST\", \"$CHECKPOINT\")
n = w.poll_once(agent_id=\"$AGENT_ID\", session_id=\"$SESSION_ID\")
if n > 0:
print(f\"[mnemo-watcher] Ingested {n} messages\")
"
sleep "$INTERVAL"
done
Create mnemo-refresher.sh:
#!/usr/bin/env bash
SESSIONS_DIR="$HOME/.openclaw/agents/main/sessions"
DB="$HOME/.mnemo-v2/mnemo.sqlite3"
OUTPUT="$HOME/.openclaw/workspace/MNEMO-CONTEXT.md"
AGENT_ID="rocky" # your agent's name
INTERVAL=5
cd /path/to/mnemo-cortex
source .venv/bin/activate
mkdir -p "$HOME/.mnemo-v2"
while true; do
NEWEST=$(ls -t "$SESSIONS_DIR"/*.jsonl 2>/dev/null | head -1)
if [[ -n "$NEWEST" ]]; then
SESSION_ID=$(basename "$NEWEST" .jsonl)
python3 -c "
from mnemo_v2.watch.context_refresher import ContextRefresher
r = ContextRefresher(\"$DB\", \"$OUTPUT\")
ok = r.refresh_once(agent_id=\"$AGENT_ID\", session_id=\"$SESSION_ID\")
if ok:
print(\"[mnemo-refresher] MNEMO-CONTEXT.md updated\")
"
fi
sleep "$INTERVAL"
done
mkdir -p ~/.config/systemd/user
cat > ~/.config/systemd/user/mnemo-watcher.service << 'EOF'
[Unit]
Description=Mnemo v2 Session Watcher
After=network.target
[Service]
Type=simple
ExecStart=%h/path/to/mnemo-watcher.sh
Restart=on-failure
RestartSec=5
Environment=PYTHONUNBUFFERED=1
[Install]
WantedBy=default.target
EOF
cat > ~/.config/systemd/user/mnemo-refresher.service << 'EOF'
[Unit]
Description=Mnemo v2 Context Refresher
After=mnemo-watcher.service
[Service]
Type=simple
ExecStart=%h/path/to/mnemo-refresher.sh
Restart=on-failure
RestartSec=5
Environment=PYTHONUNBUFFERED=1
[Install]
WantedBy=default.target
EOF
systemctl --user daemon-reload
systemctl --user enable --now mnemo-watcher mnemo-refresher
Replace your mnemo-ingest handler to read from disk instead of calling the v1 API:
import { HookHandler } from "openclaw/plugin-sdk";
import { readFileSync } from "fs";
import { join } from "path";
const WORKSPACE = process.env.OPENCLAW_WORKSPACE || join(process.env.HOME || "", ".openclaw", "workspace");
const CONTEXT_FILE = join(WORKSPACE, "MNEMO-CONTEXT.md");
const handler: HookHandler = async (event) => {
if (event.type === "agent" && event.action === "bootstrap") {
try {
const content = readFileSync(CONTEXT_FILE, "utf-8").trim();
if (content && event.context.bootstrapFiles) {
event.context.bootstrapFiles.push({ basename: "MNEMO-CONTEXT.md", content });
}
} catch {}
}
};
export default handler;
source .venv/bin/activate
for f in ~/.openclaw/agents/main/sessions/*.jsonl; do
SID=$(basename "$f" .jsonl)
python3 -c "
from mnemo_v2.watch.session_watcher import SessionWatcher
from pathlib import Path
import tempfile, os
cp = Path(tempfile.mktemp()); cp.write_text('0')
w = SessionWatcher('$HOME/.mnemo-v2/mnemo.sqlite3', '$f', str(cp))
n = w.poll_once(agent_id='your-agent', session_id='$SID')
print(f'Ingested {n} messages from $SID')
os.unlink(str(cp))
"
done
# Check services
systemctl --user status mnemo-watcher mnemo-refresher
# Check database
python3 -c "
import sqlite3
conn = sqlite3.connect('$HOME/.mnemo-v2/mnemo.sqlite3')
for t in ['conversations', 'messages', 'summaries']:
n = conn.execute(f'SELECT COUNT(*) FROM {t}').fetchone()[0]
print(f'{t}: {n}')
"
# Check context file
cat ~/.openclaw/workspace/MNEMO-CONTEXT.md
Recall / cross-agent search returns "No chunks"
Most common cause: your embedding model setting doesn't match your provider's current model name. Model names change — check your provider's docs:
| Provider | Current Embedding Model | Deprecated / Dead |
|---|---|---|
| Ollama (local) | nomic-embed-text |
— |
| OpenAI | text-embedding-3-small |
text-embedding-ada-002 |
gemini-embedding-001 |
text-embedding-004 (shut down Jan 2026) |
If you recently switched providers or updated your config, verify the model name is correct and that your API key has access to the embedding endpoint.
Health check fails on "Compaction model"
The compaction model (default: qwen2.5:32b-instruct via Ollama) must be running and reachable. Check:
curl http://localhost:11434/v1/models # List loaded Ollama models
If you're using a remote Ollama instance, set MNEMO_SUMMARY_URL to point to it.
Server unreachable
If mnemo-cortex health can't reach the API, check:
curl http://localhost:50001/health # Or your MNEMO_URL
Common causes: wrong port, firewall blocking, server not started. On multi-machine setups, ensure the target host's firewall allows the port (e.g., ufw allow from 10.0.0.0/24 to any port 50001).
After setup, run the smoke test to confirm everything works:
cd /path/to/mnemo-cortex
source .venv/bin/activate
pytest tests/test_smoke.py -v
Expected output (all 4 assertions must pass):
tests/test_smoke.py::test_ingest_compact_expand PASSED
What it verifies:
✅ Ingest: 24 messages stored successfully
✅ Conversation: agent/session pair created
✅ Compaction: summaries generated from message chunks
✅ Expansion: summary expands back to source messages (verbatim)
If the test fails, check that all Python dependencies are installed (pip install -e .).
mnemo_v2/
api/server.py FastAPI app (optional — v2 works without it)
db/schema.sql Canonical schema + FTS5 tables
db/migrations.py Schema bootstrap and compatibility checks
store/ingest.py Durable transcript ingest + tape journaling
store/compaction.py Leaf/condensed compaction with LLM summarization
store/assemble.py Active frontier → model-visible context
store/retrieval.py FTS5 search + source-lineage replay
watch/session_watcher.py Tails JSONL session logs into the store
watch/context_refresher.py Writes MNEMO-CONTEXT.md on an interval
messagescontext_itemssnippet or verbatimSee mnemo_v2/db/schema.sql for the full schema. Key tables:
| Table | Purpose |
|---|---|
conversations |
Agent + session pairs |
messages |
Immutable transcript (role, content, seq) |
summaries |
Compacted summaries with depth and lineage |
summary_messages |
Links summaries to source messages |
summary_sources |
Links condensed summaries to leaf summaries (DAG) |
context_items |
The active frontier (what the agent sees) |
compaction_events |
Audit log of all compaction operations |
raw_tape |
Append-only crash recovery journal |
OpenClaw 2026.4.10 shipped a native Active Memory plugin. Some people have asked whether it replaces Mnemo Cortex. Short answer: no — they solve different problems. Here's the difference, based on testing both on our Sparky sandbox agent.
| Active Memory (native) | Mnemo Cortex (MCP) | |
|---|---|---|
| Scope | Single agent | Cross-agent (multi-agent bus) |
| Store | Local workspace files + FTS | Centralized SQLite + embeddings |
| Persistence | Per-agent, per-workspace | Survives resets, sessions, machine moves |
| Cross-session | Within one agent's workspace | Any agent, any machine |
| Integration | Independent store | Independent store |
We run both. Active Memory handles per-agent recent context. Mnemo handles everything that crosses agents or needs durable archival. They stack; they don't compete.
For two years, Guy Hutchins — a 73-year-old maker in Half Moon Bay — acted as the "Human Sync Port" for his AI agents, manually copying transcripts between sessions. Then came OpenClaw, Rocky, and a $100 Claude subscription. In one session, Guy, Rocky, and Opie designed a memory coprocessor that actually worked. They named it Mnemo Cortex.
v2.0 was a team effort: Opie (Claude Opus) designed the architecture, AL (ChatGPT) built the implementation, CC (Claude Code) deployed and integrated it, Alice and Rocky (OpenClaw agents) served as live test subjects, and Guy Hutchins made it all happen.
Read the full story: Finding Mnemo
The Sparks team:
External inspirations (the Clapton Method — adopt the best ideas, credit openly, build on top):
SETUP-PROMPT.md.Built for Project Sparks.
MIT
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"mnemo-cortex": {
"command": "npx",
"args": []
}
}
}