agent memory architectures
Agent memory architectures give a stateless model the appearance of remembering across a long task or many sessions. The context window is fast but tiny and forgetful — once a conversation scrolls past it, it is gone. Memory architectures add stores outside the window, so an agent can recall what it did yesterday, what the user prefers, and the facts it has gathered, much as a person uses working memory plus notebooks and habits.
A common design separates short-term memory (the current context and a running scratchpad) from long-term memory, which is often split into episodic memory (a log of past interactions and outcomes), semantic memory (distilled facts and knowledge), and procedural memory (learned routines or tool skills). Long-term items are typically embedded and stored in a vector database; at each step the agent retrieves the most relevant entries and inserts them into the prompt, then writes new observations and summaries back. The hard parts are what to write, when to compress or forget, and how to retrieve so the right memory surfaces at the right moment.
Retrieval-based memory scales to far more history than any context window, but it is lossy and only as good as its writing and retrieval policy: a relevant memory that is never retrieved is effectively forgotten, and stale or wrong memories can mislead later steps. Growing context lengths reduce the need for external memory for short horizons but do not remove it for persistent, multi-session agents.
A memory store is only useful if its retrieval policy surfaces the right entry at the right step — an unretrieved memory is functionally forgotten.