You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Overflow Trimming**: In the case of a context window overflow, it will trim the oldest messages from history until the request fits in the models context window.
67
+
68
+
#### SummarizingConversationManager
69
+
70
+
The [`SummarizingConversationManager`](../../../api-reference/agent.md#strands.agent.conversation_manager.summarizing_conversation_manager.SummarizingConversationManager) extends the sliding window approach with optional summarization of older messages. Instead of simply discarding old context, it can summarize older messages to preserve important information while staying within context limits.
71
+
72
+
```python
73
+
from strands import Agent
74
+
from strands.agent.conversation_manager import SummarizingConversationManager
75
+
from strands.models import AnthropicModel
76
+
77
+
# Create a model for generating summaries
78
+
summarizing_model = AnthropicModel(
79
+
model_id="claude-opus-4-20250514",
80
+
max_tokens=500, # Maximum tokens the model can generate in response
81
+
params={
82
+
"temperature": 0.3# Lower temperature for more consistent summaries
0 commit comments