/** * Unified Store - Abstract interface over SQLite and Postgres backends * * Provides a consistent interface that works with both: * - SQLite EmbeddedStore (local development) * - PostgreSQL PostgresEmbeddedStore (hosted deployments) * * Also provides unified vector store access: * - LanceDB VectorStore (local development) * - pgvector PostgresVectorStore (hosted deployments) */ import { VectorSearchResult, VectorSearchFilter, VectorSearchOptions, EmbeddingRecord, VectorStoreStats } from './postgres-vector-store.js'; /** * Unified key-value store interface */ export interface IKeyValueStore { initialize(): Promise; get(namespace: string, key: string): Promise | T | null; set(namespace: string, key: string, value: T): Promise | void; delete(namespace: string, key: string): Promise | boolean; has(namespace: string, key: string): Promise | boolean; keys(namespace: string): Promise | string[]; getAll(namespace: string): Promise> | Map; clear(namespace: string): Promise | void; count(namespace: string): Promise | number; close(): Promise; } /** * Unified vector store interface */ export interface IVectorStore { initialize(): Promise; add(record: EmbeddingRecord): Promise; addBatch(records: EmbeddingRecord[]): Promise; search(vector: number[] | Float32Array, options?: VectorSearchOptions): Promise; searchFiltered(vector: number[] | Float32Array, filter: VectorSearchFilter, options?: VectorSearchOptions): Promise; get(id: string): Promise; delete(id: string): Promise; deleteByFilter(filter: VectorSearchFilter): Promise; getStats(): Promise; close(): Promise; } /** * Unified store combining key-value and vector stores */ export interface UnifiedStore { keyValue: IKeyValueStore; vector: IVectorStore | null; backend: 'sqlite' | 'postgres'; close(): Promise; } /** * Create and initialize a unified store based on environment configuration */ export declare function createUnifiedStore(): Promise; /** * Get or create the global unified store */ export declare function getUnifiedStore(): Promise; /** * Close the global unified store */ export declare function closeUnifiedStore(): Promise; //# sourceMappingURL=unified-store.d.ts.map