interface VectorStoreInterface {
    FilterType: string | object;
    embeddings: EmbeddingsInterface;
    addDocuments(documents: DocumentInterface<Record<string, any>>[], options?: AddDocumentOptions): Promise<void | string[]>;
    addVectors(vectors: number[][], documents: DocumentInterface<Record<string, any>>[], options?: AddDocumentOptions): Promise<void | string[]>;
    asRetriever(kOrFields?: number | Partial<VectorStoreRetrieverInput<VectorStoreInterface>>, filter?: string | object, callbacks?: Callbacks, tags?: string[], metadata?: Record<string, unknown>, verbose?: boolean): VectorStoreRetriever<VectorStoreInterface>;
    delete(_params?: Record<string, any>): Promise<void>;
    similaritySearch(query: string, k?: number, filter?: string | object, callbacks?: Callbacks): Promise<DocumentInterface<Record<string, any>>[]>;
    similaritySearchVectorWithScore(query: number[], k: number, filter?: string | object): Promise<[DocumentInterface<Record<string, any>>, number][]>;
    similaritySearchWithScore(query: string, k?: number, filter?: string | object, callbacks?: Callbacks): Promise<[DocumentInterface<Record<string, any>>, number][]>;
    toJSON(): Serialized;
    toJSONNotImplemented(): SerializedNotImplemented;
    maxMarginalRelevanceSearch?(query: string, options: MaxMarginalRelevanceSearchOptions<string | object>, callbacks: undefined | Callbacks): Promise<DocumentInterface<Record<string, any>>[]>;
}

Hierarchy (view full)

Implemented by

Properties

FilterType: string | object

Methods

  • 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<DocumentInterface<Record<string, any>>[]>

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