/** * SqlJsRvfBackend - Built-in RVF persistence using sql.js (WASM SQLite) * * Provides zero-dependency vector storage in .rvf files when the native * @aigentic/rvf SDK is not installed. Uses sql.js (always available as a * hard dependency) for SQLite persistence and SIMD-accelerated brute-force * search from src/simd/simd-vector-ops.ts. * * When @aigentic/rvf is installed, the factory auto-selects the native * RvfBackend instead for HNSW-indexed search. * * Design: * - Reports name='rvf' for compatibility with existing backend checks * - Vectors stored as raw Float32Array bytes in BLOB columns * - In-memory cache for brute-force search via SIMD ops * - Pending write queue with flushSync() before search * - save() → db.export() → write Uint8Array to .rvf file * - load() → read file → new SQL.Database(buffer) → rebuild cache */ import type { VectorBackendAsync, VectorConfig, SearchResult, SearchOptions, VectorStats } from '../VectorBackend.js'; /** * SqlJsRvfBackend - VectorBackend + VectorBackendAsync using sql.js WASM */ export declare class SqlJsRvfBackend implements VectorBackendAsync { readonly name: "rvf"; private db; private dim; private metricType; private initialized; private storagePath; private cache; private pending; private batchThreshold; constructor(config: VectorConfig); /** * Initialize the sql.js database and create schema. */ initialize(): Promise; insert(id: string, embedding: Float32Array, metadata?: Record): void; insertBatch(items: Array<{ id: string; embedding: Float32Array; metadata?: Record; }>): void; search(query: Float32Array, k: number, options?: SearchOptions): SearchResult[]; remove(id: string): boolean; getStats(): VectorStats; save(savePath: string): Promise; load(loadPath: string): Promise; close(): void; insertAsync(id: string, embedding: Float32Array, metadata?: Record): Promise; insertBatchAsync(items: Array<{ id: string; embedding: Float32Array; metadata?: Record; }>): Promise; searchAsync(query: Float32Array, k: number, options?: SearchOptions): Promise; removeAsync(id: string): Promise; getStatsAsync(): Promise; flush(): Promise; /** * Expose the raw sql.js Database instance for unified single-file mode. * AgentDB uses this to load relational schemas into the same database. */ getDatabase(): any; getStoragePath(): string; isInitialized(): boolean; private createSchema; private rebuildCache; private writeVector; private flushSync; private bruteForceSearch; private computeScore; private matchesFilter; private ensureInitialized; } //# sourceMappingURL=SqlJsRvfBackend.d.ts.map