import type { IndexFlatL2 } from "faiss-node"; import type { NameRegistry, Parser } from "pickleparser"; import { Embeddings } from "../embeddings/base.js"; import { SaveableVectorStore } from "./base.js"; import { Document } from "../document.js"; import { SynchronousInMemoryDocstore } from "../stores/doc/in_memory.js"; export interface FaissLibArgs { docstore?: SynchronousInMemoryDocstore; index?: IndexFlatL2; mapping?: Record; } export declare class FaissStore extends SaveableVectorStore { _index?: IndexFlatL2; _mapping: Record; docstore: SynchronousInMemoryDocstore; args: FaissLibArgs; _vectorstoreType(): string; constructor(embeddings: Embeddings, args: FaissLibArgs); addDocuments(documents: Document[]): Promise; get index(): IndexFlatL2; private set index(value); addVectors(vectors: number[][], documents: Document[]): Promise; similaritySearchVectorWithScore(query: number[], k: number): Promise<[Document>, number][]>; save(directory: string): Promise; static load(directory: string, embeddings: Embeddings): Promise; static loadFromPython(directory: string, embeddings: Embeddings): Promise; static fromTexts(texts: string[], metadatas: object[] | object, embeddings: Embeddings, dbConfig?: { docstore?: SynchronousInMemoryDocstore; }): Promise; static fromDocuments(docs: Document[], embeddings: Embeddings, dbConfig?: { docstore?: SynchronousInMemoryDocstore; }): Promise; static importFaiss(): Promise<{ IndexFlatL2: typeof IndexFlatL2; }>; static importPickleparser(): Promise<{ Parser: typeof Parser; NameRegistry: typeof NameRegistry; }>; }