Context Management · Compaction
Compaction Server-side context compaction for managing long conversations that approaching context window limits 1 Server-side compaction is the recommended strategy for managing context in long-running conversations and agentic workflows. It handles context management automatically, without client-side summarization code. as a conversation grows, response quality degrades,Compaction extends the effective context length for long-running conversations and tasks compaction replaces older content with a concise summary. This is ideal for: Chat-based, multi-turn conversations where you want users to use one chat for a long period of time Task-oriented prompts that require a lot of follow-up work (often tool use) that might exceed the context window How compaction works four steps: ...