/** * V1 Vector Store — SQLite-backed embedding storage and similarity search. * * Uses better-sqlite3 with embeddings stored as float32 BLOBs. Similarity * search is brute-force cosine similarity computed in JS — sufficient for * <100K embeddings (single-node agent memory). The interface is designed * for a drop-in upgrade to sqlite-vec or pgvector when needed. * * Spec: 21_TRI_MODAL_MEMORY.md §6 */ export interface EmbeddingRecord { id?: string; embedding: number[]; sourceUri: string; entityUri: string; contextGraphId: string; memoryLayer: 'wm' | 'swm' | 'vm'; model: string; snippet?: string; label?: string; createdAt?: string; } export interface VectorSearchOpts { contextGraphId: string; memoryLayers: Array<'wm' | 'swm' | 'vm'>; limit: number; minSimilarity?: number; } export interface VectorSearchResult { id: string; entityUri: string; sourceUri: string; similarity: number; label: string | null; snippet: string | null; memoryLayer: string; } export interface EmbeddingProvider { embed(text: string): Promise; readonly model: string; readonly dimensions: number; } export declare class VectorStore { private readonly db; constructor(dataDir: string); private migrate; insert(record: EmbeddingRecord): Promise; /** * Brute-force cosine similarity search. Loads all embeddings for the given * CG + layers, computes similarity in JS, returns top-K. Sufficient for * <100K embeddings; upgrade to sqlite-vec or pgvector for scale. */ search(queryEmbedding: number[], opts: VectorSearchOpts): Promise; delete(opts: { sourceUri?: string; entityUri?: string; }): Promise; count(contextGraphId?: string): Promise; close(): void; } /** * OpenAI-compatible embedding provider. */ export declare class OpenAIEmbeddingProvider implements EmbeddingProvider { readonly model: string; readonly dimensions: number; private readonly apiKey; private readonly baseURL; constructor(opts: { apiKey: string; model?: string; dimensions?: number; baseURL?: string; }); embed(text: string): Promise; } //# sourceMappingURL=vector-store.d.ts.map