Class VectorStoreRetrieverMemory

Class for managing long-term memory in Large Language Model (LLM) applications. It provides a way to persist and retrieve relevant documents from a vector store database, which can be useful for maintaining conversation history or other types of memory in an LLM application.

Hierarchy

Implements

Constructors

Properties

memoryKey: string
returnDocs: boolean
vectorStoreRetriever: VectorStoreRetriever<VectorStore>
inputKey?: string

Accessors

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

Methods

  • Method to load memory variables. It uses the vectorStoreRetriever to get relevant documents based on the query obtained from the input values.

    Parameters

    Returns Promise<MemoryVariables>

    A Promise that resolves to a MemoryVariables object.

  • Method to save context. It constructs a document from the input and output values (excluding the memory key) and adds it to the vector store database using the vectorStoreRetriever.

    Parameters

    Returns Promise<void>

    A Promise that resolves to void.

Generated using TypeDoc