Class SaveableVectorStoreAbstract

Abstract class extending VectorStore with functionality for saving and loading the vector store.

Hierarchy

Constructors

Properties

FilterType: string | object
embeddings: Embeddings

Methods

  • Parameters

    • documents: Document<Record<string, any>>[]
    • Optional options: AddDocumentOptions

    Returns Promise<void | string[]>

  • Parameters

    • vectors: number[][]
    • documents: Document<Record<string, any>>[]
    • Optional options: AddDocumentOptions

    Returns Promise<void | string[]>

  • Parameters

    • Optional _params: Record<string, any>

    Returns Promise<void>

  • Parameters

    • directory: string

    Returns Promise<void>

  • Parameters

    • query: string
    • k: number = 4
    • filter: undefined | string | object = undefined
    • _callbacks: undefined | Callbacks = undefined

    Returns Promise<Document<Record<string, any>>[]>

  • Parameters

    • query: number[]
    • k: number
    • Optional filter: string | object

    Returns Promise<[Document<Record<string, any>>, number][]>

  • Parameters

    • query: string
    • k: number = 4
    • filter: undefined | string | object = undefined
    • _callbacks: undefined | Callbacks = undefined

    Returns Promise<[Document<Record<string, any>>, number][]>

  • Return documents selected using the maximal marginal relevance. Maximal marginal relevance optimizes for similarity to the query AND diversity among selected documents.

    Parameters

    Returns Promise<Document<Record<string, any>>[]>

    • List of documents selected by maximal marginal relevance.
  • Parameters

    • _texts: string[]
    • _metadatas: object | object[]
    • _embeddings: Embeddings
    • _dbConfig: Record<string, any>

    Returns Promise<VectorStore>

Generated using TypeDoc