Codex Memory: Mem0 vs MemoryRouter After a Topic Change
You open Codex to fix a login bug. An hour later, you switch to the billing migration. Yesterday's billing decision is stored in memory, but the lookup that started this session was about login.
That is a useful test when comparing Mem0 with MemoryRouter. Both have automatic Codex hooks. They do not run automatic recall on the same schedule.
Mem0 has a full Codex plugin, not just an MCP server
Mem0's current Codex integration guide, checked November 5, 2026, documents a plugin with lifecycle hooks and a local background capture worker. Its full installation captures user prompts, assistant responses, useful tool outcomes, and sub-agent findings. Calling it a manual-only memory integration would be wrong.
The guide distinguishes that plugin from an MCP-only installation, which supplies memory tools without the automatic hooks. This comparison is about the full local plugin, not that smaller configuration or a Codex Cloud session.
For automatic recall, the documented trigger is the first prompt of a session, with a default minimum of 20 characters. The plugin retrieves context relevant to that opening request. Later in the session, Codex can use the search_memories tool for another lookup.
That is also what the current hook implementation does: its first-prompt check skips automatic recall on subsequent prompts, while continuing to record them. The tools remain available.
MemoryRouter searches again when the question changes
The MemoryRouter Codex hooks run recall before each prompt. The query follows what you are asking now, rather than being limited to the request that opened the session.
| Behavior | Mem0 full Codex plugin | MemoryRouter Codex hooks |
|---|---|---|
| Automatic recall | First prompt, with a default 20-character minimum | Before each prompt |
| A later topic needs another lookup | Codex can call search_memories |
The next prompt triggers another recall |
| Automatic capture | Prompts, responses, useful tool outcomes, sub-agent findings | User prompt and final assistant answer for completed turns |
The billing question triggers fresh recall without requiring a reminder to search. If that lookup misses, verify that the decision is searchable in the connected vault. Then inspect the returned context; a hook running does not prove it found the record.
Decide what belongs in the record too
Mem0's broader capture can matter if the finding you need exists only in a tool result or a sub-agent's work. Its documentation says captured prompts and responses retain their full redacted text. That broader record is useful when the final answer leaves out an intermediate finding.
MemoryRouter's Codex capture is narrower. It stores the user's message and the completed assistant answer, not raw tool traces or reasoning blocks. If a debugging result never reaches that final answer, do not assume the automatic record contains it.
So the choice is not simply which plugin saves more. For my workflow, I want a clean conversational record searched against each new request. If your priority is preserving useful intermediate tool findings, include that requirement in the evaluation rather than testing only a preference written in plain chat.
Neither setup turns stored memory into a mandatory coding instruction. Keep non-negotiable repository rules in AGENTS.md.
Test the second subject, not just the second session
Use a synthetic decision and evaluate one integration at a time:
- In a setup session, establish that the demo project Breakwater keeps invoice identifiers as strings to preserve leading zeroes. Confirm the decision is searchable in that integration's memory before continuing.
- Start a fresh Codex session in the same repository with an unrelated task, such as explaining a login test. Keeping the repository fixed avoids changing Mem0's search scope. Leave the invoice decision out of this conversation.
- In the same session, ask: "What did we decide about invoice identifiers in Breakwater, and why?"
- With Mem0, compare the answer before and after explicitly asking Codex to use
search_memories. If the explicit lookup finds the decision, storage worked; the opening automatic lookup was not a search for this later subject.
For either integration, inspect returned or injected memory where the client exposes it. A correct-sounding answer alone does not establish that retrieval ran.
The Codex integration page documents its connection and optional automatic hooks.