A hypothesis becomes a stated fact
Detect: Comparison finds uncertainty markers missing from the summary.
Recover: Restore the distinction and invalidate dependent conclusions.
Compress accumulated context into a versioned working summary that preserves commitments, evidence pointers, unresolved questions, and recovery-critical facts.
Context condensation reduces a long interaction or execution history into a smaller representation for subsequent model calls. It is a lossy transformation and should be treated like one. A useful summary distinguishes verified facts, user preferences, completed actions, unresolved assumptions, and next steps rather than blending everything into fluent narrative.
Keep authoritative records outside the summary. Transaction identifiers, exact amounts, approvals, and source documents should remain recoverable through structured state and evidence references. Condensation reduces prompt load; it does not replace durable persistence or establish that the summarized facts were correct.
A prototype can summarize old messages when a context threshold is reached. Compare later task performance against full-history runs before choosing a compression ratio.
Production uses a summary schema, protected fields, provenance references, and versioned compaction boundaries. Preserve recent turns and exact tool outcomes needed for the next action.
At scale, hierarchical summaries and retrieval can manage long cases, but repeated summary-of-summary passes amplify omissions. Periodically rebuild from authoritative artifacts and measure factual retention rather than summary readability alone.
Detects when prompt growth threatens reserved output or mandatory evidence capacity.
Produces a structured summary under task-specific preservation requirements.
Retains exact commitments, identifiers, approvals, and completed operations independently.
Maps summarized claims to original messages, documents, and tool artifacts.
Tests whether required facts and unresolved issues survive compression.
flowchart LR
H["Conversation and tool history"] --> B["Compaction boundary"]
B --> S["Structured summary"]
B --> P["Protected exact state"]
H --> E["Original evidence archive"]
S --> V["Retention validation"]
P --> V
V --> C["Next prompt assembly"]
E --> R["Targeted evidence retrieval"]
R --> C
N["Recent turns"] --> CIdentify stable older context that can be condensed while retaining recent active exchanges.
Preserve exact identifiers, constraints, commitments, and unresolved operations outside free-form prose.
Separate verified facts, assumptions, user preferences, completed work, and open questions.
Compare mandatory facts and evidence references against the source material before accepting the summary.
Combine the summary, protected state, relevant retrieved evidence, and recent turns within budget.
Version the compaction and rebuild from originals when repeated condensation degrades fidelity.
Enterprise support · Illustrative enterprise scenario, not a reported customer outcome.
A software vendor investigates an intermittent integration failure across many support exchanges and diagnostic sessions.
Appending every message makes prompts expensive and causes important customer constraints to disappear in a long context window.
The assistant must remember verified diagnostics, prohibited changes, and outstanding questions while preserving source evidence.
A structured summary holds the investigation state, and protected records retain ticket identifiers, tested versions, and approved maintenance windows.
If condensation omits a customer restriction, validation rejects the summary and retains the previous context representation.
Track retained critical facts, retrieval frequency after compaction, prompt size, and repeated troubleshooting steps to quantify whether compression helps the investigation.
| Decision | Benefit | Cost |
|---|---|---|
| Smaller prompts | Model calls use less context and may focus better. | Compression can remove qualifications that change interpretation. |
| Structured summaries | Important categories are easier to validate. | A rigid schema may miss unusual but relevant details. |
| Original evidence retention | Lost details remain recoverable. | Storage, access control, and retrieval infrastructure are still required. |
Detect: Comparison finds uncertainty markers missing from the summary.
Recover: Restore the distinction and invalidate dependent conclusions.
Detect: Retention tests fail on protected obligations.
Recover: Rebuild from source history and protected state.
Retain recoverable sources under an explicit policy.
Store exact values in typed state.
Evaluate downstream correctness and repeated-work rates.