Architecture
codex-agent-mem stays intentionally narrow in the current release line:
- Codex emits
agent-turn-complete
codex-agent-mem-codex-notify normalizes the payload
- the event is persisted into local SQLite
- heuristics extract a
session_summary, zero or more decision observations, and operational-state observations
- the store derives objective, constraints, pending work, completed work, blockers, and completion claims from those observations
- a compact working-memory pack is compiled from recent turns, durable decisions, and operational state
- the generated pack carries a scope guard when open work remains
- if reinjection is enabled and that pack is smaller than the source context, the current directory
AGENTS.md is updated
- every sync or skip is recorded into context-sync metrics
- Codex or another client reads those observations and compact packs through MCP
- the local FastAPI inspector renders projects, sessions, turns, observations, operational state, and sync metrics from the same store
Design choices
- Local-first SQLite with FTS5
- Progressive disclosure retrieval
- AGENTS-based continuity reinjection only when compression is favorable
- Scope preservation beats “decision memory” alone
- False-completion guardrails are part of continuity, not optional UI sugar
- Deterministic persistence before any future semantic enrichment
- Runtime adapters kept thin
- No vendor dependency for correctness
Current retrieval surface
mem_search
mem_get
mem_recent
mem_project_brief
mem_context_pack
Deferred areas
- embeddings
- vector search
- App Server capture
- hooks capture
- Ollama adapter
- multi-agent federation