DictionaryMemory Strategies
Automatic Context Compaction
The AI service itself summarizes old parts of a long chat for you, so the conversation never runs out of room.
Definition
An API feature that summarizes earlier conversation history inside the request pipeline. Anthropic's server-side compaction runs in threshold mode (compact_20260112, beta compact-2026-01-12) when input tokens pass a trigger, or on demand (compaction: {type: "summarize"}, beta compact-2026-09-04) when the application asks. It replaces the SDK compaction_control helper, which is deprecated in the TypeScript and Ruby SDKs and removed in Python SDK v1.0.
Example
With the compact-2026-01-12 beta and a 150K trigger, the API swaps earlier turns for a summary block inside the same request.