Production agent memory converges on a three-tier shape borrowed from both cognitive science and operating systems: a small working set, an episodic log of lived experience, and a semantic store of distilled knowledge — each with different write paths, and a consolidation process between them.
Working memory is the context window: fast, scarce, and forgotten by default. It holds the current goal, recent observations, and the scratchpad. Episodic memory is the append-only journal of what happened — runs, tool calls, outcomes — cheap to write, searchable later. Semantic memory is the distilled layer: facts, preferences, and procedures extracted from episodes ("this user prefers TypeScript," "deployments to staging fail without the secrets check"). The movement from bottom to top matters more than the tiers themselves: unconsolidated episodes pile up into noise nobody retrieves.
The consolidation step is where most home-grown memory systems quietly fail. Memory written without a promotion policy becomes an ever-growing bag of snippets; retrieval then surfaces stale, contradictory, or trivial facts that degrade — not improve — behavior. Systems like Letta (MemGPT), Zep, and LangGraph's memory stores all solve it the same way: an offline or periodic process deduplicates, resolves conflicts (last-write-wins with timestamps, or explicit supersession), scores importance, and lets trivial memories decay.
Design Rules That Survive Contact
- Write paths differ by tier: working memory is rewritten every turn, episodes append, semantics update on consolidation — conflating them produces a store that is simultaneously too slow and too lossy.
- Forgetting is a feature: TTLs, decay scores and hard caps keep the store retrievable; a memory system that only grows eventually retrieves nothing useful.
- Memories need provenance: every semantic fact links to the episode that produced it, so contradictions are auditable and corrections propagate.
- Consolidation is offline: never distill on the hot path; run it like a background compaction job.
The OS analogy is more than decoration — the pressure curves match. Context windows grow, but working sets that fit comfortably today will be overflowing the moment agents run for days. The three-tier shape is not a trend; it is what "virtual memory for cognition" converges to under the same constraints hardware memory did.