Last updated: 2026-03-13
This file is the design log and decision index for codex-mem.
It is no longer the primary place for the formal v1 specification. The normative spec now lives under docs/spec/.
- Codex is being used through a relay/proxy endpoint.
- The relay does not support the compaction interface.
- When context fills up, sessions must be restarted.
- Restarting a session causes continuity loss unless prior work is recovered externally.
codex-mem is intended to be an external memory and handoff system for Codex relay environments.
It is designed to:
- preserve continuity across restarted sessions
- store structured high-value memory
- recover recent context through bootstrap
- isolate memory by scope
- allow controlled related-project retrieval
It is not intended to:
- replace compaction inside a single live session
- behave as a global undifferentiated memory pool
- depend on full passive transcript capture for v1
We chose to define a language-neutral v1 standard before binding to any implementation language or code structure.
The core scope hierarchy is:
systemprojectworkspacesession
Default retrieval is project-scoped. Cross-project retrieval is controlled and never the default.
The primary durable memory forms are:
MemoryNoteHandoff
These are preferred over raw transcript storage.
Session recovery is centered on:
- explicit handoff capture before pause/end
- explicit high-value note capture during work
- session bootstrap at the start of a new session
AGENTS.md is used for stable rules such as:
- when to bootstrap
- when to save notes
- when to write handoff
It is not used as the primary store for dynamic session state.
The design assumes:
- local-first durable memory
- private/do-not-store content must remain excluded
- unrelated project memory must not appear in default retrieval
The system should explain:
- what was stored
- why it was retrieved
- why something was excluded
- where memory came from
without leaking sensitive content.
The formal codex-mem v1 specification is split into these files:
- Spec Index
- Glossary
- Domain Model
- State Model
- Tool Contracts
- Retrieval Policy
- Privacy and Retention
- AGENTS Policy
- Configuration and Precedence
- Identity and Consistency
- Observability and Provenance
- V1 Baseline
AGENTS templates are stored here:
Implementation planning reference:
These items were identified as useful additions, but they do not block the v1 spec:
- canonical warning/error code taxonomy
- example request/response payloads
- onboarding flow examples
- migration examples for rename/move/split/merge
- conformance scenario matrix
Use docs/spec/ as the normative reference and treat this file as the high-level design log.