Skip to content

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.

new SummarizationConversationManager(config): SummarizationConversationManager;

Defined in: src/conversation-manager/summarization-conversation-manager.ts:86

ParameterType
configSummarizationConversationManagerConfig

SummarizationConversationManager

ConversationManager.constructor

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.

ConversationManager.name

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.

ParameterTypeDescription
agentLocalAgentThe agent to register hooks with

void

ConversationManager.initAgent


reduce(options): Promise<boolean>;

Defined in: src/conversation-manager/summarization-conversation-manager.ts:101

Reduce the conversation history by summarizing older messages.

ParameterTypeDescription
optionsConversationManagerReduceOptionsThe reduction options

Promise<boolean>

true if the history was reduced, false otherwise

ConversationManager.reduce