Skip to content

sessions / Exports / ConversationHistory

Class: ConversationHistory

Multi-session conversation history manager

Manages multiple conversation sessions identified by conversation IDs. Provides session isolation and resource management.

Table of contents

Constructors

Methods

Constructors

constructor

new ConversationHistory(options?): ConversationHistory

Parameters

NameType
options?ConversationHistoryOptions

Returns

ConversationHistory

Defined in

agents/dist/node/index.d.ts:542

Methods

getConversationSession

getConversationSession(conversationId): ConversationSession

Get or create a conversation session

Parameters

NameTypeDescription
conversationIdstringUnique conversation identifier

Returns

ConversationSession

ConversationSession instance

Defined in

agents/dist/node/index.d.ts:549


hasConversation

hasConversation(conversationId): boolean

Check if a conversation exists

Parameters

NameTypeDescription
conversationIdstringConversation identifier to check

Returns

boolean

True if conversation exists

Defined in

agents/dist/node/index.d.ts:556


removeConversation

removeConversation(conversationId): boolean

Remove a specific conversation

Parameters

NameTypeDescription
conversationIdstringConversation identifier to remove

Returns

boolean

True if conversation was removed, false if not found

Defined in

agents/dist/node/index.d.ts:563


clearAll

clearAll(): void

Clear all conversations

Returns

void

Defined in

agents/dist/node/index.d.ts:567


getStats

getStats(): Object

Get conversation statistics

Returns

Object

Statistics about managed conversations

NameType
totalConversationsnumber
conversationIdsstring[]
totalMessagesnumber

Defined in

agents/dist/node/index.d.ts:573

Released under the MIT License.