Abstract class that provides a base for implementing different types of memory systems. It is designed to maintain the state of an application, specifically the history of a conversation. This class is typically extended by other classes to create specific types of memory systems.

Hierarchy (view full)

Constructors

Properties

chatHistory: BaseChatMessageHistory
inputKey?: string
outputKey?: string
returnMessages: boolean

Accessors

  • get memoryKeys(): string[]
  • Returns string[]

Methods

  • Method to clear the chat history.

    Returns Promise<void>

    Promise that resolves when the chat history has been cleared.

  • Abstract method that should take an object of input values and return a Promise that resolves with an object of memory variables. The implementation of this method should load the memory variables from the provided input values.

    Parameters

    Returns Promise<MemoryVariables>

    Promise that resolves with an object of memory variables.

  • Method to add user and AI messages to the chat history in sequence.

    Parameters

    Returns Promise<void>

    Promise that resolves when the context has been saved.