Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Perseus Vault Codex

Persistent, encrypted, local-first memory for OpenAI Codex agents.

Perseus Vault Codex — persistent encrypted memory for Codex

Codex never forgets. Perseus Vault gives your Codex agent persistent encrypted memory — so it remembers your project conventions, past decisions, and debugging context across every session.

CI  License: MIT  ·  Built for OpenAI Build Week — Developer Tools track


The problem

Every Codex session starts from zero. The agent re-learns your build commands, re-discovers your conventions, and re-derives the same architectural context you explained yesterday. Memory is the missing primitive for coding agents.

Existing memory stores don't fit a developer's machine: mem0 is cloud-dependent, cognee is Python-only with no encryption at rest, Letta manages memory but doesn't encrypt local storage, Chroma is a vector DB, not structured agent memory. None are single-binary, zero-infra, and encrypted.

The answer

perseus-vault-codex is a tiny MCP server that wraps Perseus Vault — a single 12 MB binary, fully local, AES-256-GCM encrypted at rest, with FTS5 keyword + hybrid recall and no API keys, no cloud, no telemetry. Install it and any Codex session gains five memory tools:

Tool What it does
perseus_remember Save a fact, decision, convention, or gotcha across sessions.
perseus_recall Retrieve relevant past context (FTS5 + hybrid ranking).
perseus_forget Remove a stale or wrong memory.
perseus_reflect Synthesize an insight from stored memories (RAG via your OpenAI/GPT-5.6 key).
perseus_status Store health: memory count, encryption state, DB location.

Install

# 1. Install the wrapper (zero Python dependencies)
git clone https://github.com/Perseus-Computing-LLC/perseus-vault-codex
cd perseus-vault-codex
pip install -e .

# 2. Install the Perseus Vault binary (single static binary, no deps) and put it on PATH
#    https://github.com/Perseus-Computing-LLC/perseus-vault/releases

# 3. Register it with Codex (non-destructive; backs up your config)
perseus-vault-codex-setup

Once published to PyPI, step 1 collapses to a single pip install perseus-vault-codex (steps 2–3 unchanged).

That's it. On first run the server auto-creates an encrypted vault at ~/.perseus-vault/codex/memory.db — no config required.

Configure in Codex

perseus-vault-codex-setup writes this into ~/.codex/config.toml:

[mcp_servers.perseus-vault]
command = "perseus-vault-codex"
args = []

Restart Codex (or start a new session) and the five perseus_* tools are available. To enable perseus_reflect synthesis, expose your OpenAI key:

[mcp_servers.perseus-vault.env]
OPENAI_API_KEY = "sk-..."
OPENAI_MODEL = "gpt-5.6"

See examples/codex_config.toml for every option.

Example usage

Inside a Codex session:

you> Set up the project. First, check what you already know.

codex> [calls perseus_recall {"query": "project build and test conventions"}]
       I recall from a previous session:
       - This project formats with `ruff format` and lints with `ruff check`.
       - We chose SQLite + FTS5 over Postgres for the local dev store.
       Running `ruff check` before I start...

you> We just decided to switch auth to short-lived JWTs with refresh tokens in Redis.

codex> [calls perseus_remember {"category": "decision", "key": "auth",
        "text": "Auth uses short-lived JWTs; refresh tokens live in Redis."}]
       Remembered. I'll apply that convention going forward — including in
       future sessions.

Tomorrow, in a brand-new session, perseus_recall "auth" returns that decision. The context survived.

Try the demo

PERSEUS_VAULT_BIN=/path/to/perseus-vault python scripts/demo.py

It simulates two separate Codex sessions: session 1 learns three project facts and tears the vault process down completely; session 2 — a fresh process — recalls them, reflects on them, and reports encrypted status. Sample output is in docs/.

Architecture

Codex (GPT-5.6)  ──MCP stdio──▶  perseus-vault-codex  ──MCP stdio──▶  perseus-vault binary
                    5 tools        (this package)        55+ tools      SQLite+FTS5, AES-256-GCM

