Cross-platform persistent memory MCP for Codex, Gemini CLI, Claude Code, and other local MCP hosts. 36 cited neuroscience mechanisms, local-first SQLite/PostgreSQL, hybrid retrieval, decay-based consolidation, and reproducible benchmarks. Claude adds optional automatic lifecycle hooks.
$ npx -y skills add cdeust/Cortex --agent claude-code
Repo: cdeust/Cortex
What's inside
Sovereign is what it is today. Everything runs on your machine: a local SQLite file by default, or PostgreSQL + pgvector if you prefer. No LLM in the retrieval loop, and nothing leaves localhost unless you configure an integration that does. Your project's memory is a file you own and can delete.
Cross-platform is how it is built. One stdio MCP server and the same 57 tools on Claude Code, in the Claude Desktop bundle, under Claude Cowork, and on every local stdio MCP host listed in the table below. What differs per host is stated there, not discovered after install.
Eco-responsible is what we are aiming at. Work that never reaches a datacenter is work nobody has to power, and an agent that finds the right context first time re-reads fewer files. We hold that intent to the Green Software Foundation's SCI method, and we publish no CO₂ or energy figure, because we have not measured one. What we do and do not claim ↓
36 neuroscience mechanisms · 57 memory tools · 9 lifecycle hooks · a self-curating per-project wiki — all local, all open-source, MIT.
Claude Code — add the marketplace and install the plugin:
claude plugin marketplace add cdeust/Cortex
claude plugin install hypermnesia-mcp
Claude Desktop — download hypermnesia-mcp.mcpb from
Releases and open it, or use
Settings → Extensions. The bundle carries the tools but no hooks; the MCPB format has none.
Claude Cowork is detected automatically (CLAUDE_ENVIRONMENT=cowork) and uses the local
SQLite store. No PostgreSQL required.
Any other stdio MCP host (Codex, Gemini CLI, Cursor, Windsurf, VS Code) launches the same server and gets the same tools. The per-host matrix and launch commands are in Every other MCP host below. Codex has a native package: docs/codex-plugin.md. WSL, TLS client certificates and corporate proxies are covered in docs/deployment-scenarios.md.
The first use creates a local SQLite store under ~/.claude/methodology/. Models are downloaded
once when needed and then run offline. The embedding and reranking model files are both fetched
on first use. Optional integrations, remote PostgreSQL, and OTLP telemetry use the network only
when explicitly configured. PRIVACY.md lists the exact scope.
An existing PostgreSQL install is never silently downgraded: the installer detects a
configured DATABASE_URL, a prior backend marker, or a reachable local cortex database and
keeps it across updates.
The plugin was renamed hypermnesia-mcp in v4.15.0, after a community-directory collision
with an unrelated cortex plugin. Memories, configuration and storage paths are untouched.
claude plugin uninstall cortex
claude plugin install hypermnesia-mcp
The visualization companion, hypermnesia-mcp-viz, was renamed the same way:
claude plugin uninstall cortex-viz@cortex-plugins
claude plugin marketplace update cortex-plugins
claude plugin install hypermnesia-mcp-viz@cortex-plugins
The retained cortex-viz@cortex-plugins entry is a frozen shim that only prints this notice
and exposes no server or tools.
Allowlists, hooks, skills and agents must migrate both composed tool names:
mcp__plugin_cortex-viz_cortex-viz__open_visualization becomes
mcp__plugin_hypermnesia-mcp-viz_hypermnesia-mcp-viz__open_visualization, and
mcp__plugin_cortex-viz_cortex-viz__get_methodology_graph becomes
mcp__plugin_hypermnesia-mcp-viz_hypermnesia-mcp-viz__get_methodology_graph.
Across sessions, agents need to remember decisions, bring prior fixes back when a similar problem returns, and show you which sources support a memory so you can correct it. Cortex keeps that context available while making its status visible.
Cortex does this with local quality checks: what is written, whether its references resolve, what happens when a decision changes, and what can fade over time.
A write passes a local novelty check (the implementation calls it a predictive-coding gate) against what is already stored. Novel content is written; a near-duplicate is merged into the memory it restates rather than filed beside it.
// Illustrative project decision:
remember({ content: "Keep session state in Redis so TTL expiry is handled consistently." })
// → { stored: true, action: "stored" }
Deliberate writes are never rejected for being unsurprising. Unattended capture is, which is what keeps automatic capture from burying the memories you meant to keep.
Every memory is graded at write time, locally, with no network call. The grade is not a confidence score: it is whether the claims carry references that resolve on this machine.
// → provenance: { grade: "unverifiable",
// reason: "dead_refs: deps/numpy/_core/_multiarray_umath.cpython-313-darwin.so",
// hint: "1 of 9 checkable reference(s) could not be resolved" }
That memory named a file that no longer existed, so it was stored and labelled unverifiable
instead of being silently presented as verified. Rewritten against paths that resolve, the same
memory grades verified. A recalled memory tells you which kind it is; a verified grade still
means that the references resolve locally, not that the claim has been independently proven true.
Corrections supersede rather than overwrite. The new memory records what it replaces, the old one is demoted in recall, and the chain stays readable.
remember({ content: "...", supersedes_id: 4360411 })
// → { action: "superseded", memory_id: 4360412, superseded_id: 4360411 }
A memory records what happened. A prediction records what was expected before the outcome
was known, so that Cortex can later find out it was wrong. predict writes a falsifiable
claim with the confidence held at the time; resolve_prediction settles it against an
observation the caller supplies, naming the verdict, the kind of source that decided it and
a reference to that source; calibration scores the resolved set.
predict({ claim: "The p90 of the SQLite job is under 6 minutes",
prediction: "a 20-minute budget leaves headroom", test: "21 attempts of 2026-09-16",
confidence: 0.8 })
// → { prediction_id: 12, status: "open" }
resolve_prediction({ prediction_id: 12, verdict: "confirmed",
observed: "p90 348 s over 18 successes",
source_kind: "ci", source_ref: "cdeust/Cortex actions, 2026-09-16" })
// → { prediction_id: 12, verdict: "confirmed", resolved: true }
calibration()
// → { scored: 9, brier: 0.11, uninformative_brier: 0.25, confirmed: 7, refuted: 2,
// reliability: [{ band: [0.6, 0.8], resolved: 4, mean_confidence: 0.78,
// observed_frequency: 0.75 }, ...] }
brier is the mean squared distance between confidence and outcome; 0.25 is what a constant
0.5 forecast earns, so a score above it means the confidences carried less information than
saying nothing. Cortex never fetches the evidence itself: the verdict, the observation and
the source reference come from the caller, which is what lets the same contract hold in any
repository and under any review convention.
Memories carry heat that decays unless replay reinforces them, and episodic traces can consolidate into semantic ones. A specific debugging session may compress to the principle it taught; the commands can fade while the lesson survives. This lifecycle is designed to keep the store useful as it grows, though it is not a promise of a fixed size or guaranteed semantic compression.
Here is an illustrative workflow: decisions, prior fixes, and source checks becoming useful again.
Monday. An hour debugging a webhook handler ends in a race condition: TTL expiry firing between the auth check and the permission lookup. You agree on a fix, implement it, close the session.
Thursday. In another session, a user reports intermittent logouts. Cortex surfaces relevant prior analysis, the Redis decision, and the TTL lesson when their content matches the new work.
Three weeks later. The sessions can consolidate into a pattern about authentication and TTL-based caches; some details may fade while the principle remains useful.
In Claude Code that is automatic: nine lifecycle hooks inject context at session start, recall
per prompt, capture as you work, checkpoint before compaction, and run a per-project wiki that
curates itself. In any other stdio MCP host you call the same 57 tools yourself, or 60 when
the optional ai-architect-mcp-codebase and ai-architect-mcp-spec integrations are present.
Measured against a published benchmark, retrieval only. No LLM reader in the loop: the question is whether the right memory surfaces, not whether a model can write a good answer from it.
LongMemEval: 500 human-curated questions buried in about 40 sessions of history.
| v4.14.1 (historical) | v4.20.0 (current release) | |
|---|---|---|
| Recall@10 | 98.2% | 97.8% |
| MRR | 0.9167 | 0.905 |
Both are single runs: n=500, clean database, consolidation disabled, retrieval only.
v4.14.1, 2026-07-14: artifact JSON; code SHA. This is the run the ablation campaign in Verification was built around.
v4.20.0, 2026-09-09: artifact JSON and its
manifest; code SHA,
dirty=false. A single run of the LongMemEval-S leg alone (benchmarks/reproduce.sh --only longmemeval --no-ablation) in an isolated ephemeral PostgreSQL container, reranker loaded, consolidation
disabled. Against v4.14.1 the change is 0.4 points of Recall@10 and 0.012 of MRR. The run's own
floor check reports Recall@10 within the 0.005 tolerance of the July floor (0.982) and MRR
Showing a partial view of a very large repo.
FAQ
hypermnesia-mcp is a Claude Code plugin with 13 hand-picked skills for development work, indexed on Flowy. Install it with the command on its page. It includes cortex-automate, cortex-consolidate, cortex-debug-memory. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
Is this plugin yours?
Claim it with GitHubSubmit a pluginPromote it