Hierarchical summarization stacks coarser summaries over finer ones so detail decays with distance, while a single flat summary is forced to smear all of history into one budget.
Picture how you remember your week. Yesterday you can recall hour by hour. Three days ago you remember the highlights of each day. A month ago you remember the week as a sentence. A year ago, just a season. Your memory is layered: fresh stuff is detailed, old stuff is summarized, and very old stuff is summarized again on top of that. A long-running agent works the same way. The most recent few steps stay verbatim. A bit older, the steps get grouped into mini-summaries. Older still, those mini-summaries get grouped into bigger summaries. The agent sees a stack that tapers from sharp to fuzzy, instead of one flat block trying to hold everything at once.
Detailed answer & concept explanation~5 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
Define hierarchical summarization. Explain the failure mode of a flat summary as history grows. Walk through the level by level budget shape. Show how each roll-up has its own cadence. Name the production wins: predictable cost, recovery, eval stability. Close with the LangGraph or Anthropic agent pattern that operationalizes it.
Real products, models, and research that use this idea.
- LangGraph state can hold multiple memory channels with different roll-up reducers per channel, which operationalizes hierarchical summarization.
- Claude Opus 4.7 agent runs over very long contexts in 2026 typically pair recent-turn verbatim with two roll-up tiers.
- Letta (formerly MemGPT) implements a recall-tier plus archival-tier split, which is the same idea with two levels.
- Devin-style coding agents that run for hours use a level-1 task log and a level-2 session digest.
- Mem0 separates short-term turn buffer from long-term extracted facts, conceptually a two-tier hierarchy.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow do you pick the roll-up cadence between levels?
QWhat is the error-compounding risk across levels, and how do you bound it?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Treating a single growing summary as a budget-bounded solution. As the trajectory grows, the summarizer is forced to compress more into the same space and quietly drops the early specifics.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.