Class CombinedMemory

Class that manages and manipulates previous chat messages. It extends from the BaseChatMemory class and implements the CombinedMemoryInput interface.

Hierarchy

Implements

Constructors

Properties

aiPrefix: string = "AI"
humanPrefix: string = "Human"
memories: BaseMemory[] = []
memoryKey: string = "history"
returnMessages: boolean = false
inputKey?: string
outputKey?: string

Accessors

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

Methods

  • Checks if input keys are set for all memory objects. Logs a warning if any are missing.

    Returns void

  • Checks for repeated memory variables across all memory objects. Throws an error if any are found.

    Returns void

  • Clears all memory objects.

    Returns Promise<void>

    Promise that resolves when all memory objects have been cleared.

  • Loads memory variables from all memory objects.

    Parameters

    • inputValues: InputValues

      Input values to load memory variables from.

    Returns Promise<MemoryVariables>

    Promise that resolves with an object containing the loaded memory variables.

  • Saves the context to all memory objects.

    Parameters

    Returns Promise<void>

    Promise that resolves when the context has been saved to all memory objects.

Generated using TypeDoc