agents / 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
| Name | Type |
|---|---|
options | ConversationHistoryOptions |
Returns
Defined in
packages/agents/src/managers/conversation-history-manager.ts:861
Methods
getConversationSession
▸ getConversationSession(conversationId): ConversationSession
Get or create a conversation session
Parameters
| Name | Type | Description |
|---|---|---|
conversationId | string | Unique conversation identifier |
Returns
ConversationSession instance
Defined in
packages/agents/src/managers/conversation-history-manager.ts:873
hasConversation
▸ hasConversation(conversationId): boolean
Check if a conversation exists
Parameters
| Name | Type | Description |
|---|---|---|
conversationId | string | Conversation identifier to check |
Returns
boolean
True if conversation exists
Defined in
packages/agents/src/managers/conversation-history-manager.ts:898
removeConversation
▸ removeConversation(conversationId): boolean
Remove a specific conversation
Parameters
| Name | Type | Description |
|---|---|---|
conversationId | string | Conversation identifier to remove |
Returns
boolean
True if conversation was removed, false if not found
Defined in
packages/agents/src/managers/conversation-history-manager.ts:908
clearAll
▸ clearAll(): void
Clear all conversations
Returns
void
Defined in
packages/agents/src/managers/conversation-history-manager.ts:919
getStats
▸ getStats(): Object
Get conversation statistics
Returns
Object
Statistics about managed conversations
| Name | Type |
|---|---|
totalConversations | number |
conversationIds | string[] |
totalMessages | number |
Defined in
packages/agents/src/managers/conversation-history-manager.ts:930