Hierarchical memory allocates different retention and compression policies to different kinds of conversation context. Critical facts remain structured, older history becomes a rolling summary, and recent exchanges stay verbatim, preserving fidelity where it matters while controlling context-window cost. section 4.7.4 section 4.8
A three-tier design separates durable facts from narrative context and current conversational detail:
- Model-managed memories store critical facts as structured key-value records, such as allergies, preferences, or named providers. section 4.7.4
- A rolling summary compresses older conversation into a compact narrative covering the situation, attempted actions, and concerns. section 4.7.4
- Recent messages remain verbatim so follow-up questions retain the nuance and flow of the active topic. section 4.7.4
The hierarchy addresses limitations of simple truncation, which preserves recency but can discard important early information. It can also coexist with retrieval-augmented memory, where prior conversations become searchable through a Data Service. Context assembly should account for attention patterns that favor information near the beginning and end of the input. section 4.8 section 4.7.4
Figure 4.9 Hierarchical memory combines three tiers of context. Model-managed memories store critical facts as structured key-value pairs. A rolling summary compresses older conversation history into a compact narrative. Recent messages remain verbatim to preserve nuance in the current exchange.

Use the three-tier diagram to compare structured facts, rolling summaries, and verbatim recent messages. section 4.7.4
