Notes

Summarisation Memory

An agent's context window is a fixed-size desk, and a long run keeps piling paper onto it. Something has to go — and dropping the oldest pages loses the goal itself. Summarisation memory is the alternative: periodically replace a span of the run's history with a compact account of what it established, and carry the account forward instead of the transcript.

How it runs
The loop watches token usage against a threshold — say 70% of the window. When that trips, the runtime takes the oldest turns, sends them to a model with a summarising instruction, and swaps the block for the result. What stays verbatim is chosen deliberately: the original goal, the current plan, and the last few observations the next step depends on. The variant matters. A rolling summary is re-summarised each time, so it degrades like a photocopy of a photocopy; a hierarchical scheme keeps one summary per phase side by side, costing more tokens and losing less.

What it costs you
Summarisation is lossy, and lossy in the way you cannot predict: the detail dropped is whichever one turns out to matter. The classic symptom is an agent twenty steps in repeating a tool call it already made, because the summary recorded explored the configuration files and not the specific path that failed. Two mitigations work — keep the raw trace outside the window in a log or a vector memory store, so facts can be retrieved rather than remembered, and pin hard constraints as text the summariser may not touch.

Why it matters
It is what makes a run longer than the context window possible at all. Without it, long-running agents hit the wall and either error out or silently forget why they started.

Summarisation memory keeps an agent inside its context window by replacing older turns with a condensed account of what they established, while the goal, current plan and most recent observations stay verbatim. Triggered when token usage crosses a threshold, it allows runs far longer than the window itself. It is lossy by design: a detail left out of the summary is a detail the agent will act as though it never learned.

Picture taking notes in a very long meeting. You cannot write down every word, so every half hour you jot a few lines of what was agreed and turn the page. The decisions survive; the chatter does not.

Summarisation memory is an AI agent doing the same thing. It can only hold so much text in mind at once, so as a job drags on it compresses the early part into a short recap and carries on from that.

This is why an agent can stay on a task for hours instead of minutes. The risk is familiar too: whatever did not make it into the notes is simply gone, so the agent may cheerfully redo something it already tried and forgot about.