---
id: "action-compress-context-iteratively"
type: "action-item"
source_timestamps: ["00:14:02", "00:14:25"]
tags: ["context-management", "llm-optimization"]
related: ["concept-anchored-iterative-summarization", "claim-factory-compression-superiority"]
speakers: ["Nate B. Jones"]
action: "Implement Anchored Iterative Summarization to merge truncated context into a persistent, structured summary document."
outcome: "Prevents the agent from forgetting original intent and architectural decisions over long time horizons."
sources: ["s41-nvidia-open-sourced"]
sourceVaultSlug: "s41-nvidia-open-sourced"
originDay: 41
---
# Use Anchored Iterative Summarization for long agent sessions

## Action

**Implement [[concept-anchored-iterative-summarization]] to merge truncated context into a persistent, structured summary document.**

## Why

Native compression methods both fail in characteristic ways (see [[claim-factory-compression-superiority]]):
- [[entity-openai-d41]]'s compact endpoint is a black box.
- [[entity-anthropic-d41]]'s Claude SDK approach degrades via the telephone-game effect.

## Concrete Recipe

1. **Create a structured summary document** with explicit sections:
   - `session_intent` — original goal, never overwritten
   - `decisions` — architectural commitments, append-only
   - `files_modified` — running ledger
   - `next_steps` — forward plan, regenerated each cycle
2. **Set a context-window threshold** (e.g., 70% capacity).
3. **On threshold:**
   - Take the *new* span of conversation since the last compression
   - Summarize that span
   - **Merge** the new summary into the appropriate sections of the persistent document — do not replace, do not regenerate from scratch
4. **Drop raw history**; carry forward only the structured document + recent turns.
5. **Repeat** for each subsequent threshold hit.

## Why It Beats the Alternatives

- The `session_intent` section is **immutable** — it survives every compression cycle.
- `decisions` is **append-only** — past architectural commitments cannot drift.
- The merge step is **explicit and auditable** — unlike the OpenAI black box.

## Prerequisites

- [[prereq-context-window-mechanics]]

## See Also

- [[concept-anchored-iterative-summarization]]
- [[claim-factory-compression-superiority]]
- [[entity-factory-ai-d41]]
