← Table of Contents · Page 220 of 868
COMPACTION AND SUMMARIZATION
Part 4 of 10
PRESERVING CRITICAL DETAILS
A bad summary is dangerous because it can quietly throw away something the agent needs later.
The most important skill in compaction is knowing what must survive.
Here is a checklist of items a good compaction summary should preserve.
The original goal and any constraints the user stated.
Decisions that have been made, along with the reasons, so the agent does not reopen settled questions.
Open problems, meaning issues not yet solved.
Key findings, meaning facts discovered that later steps depend on.
Dead ends, meaning approaches that were tried and failed, with the reason they failed, so the agent does not repeat them.
The current state, including what has been completed and what is in progress.
Identifiers and exact values that cannot be paraphrased, such as file paths, names, numbers, and error codes.
Things the user explicitly asked to remember or never forget.
What can be dropped?
Pleasantries, repeated explanations, raw tool output whose conclusions have already been extracted, intermediate drafts that were superseded, and chatter about plans that were later abandoned.
A strong technique is to give the summarizing model a structured template with headings such as Goal, Decisions, Findings, Dead Ends, Open Problems, and Next Step.
A template reduces the risk that the summary forgets a whole category.
Another strong technique is to ask the summarizer to list what it dropped, so a human or a later process can audit the choices.
You will see that idea in the first assistant prompt below.
Also consider keeping the originals.
Even when the window holds only the summary, the harness can save the full original messages to storage, so nothing is truly lost forever and a detail can be recovered if needed.
This leads directly into Chapter 22, where we study memory tiers.
A caution: summaries of summaries can slowly drift.
If you compact repeatedly, each round re-summarizes the previous summary, and small errors accumulate, like a rumor passed through many people.
To reduce this, keep decisions and key facts in a structured form that is carried forward exactly, rather than re-paraphrased each time, and consider re-summarizing from the saved originals instead of from the previous summary.
Advertisement
Read Aloud:
0:00 / 0:00