Exocortex

An agent memory and knowledge system. By
MemoryGraph.
Your agents and tools write down what they learn. Every fact is typed,
carries its source, and is stamped with when it was true. Nothing is ever
deleted, so you can ask what the system knew on any past day. Rules decide
things, not a model — the same input always produces the same answer. One
binary, your servers, nothing leaves.
Memory is what agents write. Knowledge is what it becomes.
session ends
│
▼
exocortex.end_session
│
▼
┌─────────────────────────────┐ ┌─────────────────────────────┐
│ Problem ── Fixes ──▶ Error │ │ "What have we learned about │
│ ▲ │ ◀──── │ payment-service?" │
│ └── Solves ── Solution │ search │ "What did we try last time │
│ └── Modifies ─ File │ │ that didn't work?" │
└─────────────────────────────┘ └─────────────────────────────┘
typed nodes, typed edges, answered from the graph your
provenance + bi-temporal stamps team built — not transcripts
Why not just a vector store?
Every serious agent stack grows a memory layer, and the default answer
is prose in a vector store — embed the notes, recall by similarity. It
demos well and degrades from there: near-duplicates pile up, nothing in
the pile knows what anything means, no fact can say why it is
believed, and the more you store the worse retrieval gets. Memory that
has to compound for years cannot be a pile of prose. It has to be
structured.
Exocortex stores what your agents learn as a typed graph. Every captured
fact is a node with a type — a Problem, a Fix, a Solution — and every
connection is a typed, weighted edge that records who asserted it and when.
The catalogue of types, edges, and rules is called an ontology, and in
Exocortex it is ordinary Rust code: versioned, diffable, reviewed in a pull
request like anything else. Every read is a traversal with a microsecond
budget. That is the substrate context engineering actually needs: the
prompt gets assembled from what your org demonstrably knows — the fix, the
decision and its reason, the edge that says this solution solves that
problem — not from whatever a similarity search surfaced first.
Claude Code, Codex, Cursor — any MCP client writes to it and reads from
it, so what your org learns in one session is what it knows in the next.
Documents feed the same graph through
exocortex-adapter-mintlify,
the reference ingestion adapter: pages tagged with exocortex: frontmatter
land as identity-stable typed memories, deterministically, with no LLM
anywhere in the loop. Git history already ingests through the same seam
(exocortex-adapter-git: fix: commits become Fix memories, changed
paths become identity-stable FileContext nodes); issue trackers and
analytics tables follow the same contract.
Three hard properties
- Deterministic. No LLM runs inside Exocortex, ever — enforced by a
CI gate, not a promise. All intelligence stays in your agent;
Exocortex produces structured data, and the same input always yields
the same output.
- Fast. Reads are served from a local in-memory graph — measured
p50 of 29µs searching 100k memories, with the budget enforced in CI.
- Local-first. Without
--backend, nothing leaves your machine.
With one, the network carries only background sync and consolidation.
And one compounding one: the ontology is the asset. Every write is an
audited addition to it; every read draws from it; every consolidation
cycle refines it.
Quickstart (local MCP server)
1. Install
macOS (arm64/Intel) or Linux (x64):
curl -LsSf https://github.com/memory-graph/exocortex/releases/latest/download/install.sh | sh
Installs the exocortex entrypoint and its client/node/worker binaries into
~/.cargo. Linux x64 and Apple Silicon archives also include the verified
standalone Falkor runtime; macOS Intel supports client and team/backend modes
because upstream publishes no Intel embedded runtime. The bundled runtime
sets the standalone-mode floors: macOS 15+ (Apple Silicon) or glibc >= 2.38
(Linux x64); client and backend modes run on older systems. No Rust toolchain
or protoc is needed.
Client only from Cargo (any platform; needs Rust 1.85+ and protoc):
cargo install --git https://github.com/memory-graph/exocortex --bin exocortex-mcp-client
That command installs only exocortex-mcp-client; it does not install the
exocortex standalone wrapper or its Falkor runtime. For standalone from a
checkout:
git clone https://github.com/memory-graph/exocortex
cd exocortex
cargo build --release -p exocortex-client -p exocortex-server
EXOCORTEX_REDIS_SERVER=/path/to/redis-server \
EXOCORTEX_FALKORDB_MODULE=/path/to/falkordb.so \
scripts/exocortex --mode mcp-standalone --org my-org --user me
2. Register with your agent
The server speaks MCP over stdio. Add it to your agent's MCP config:
Claude Code
claude mcp add exocortex -- exocortex --mode mcp-standalone --org my-org --user me
Crush — add to ~/.config/crush/crushrc:
mcp add exocortex --type stdio \
--command ~/.cargo/bin/exocortex \
--args --mode --args mcp-standalone \
--args --org --args my-org --args --user --args me
and surface the instruction block in every session with
option global-context-path "$HOME/.config/crush/AGENTS.md"
(exocortex-mcp-client --install-block writes it, idempotently).
Codex / Cursor / any MCP client — point the stdio server config at
the binary:
{
"mcpServers": {
"exocortex": {
"command": "exocortex",
"args": ["--mode", "mcp-standalone", "--org", "my-org", "--user", "me"]
}
}
}
If you installed from a checkout, use the full path to scripts/exocortex
and configure the source-build Falkor runtime paths described above.
3. Tell your agent to use it
The client ships the instruction block — the load-bearing artifact
that rides in your agent's context on every turn:
exocortex-mcp-client --install-block CLAUDE.md # or AGENTS.md / .cursorrules — idempotent
exocortex-mcp-client --verify # green/red install checklist
The installer also drops a config skill at
~/.agents/skills/exocortex-config/ — the wiring, verify, and
dead-connection triage procedure for any harness (Crush auto-discovers
it; other harnesses can read it from there). It also ships in the repo
at .agents/skills/exocortex-config/SKILL.md.
On first run the client also installs the full Agent Playbook under the
OS data home; exocortex-mcp-client --verify prints its exact path. It
is the reference for the 58 assertable edge
kinds across the shipped packs (computed-only kinds like SimilarTo are
produced exclusively by Dreams and can never be written), the
reject-code table, and supersession rules. Harness-specific setup (what
"accepted edit" means, where the config lives, failure modes) is in
docs/agents/claude-code.md, docs/agents/codex.md, and
docs/agents/cursor.md.
The short version of what the block teaches: at end of every turn, run
a six-item checklist (accepted edit / non-obvious command / why-how
claim / decision-against / "remember this" / identified problem); if
anything fired, call exocortex.end_session with 1-5 typed drafts —
it validates locally and tells you exactly what to fix. Sessions now
compound: the backend groups every write in a conversation, near-
duplicates come back as supersession suggestions, and stale memories
are marked with their successors.
The Functions and Actions your agent gets
| Tool |
Kind |
What it does |
exocortex.search_memories |
Function |
Ranked free-text search over titles/tags of your org's graph; each hit carries the memory's full content and its type label. Superseded memories are marked with superseded_by and rank below their successors. |
exocortex.get_memory |
Function |
Fetch one memory by hex id — full content, type label, and superseded_by when superseded. |
exocortex.find_related |
Function |
Bounded k-hop neighborhood of a memory. |
exocortex.end_session |
Action |
Submit the wrapup (1-5 memory drafts, edges by draft_key or to_memory_id). Self-preflights locally with correction hints; the ack carries advisory similar_to near-duplicate suggestions. Offline, it buffers to a local WAL and syncs later. |
exocortex.preflight_wrapup |
Function |
Validate a proposed batch without writing — same rules end_session and the backend enforce, with an unverified list of server-only checks. |
exocortex.playbook_version |
Function |
The compiled playbook version + content hashes. |
exocortex.backend_status |
Function |
Client store health: mode (standalone/backend), the snapshot version in hand, and the last sync failure when reads are served from a frozen graph. While the backend stream is failing, every read also carries a sync: {degraded: true, last_error} object. |
The backend registry adds governance operations over authenticated
HTTP — exocortex.accept_discovery, exocortex.promote_visibility,
exocortex.retract_edge, exocortex.resolve_contradiction,
exocortex.preflight_batch (dry-run an adapter's Submit with zero
commit), exocortex.list_audit_records.
Flags
| Flag |
Default |
Meaning |
--org |
personal |
Your org id (personal use = any string). |
--user |
dev |
Your user id — drives Private-memory visibility. |
--backend |
none |
Client-only backend URL for shared-org mode (see below). Omitted on the raw client: writes buffer in the offline WAL until a backend is available. The installed personal entrypoint supplies its supervised loopback backend automatically. |
--data-dir |
OS data home |
Where the client offline WAL and playbook live. In mcp-standalone, --standalone-data-dir owns the durable Falkor graph across restarts. |
--dump-playbook |
— |
Print the compiled playbook and exit. |
--dump-block |
— |
Print the CLAUDE.md/AGENTS.md instruction block (version-marked) and exit. |
--install-block <file> |
— |
Install the instruction block into <file> in place — replaces the marked region, never duplicates on rerun. |
--verify |
— |
Green/red checklist of every client-checkable write precondition; exit code = red count. |
--tail-audit [--last N] |
5 |
Print the N most recent local writes (WAL), newest first. |
--export <file> |
— |
One-shot backup: dump every WAL entry (all states, LSN order) to a versioned, fingerprint-stamped JSON file. |
--import <file> |
— |
One-shot restore: import a backup into this data-dir's WAL — all-or-nothing, fingerprint-gated, idempotent (same ids upsert; Synced entries never re-drain). |
exocortex --mode mcp-standalone is the personal persistent topology: the
wrapper supervises one loopback FalkorDB process and one node, then connects
the foreground MCP client to that node for both writes and reads. It uses an
in-process coordinator—no gossip or cluster election. Dreams counters and fire
retries use the same supervised local Redis so acknowledged writes survive a
process restart; this is durable local transport, not an inter-node service.
The client WAL is a bounded offline buffer, not the standalone database.
A second concurrent session on the same data dir ATTACHES to the live
node (client mode, the owner's published endpoint, its own per-session
WAL slot) instead of starting a second store — concurrent harness
sessions share one graph safely.
If the MCP session dies: exocortex-cli
Every install ships exocortex-cli, the same graph from a shell —
search, get, related, chain, and add (one memory, --draft file.json, or a full wrapup with add --batch wrapup.json, the
end_session shape: several memories plus edges in one call). When
EXOCORTEX_BACKEND/EXOCORTEX_AUTH_TOKEN/EXOCORTEX_HMAC_KEY are
not in the environment (exactly the state a dead MCP session leaves),
the CLI auto-finds the live standalone node's credentials via the
attach record in the data home (--data-dir, else
EXOCORTEX_STANDALONE_DATA_HOME, else the platform default) — no
temp runtime.env hunting. Point an agent at
exocortex-cli --dump-block for the CLI-only instruction block.
exocortex-mcp-client --verify includes a row that actually runs a
read-only exocortex-cli search, so a broken fallback is visible
before it is needed.
The ontology