Class VectorStoreAbstract

Abstract class representing a store of vectors. Provides methods for adding vectors and documents, deleting from the store, and searching the 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

    • 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.

Generated using TypeDoc