Skip to content

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.

PresetPythonTypeScript
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.

Pass preset name strings in the strategiesstrategies array:

from strands import Agent
agent = Agent(
context_manager={
"strategies": [
"proactive_summarization",
"large_tool_offloading",
],
},
)

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 Agent
from strands.experimental.context_manager import Offload
agent = Agent(
context_manager={
"strategies": [
"large_tool_offloading",
Offload.summarize("*").when(
utilization=0.9,
preserve_recent=2,
),
],
},
)

The preset handles large tool results eagerly, and the custom summarization strategy compresses remaining content at 90% utilization.