causal-memory

Apache-2.0 · Rust + SQLite · MCP

Agent memory with a causal core.
The only one that models inhibition.

Facts, temporal state, and decision → outcome causal edges on one SQLite store. Agents recall what happened, when it was true, why it worked — and what would happen if they acted differently.

30s demo — the agent is about to `git push --no-verify`; intervention_query fires a DANGER chain

Memory that compaction cannot touch

Causal information is the most fragile type under text compaction. In a real-LLM benchmark with a production compaction prompt, textual recall collapses — while the causal table, living outside the context window, never degrades.

Compactions (k)Textual recallCausal-table recall
1100%100%
285%100%
355%100%
545%100%

What makes it different

Capabilities no fact store can offer — verified by 322 workspace tests.

Capabilitycausal-memorymem0ZepLetta
Typed causal semantics (caused/enabled/prevented)
prevented negative spread (inhibitory)
Forward simulation (intervention_query)
SWR offline consolidation (LTP/LTD/GC)
Q-value dynamic utility
Immutable consolidation (delta + clone)
Meta-edge cross-session pattern mining
Compaction survival evidence
One graph unifying all memory types
Local ONNX embedding (offline)

Measured on what matters

CausalEval — the graph-grounded causal memory benchmark. The causal graph is the answer key.

Capabilitycausal-memorymem0What it tests
C7 Update100%80%Supersede old belief after falsification
C3 Counterfactual95%80%Choosing between alternatives with known outcomes
C2 Intervention75%40%Forward prediction: "if X again, what happens?"
C4 Inhibition80%50%Root-cause fix vs blast-radius limiter
C1 Attribution85%90%Backward causal chain → root cause
C5 Temporal-causal90%90%Ordering on a causal chain
Overall78%65%CausalEval v13 · 140 questions, 20 graphs

Full benchmark report →

Three steps to memory that survives

step 1

Install

pip install causal-memory

or cargo build --release from source

step 2

Wire MCP

{ "mcpServers": { "causal-memory":
  { "command": "causal-memory" } } }

Claude Code, Cursor, Kimi Code CLI, …

step 3

Add the skill

npx skills add JingxuanC/causal-memory@causal-memory

teaches the agent when to remember

Read the full guide →