Two hops on purpose: Perseus Vault exposes 55+ low-level memory tools; this package collapses them into five verbs a coding agent can reason about, and the binary does the encrypted storage and retrieval. Full write-up: docs/architecture.md.

Benchmarks

Measured against the real perseus-vault binary (v2.17.0), encrypted at rest — full methodology and reproducible harness in benchmarks/:

  • Recall is fast and accurate at scale. Seeding 10,000 developer memories, recall runs at p50 7 ms (p95 27 ms) with 5/5 recall@10 on distinctive needle memories (1,000-memory corpus: p50 1.3 ms). The recall hot path — what a Codex agent hits every task — stays in single/low-double-digit milliseconds.
  • The engine scales to 1,000,000 memories. A separate 2× H100 validation (run #619, results/scale_1m_2xh100.json) embedded ~1M memories (995,562 persisted, 0 errors) and hit hybrid recall@5 = recall@10 = 1.00 over 2,000 semantic queries, at sub-second latency (p50 479 ms). This is an engine-scale result on GPU, not the laptop path — reported separately and honestly (keyword-only recall is near-zero on that semantic workload; hybrid carries it).
  • Persistent memory cuts context tokens ~72%. Over a 30-session horizon, recalling the top-k relevant memories per task uses 110,493 fewer tokens (72.5% reduction) than re-priming each new session with the full project knowledge base — per-unit token costs measured with tiktoken against real vault recalls.

Every number is measured or explicitly labeled as a stated assumption; nothing is hardcoded. Reproduce with python benchmarks/bench_recall.py and python benchmarks/bench_token_savings.py.

How Codex was used

Codex was used during Build Week as an implementation and verification partner. In the final review session, it read the complete wrapper and its tests, ran the suite against the real perseus-vault 2.17.0 binary, exercised the two-session demo, and checked a unique marker was absent from the raw default database file. It also hardened stdout-EOF recovery in the subprocess client and added a regression test. Those are review-session contributions; this README does not attribute all pre-existing code to that session.

See SUBMISSION.md for the precise verification record and benchmark caveats.

Development

git clone https://github.com/Perseus-Computing-LLC/perseus-vault-codex
cd perseus-vault-codex
pip install -e ".[dev]"
pytest -q                                   # unit tests (no binary needed)
PERSEUS_VAULT_BIN=/path/to/perseus-vault pytest -q   # + integration tests

About

Built by Perseus Computing LLC. Perseus Vault is the only fully-local, encrypted memory store for AI agents, with existing integrations for Haystack, LangChain, LlamaIndex, CrewAI, Pydantic AI, and Google ADK. MIT licensed.

Metadata

Release files for perseus-vault-codex 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for perseus-vault-codex 0.1.0
File Size Uploaded Provenance
perseus_vault_codex-0.1.0.tar.gz 27.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for perseus-vault-codex 0.1.0
File Interpreter ABI Platform
perseus_vault_codex-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 49.2 kB

Release files / perseus_vault_codex-0.1.0.tar.gz

Download URL perseus_vault_codex-0.1.0.tar.gz
Size 27.5 kB
Tags Source
SHA-256 checksum
How to use checksums
eb716177995c724b95a577f21fb40eb6f45138065c1b84553186fc5edef76856
BLAKE2b-256 checksum
How to use checksums
cce699e758c83debfeea24b277e3d95adac99aed64aad2ef3c9db50f0a031715
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.9 {"installer":{"name":"uv","version":"0.11.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / perseus_vault_codex-0.1.0-py3-none-any.whl

Download URL perseus_vault_codex-0.1.0-py3-none-any.whl
Size 21.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ebd8cde4452cbbe98727857daff72972ac65c40888f1e952b3e6f03f1b6202c5
BLAKE2b-256 checksum
How to use checksums
98a2605a1488afed6265c9ca9fd16743cd53e30e3d98d62dcace6e1bd55e97da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.9 {"installer":{"name":"uv","version":"0.11.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for perseus-vault-codex 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page