Best AI Memory for Codex CLI (2026)
OpenAI's Codex CLI ships without a built-in project memory convention — no CLAUDE.md, no .cursorrules. Six ways to give Codex persistent memory, from improvised README sections to a one-config MCP layer.
The quick answer
For a persistent memory layer that drops into the Codex CLI in 60 seconds and writes a browsable wiki of what you've worked on: Ricord. If you already have an agent runtime and want memory baked into it: Letta. If you only use Codex in one repo and you're strict about README hygiene: aCONTEXT.md sectionin your project root. The decision matrix is below.
Why this matters for Codex specifically
Codex's shape is unusual. It runs in a sandbox, drives shell commands, and exits when the task is done. Unlike Claude Code or Cursor, there's no shipped convention for "here's the file Codex reads first to learn about my project." Some teams improvise — aCONTEXT.mdor AGENT.mdin the repo root, stuffed into the initial prompt. Others rely entirely on the shell history Codex sees and the inline reasoning it shows. Neither survives the next session well.
The fixes cluster into six approaches. They differ on six axes: install effort, project portability, auto-extraction, wiki browsability, conflict resolution, and how well they play with Codex's sandbox. The right answer depends on how heavily you use Codex day-to-day.
The decision matrix
Nine criteria, six options. Rows sorted by what Codex users hit first (install) through what bites later (cross-project portability, conflict resolution).
| Criterion | Ricord | Mem0 | Letta | Supermemory | CONTEXT.md | Shell history |
|---|---|---|---|---|---|---|
| MCP server install (one config block) | Limited | |||||
| Persists across Codex CLI sessions | Raw only | |||||
| Survives across separate projects/repos | Per-repo only | |||||
| Auto-extracts from Codex conversations | Manual | |||||
| Browsable wiki of what was learned | Markdown only | |||||
| Knowledge graph + backlinks | Pro only | |||||
| Conflict resolution (facts get superseded) | Basic | Manual edits | ||||
| Works inside Codex's sandbox | Sandbox-aware | |||||
| Cost (smallest tier with memory features) | $15/mo annual | $249/mo for graph | Self-host + LLM | $29/mo | $0 | $0 |
Slot-by-slot — which fits you
If you live in the Codex CLI daily across multiple projects
Ricord covers this. One install, every Codex session writes to the same memory + wiki, scoped per project automatically. The MCP-native install works across Codex, Claude Desktop, Claude Code, and Cursor, so the memory you build with Codex stays accessible from whichever client you happen to be in.
If you only use Codex inside one repo
A CONTEXT.md or AGENT.md filein the repo root is genuinely enough. Put the architectural decisions, the deploy commands, the customer constraints in there. Reference it explicitly when you start a Codex session ("read CONTEXT.md first"). The cost is keeping it updated by hand and remembering to commit it.
If you're building agent products on top of Codex / GPT-5
Lettaships an agent runtime with memory and state management built in. If Codex is one of several execution paths inside your own agent product, Letta's integrated model is cleaner than wiring memory as a separate microservice.
If you have engineering time and want to own retrieval
Mem0open-source is the right pick. Apache-licensed, vector-first, modifies cleanly. You'll spend a quarter getting it production-ready, but if retrieval is your competitive edge, owning the code is the right trade. When OSS wins →
If Codex is one of many AI surfaces you use
Supermemoryships Chrome and audio capture alongside its API. If Codex is your terminal slice and you're also doing browser research + meetings with other AI tools, Supermemory's multi-source capture captures more of your context.
If you're scrappy and you're fine with grep
Shell history($HISTFILE) plus a grep alias technically works. It's also the path that makes you swear out loud at 11pm when you can't find the deploy step you and Codex got right two weeks ago. Mentioned for completeness; do not recommend.
Why Ricord wins for most Codex users
Three reasons, in order of frequency from people who switched:
- No CONTEXT.md to maintain.Codex doesn't ship a memory convention; Ricord replaces the file you'd write yourself, with auto-extraction from your sessions instead of manual curation.
- The wiki view is browsable. Open the dashboard, read what Codex learned about each project across sessions. Not a search box on top of shell history — an actual document tree per entity.
- Cross-client memory. The same Ricord install covers Codex, Claude Code, Claude Desktop, and Cursor. Switch clients, the memory stays with you.
bun add -g ricord ricord login ricord install # auto-detects Codex, Claude Code, Claude Desktop, Cursor
Restart your shell. Start a Codex session. Ask it to remember something. Open the dashboard tomorrow — there it is, plus a wiki page for every entity you've discussed.
Getting started
Pick the option that matches your slot above. If it's Ricord, the three commands above get you running. If it's the CONTEXT.md path, just write the file and reference it. If it's OSS, fork Mem0 and wire it into your Codex prompt manually.
The signal that you picked right is whether you've stopped re-explaining the same project context to Codex after a week. If you haven't, your memory layer isn't doing its job.