liveBook · Manning

Summarization

As explained in Context Engineering

The production of a shorter representation of information while retaining selected content.

Summarization uses a model to condense interaction history, tool outputs, or completed phases into a shorter representation for an agent’s context window. A useful summary preserves task intent, decisions, artifacts, current state, open issues, and next steps while replacing less useful detail. section 7.4.2 section 5.2.2

Memory compression can maintain summaries in several forms:

  • Rolling summaries update after every few turns. section 5.2.2
  • Hierarchical summaries keep detailed recent summaries alongside high-level historical digests. section 5.2.2
  • Hybrid summaries combine prose with structured key-value attributes. section 5.2.2

For long sessions, anchored iterative summarization summarizes only the newly removed span and merges it into the existing summary. This can reduce drift compared with regenerating the whole summary at each compression event. Compression is also useful after a token-heavy search, after a research phase, or before an agent handoff. section 7.4.2

Summarization rewrites content; trimming removes it without rewriting. Observation masking replaces a bulky tool result in the active prompt with a concise summary and a storage pointer, so the full result can be recovered. Recent observations, unresolved errors, and evidence needed for active reasoning should remain unmasked. section 7.4.2

Compaction in a coding agent

When a conversation approaches its context limit, a harness can invoke a secondary model pass to summarize modified files, command outcomes, and architectural decisions. It discards lengthy command logs while retaining the high-level task goals. section 5.2.2

Successive summaries can introduce distortions that compound as earlier summaries become input to later ones. Treat summaries as editable artifacts, validate them against user actions, and periodically re-anchor the model with recent verbatim context. section 5.2.2

How Context Engineering covers it

How deep it goes
Describes summary formats, incremental updates, compression boundaries, and drift mitigation without specifying an implementation.
Examples
Uses coding-agent compaction to illustrate summarizing modified files, command outcomes, and architectural decisions.
What you can do after
Evaluate how to preserve task-critical state and limit drift when compressing agent context.
How it connects
Connects memory compression with context management, trimming, observation masking, and context writing.

Also explained in

Compare how 17 books explain summarization →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Context Engineering. The section links point to the parts of the book it draws on.