SummarizationConversationManager
Defined in: src/conversation-manager/summarization-conversation-manager.ts:78
Implements a summarization strategy for managing conversation history.
When a ContextWindowOverflowError occurs, this manager summarizes the oldest messages using a model call and replaces them with a single summary message, preserving context that would otherwise be lost.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SummarizationConversationManager(config): SummarizationConversationManager;Defined in: src/conversation-manager/summarization-conversation-manager.ts:86
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
config | SummarizationConversationManagerConfig |
Returns
Section titled “Returns”SummarizationConversationManager
Overrides
Section titled “Overrides”ConversationManager.constructor
Properties
Section titled “Properties”readonly name: "strands:summarization-conversation-manager" = 'strands:summarization-conversation-manager';Defined in: src/conversation-manager/summarization-conversation-manager.ts:79
A stable string identifier for this conversation manager.
Overrides
Section titled “Overrides”Methods
Section titled “Methods”initAgent()
Section titled “initAgent()”initAgent(agent): void;Defined in: src/conversation-manager/conversation-manager.ts:93
Initialize the conversation manager with the agent instance.
Registers overflow recovery: when a ContextWindowOverflowError occurs,
calls ConversationManager.reduce and retries the model call if reduction succeeded.
If reduce returns false, the error propagates out of the agent loop uncaught.
Subclasses that need proactive management MUST call super.initAgent(agent) to
preserve this overflow recovery behavior.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
agent | LocalAgent | The agent to register hooks with |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”reduce()
Section titled “reduce()”reduce(options): Promise<boolean>;Defined in: src/conversation-manager/summarization-conversation-manager.ts:101
Reduce the conversation history by summarizing older messages.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | ConversationManagerReduceOptions | The reduction options |
Returns
Section titled “Returns”Promise<boolean>
true if the history was reduced, false otherwise