Rolling summary is intra-session compression that dies with the chat; persistent memory is a cross-session user-fact store that boots every new chat with relevant context.
Imagine a long phone call with a friend versus a friendship across many phone calls. During one call you sometimes recap what you were just talking about so the call stays coherent. That recap dies when you hang up. Across many calls, your friend remembers things about you: where you live, what you do, what coffee you drink. They bring that up in future calls. Those are two completely different kinds of memory. One is about not losing track inside a single conversation. The other is about being a continuing relationship. A chat product needs both, and they live in different places.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
"Memory" is one of those words that bundles several distinct primitives in a way that causes design problems. A real chat product has at least two of them, with different scopes, lifecycles, storage, and retrieval logic. The most common architectural mistake in 2026 agent products is treating them as one thing and stuffing them into the same slot.
This card walks through what each one actually is, why the frameworks of 2026 treat them as separate primitives, and what goes wrong when they get conflated.
Rolling summary: intra-session compression
Rolling summary exists to solve a specific problem: a conversation grows past the verbatim turn budget and you need to keep it coherent.
The pattern is straightforward. The most recent N turns stay verbatim (preserving pronouns, exact strings, current intent). Older turns get compressed into a running summary paragraph that occupies a fixed slot in the context. Periodically the summary is refreshed, usually every K turns, or whenever the verbatim slot would overflow.
Lifecycle. Born with the conversation. Refreshed during the conversation. Dies when the conversation ends. The summary state is part of the conversation state, not a global store.
Failure modes. Summary drift compounds when each refresh takes the previous summary as input instead of the original transcript. Periodic re-summarization from the raw transcript (or a windowed prefix of it) mitigates this. Summary noise is another failure: a too-aggressive compression loses pronoun referents or exact entity names that the model later needs.
Where it lives in the budget. A modest slot. For a 16k window, typically 800-1500 tokens. Its job is connective tissue, not main signal.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- ChatGPT's persistent memory feature shows users an editable list of facts the system has decided to remember across sessions; this is the canonical cross-session primitive.
- LangChain's ConversationSummaryBufferMemory implements rolling summary as a within-session primitive; LangChain's separate store integrations handle persistent memory.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow do you decide what gets written to persistent memory versus discarded?
Two policies: explicit ('the user said remember X') and extraction-based (a background LLM pipeline pulls candidate facts from past conversations and scores them for durability). Filter on relevance, recency, and user-confirmation signal.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Conflating the two as 'memory' and putting them in the same slot. They solve different problems, have different lifecycles, and need different storage and retrieval logic.
60 second bullets to scan on the way to the call.
Define rolling summary in one sentence
Define persistent memory in one sentence
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.