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) implements intelligent conversation context management by summarizing older messages instead of simply discarding them. This approach preserves important information while staying within context limits.
71
+
72
+
**Basic Usage:**
73
+
74
+
```python
75
+
from strands import Agent
76
+
from strands.agent.conversation_manager import SummarizingConversationManager
77
+
78
+
# Create the summarizing conversation manager with default settings
-**`summary_ratio`** (float, default: 0.3): Percentage of messages to summarize when reducing context (0.0 to 1.0)
154
+
-**`preserve_recent_messages`** (int, default: 10): Minimum number of recent messages to always keep
155
+
-**`summarization_agent`** (Agent, optional): Custom agent for generating summaries. If not provided, uses the main agent instance.
156
+
-**`summarization_system_prompt`** (str, optional): Custom system prompt for summarization. If not provided, uses a default prompt that creates structured bullet-point summaries focusing on key topics, tools used, and technical information in third-person format.
157
+
158
+
How it works:
159
+
160
+
1.**Proactive Management**: The `apply_management()` method can be extended for proactive context management
161
+
2.**Context Reduction**: When context limits are exceeded, `reduce_context()` generates summaries of older messages
0 commit comments