Foundations

Memory That Persists: How Agents Remember Across Sessions

Agent decidesWrite to storeLater sessionreads

Context is only what the model can see this turn, and it has no memory beyond that by default. This raises an obvious question: if a session ends, or gets summarized away to save space, is everything genuinely lost? For a well-designed agentic system, the answer is no — but only because memory is handled as a deliberately separate mechanism from context, not as a side effect of a long enough conversation.

Memory is a different axis from context

It helps to be precise about what persistent memory solves, because it's easy to conflate with context isolation — the two look superficially similar but address different problems. Isolation is about siblings not seeing each other's mess within a single session: a reviewer and a drafter working at the same time, kept apart so one doesn't contaminate the other. Memory is about a session recalling its own past across time: writing key facts, decisions, and outcomes to durable storage outside the conversation window, so a future session — hours, days, or weeks later — can recall history that would otherwise be lost the moment the original conversation is summarized or discarded.

How it works in practice

The mechanism is simple to describe: an agent session reaches some decision or outcome worth remembering, writes that fact to a durable store outside the conversation, and a later session reads from that store before or during its own reasoning — effectively recalling prior history that never had to survive inside any single context window. This loop — decide, write, recall — is what lets an agent behave as though it has a memory that spans sessions.

Three things persistent memory actually buys you

First, it survives context resets: because the memory lives outside the conversation window entirely, it's immune to truncation, summarization, or the conversation simply ending. Second, it enables reflection: a system that recorded "we decided X because of Y" can later compare that original decision against what actually happened — the foundation of any learning-from-outcomes loop. Third, it protects key facts from lossy compression: important details that would otherwise be at risk of being summarized away are instead pinned somewhere summarization never touches.

The practical design challenge is deciding what belongs in that durable store and what doesn't. Not everything worth saying in a conversation is worth remembering forever — a system that writes every detail to persistent memory quickly accumulates noise just as hard to search through as an overlong context window would have been. The useful discipline is to write facts, decisions, and outcomes rather than raw conversational transcript: the conclusion an agent reached, the reasoning that mattered, and — crucially — what actually happened afterward, so the next session inherits judgment rather than just data.

Questions to bring to your team

  • What's one piece of context you wish an assistant would just remember about your work?
  • What would you never want an agent to retain?

Also available in Čeština

← What Is "Context" in an AI Agent — and Why Does It Run Out? Three Ways an Agent Reaches Beyond Itself: Tools, MCP, and A2A →