Skip to content

SummarizingConversationManager

Defined in: src/conversation-manager/summarizing-conversation-manager.ts:80

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 SummarizingConversationManager(config?): SummarizingConversationManager;

Defined in: src/conversation-manager/summarizing-conversation-manager.ts:88

ParameterType
config?SummarizingConversationManagerConfig

SummarizingConversationManager

ConversationManager.constructor

readonly name: "strands:summarizing-conversation-manager" = 'strands:summarizing-conversation-manager';

Defined in: src/conversation-manager/summarizing-conversation-manager.ts:81

A stable string identifier for this conversation manager.

ConversationManager.name

initAgent(agent): void;

Defined in: src/conversation-manager/conversation-manager.ts:100

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/summarizing-conversation-manager.ts:103

Reduce the conversation history by summarizing older messages.

ParameterTypeDescription
optionsConversationManagerReduceOptionsThe reduction options

Promise<boolean>

true if the history was reduced, false otherwise

ConversationManager.reduce