Context Compression
Domain: Memory & State
π― Motivation
When the conversation gets long, compress older messages into a summary to fit within the context window.
π Concrete Example
40 messages of conversation = 8000 tokens. Compress messages 1-30 into: βUser asked about Python loops, lists, and dictionaries. Understood all three.β Now 200 tokens. Recent messages 31-40 stay detailed.
π Analogy
Summarizing a long meeting - instead of reading 10 pages of notes, you write a 1-page summary. You keep recent details but compress old ones. Context compression does this for conversations.