Skip to the document
Madhuopen lab
Outcome School · Other AI topics16 min read

by Amit Shekhar · 21 July 2026

How does context compaction work?

How context compaction works in Large Language Models. We will also see why long conversations overflow the context window, how summarization shrinks the older messages without losing the important points, and where compaction is used in real AI agents.

3,009 words#llm#ai#system-design4 recall cards

How does context compaction work?
Read on Outcome School ↗then come back to lock it in
Before you read, guess

Why is it impossible to process infinite text?

Ten seconds, a guess, then read — a wrong guess still makes the answer stick.

Before you go

In one sentence, what was this chapter about?

From memory, without scrolling up. Writing it is what makes it yours; the grade is only to show you what you had.

How sure?