Rolling Summarization
Replace dropped conversation turns with a condensed summary that is updated each time the window slides. This maintains a coarse history without paying full token cost for every old turn.
How It Works
As the conversation grows beyond the working window, older turns are summarized into a running state block. The prompt sent to the model consists of: system prompt + rolling summary + recent raw turns.
What to Include in the Summary
- current goal
- files touched
- decisions made
- unresolved issues
- next steps
Trade-offs
- Pros: preserves more state than truncation alone; works well for medium-length sessions.
- Cons: summaries can omit nuance; quality depends on the summarization model or prompt.
See Also
- Sliding Window — rolling summarization is typically paired with a working window of recent raw turns.
- Compaction — summarization is the most common compaction strategy in production agents.
- Prompt Summarization — the same technique applied to non-conversation content.
Tools
- LangChain ConversationSummaryMemory — summarizes conversation history to keep context bounded.
- Aider — uses summarization to manage long conversation history in coding sessions.