Strategy Presets
Named strategy presets are shorthand for preconfigured
Offload strategies. Pass a preset name string in the
strategies array instead of building the strategy by hand.
Preset expansions are internal defaults and may change
between releases as tuning improves. The preset name is
the stable contract. Use raw Offload.* strategies when
you need a pinned configuration.
Available presets
Section titled “Available presets”| Preset | Python | TypeScript |
|---|---|---|
| Proactive summarization | "proactive_summarization" | "proactiveSummarization" |
| Large tool offloading | "large_tool_offloading" | "largeToolOffloading" |
| Overflow protection | "overflow_protection" | "overflowProtection" |
| Stale tool cleanup | "stale_tool_cleanup" | "staleToolCleanup" |
Proactive summarization summarizes the oldest 30% of messages when the context window reaches 70% capacity.
Large tool offloading truncates individual tool results over 2,500 tokens to a 1,000-token preview, eagerly on message arrival.
Overflow protection truncates the oldest messages when the context window is full, keeping the 4 most recent.
Stale tool cleanup drops tool results more than 5 messages old.
Using presets
Section titled “Using presets”Pass preset name strings in the
strategiesstrategies
from strands import Agent
agent = Agent( context_manager={ "strategies": [ "proactive_summarization", "large_tool_offloading", ], },)import { Agent } from '@strands-agents/sdk'
const agent = new Agent({ contextManager: { strategies: [ 'proactiveSummarization', 'largeToolOffloading', ], },})Mixing presets and custom strategies
Section titled “Mixing presets and custom strategies”Combine named presets with raw Offload strategies in
the same array. Order matters: strategies run as a
pipeline, and each sees the output of the previous.
from strands import Agentfrom strands.experimental.context_manager import Offload
agent = Agent( context_manager={ "strategies": [ "large_tool_offloading", Offload.summarize("*").when( utilization=0.9, preserve_recent=2, ), ], },)import { Agent } from '@strands-agents/sdk'import { Offload } from '@strands-agents/sdk/experimental'
const agent = new Agent({ contextManager: { strategies: [ 'largeToolOffloading', Offload.summarize('*').when({ utilization: 0.9, preserveRecent: 2, }), ], },})The preset handles large tool results eagerly, and the custom summarization strategy compresses remaining content at 90% utilization.