/** * Local SQLite-backed vector store. * Replaces ChromaDB (JS client only supports HTTP servers, not local embedded). * Stores embeddings as JSON blobs, performs cosine similarity in JS. * * API surface mirrors Python ChromaDB PersistentClient to keep the rest * of the codebase consistent with the plan. */ import type { IEmbeddingFunction } from './embeddings.js'; export interface VectorRecord { id: string; document: string; metadata: Record; embedding: number[]; } export interface SearchResult { id: string; document: string; metadata: Record; distance: number; } export declare class VectorCollection { private db; private embedFn; private name; private constructor(); /** Create or open a collection backed by a SQLite file at dbPath. */ static open(dbPath: string, name: string, embedFn: IEmbeddingFunction): VectorCollection; private init; /** Check if an id already exists. */ has(id: string): boolean; /** Add a document. Does nothing if id already exists (explicit dedup gate). */ add(params: { id: string; document: string; metadata: Record; }): Promise; count(): number; /** Get records by ids or all records if no ids specified. */ get(params?: { ids?: string[]; where?: Record; limit?: number; }): { ids: string[]; documents: string[]; metadatas: Record[]; }; /** * Semantic search — cosine similarity between query embedding and all stored vectors. * Returns top nResults sorted by ascending distance (0 = identical, 1 = opposite). */ query(params: { queryTexts: string[]; nResults: number; where?: Record; include?: string[]; }): Promise<{ ids: string[][]; documents: string[][]; metadatas: Record[][]; distances: number[][]; }>; } //# sourceMappingURL=vector-store.d.ts.map