tasq/node_modules/@claude-flow/memory/dist/rvf-backend.d.ts

51 lines
1.9 KiB
TypeScript

import type { IMemoryBackend, MemoryEntry, MemoryEntryUpdate, MemoryQuery, SearchOptions, SearchResult, BackendStats, HealthCheckResult } from './types.js';
export interface RvfBackendConfig {
databasePath: string;
dimensions?: number;
metric?: 'cosine' | 'euclidean' | 'dot';
quantization?: 'fp32' | 'fp16' | 'int8';
hnswM?: number;
hnswEfConstruction?: number;
maxElements?: number;
verbose?: boolean;
defaultNamespace?: string;
autoPersistInterval?: number;
}
export declare class RvfBackend implements IMemoryBackend {
private entries;
private keyIndex;
private hnswIndex;
private nativeDb;
private config;
private initialized;
private dirty;
private persisting;
private persistTimer;
private queryTimes;
private searchTimes;
constructor(config: RvfBackendConfig);
initialize(): Promise<void>;
shutdown(): Promise<void>;
store(entry: MemoryEntry): Promise<void>;
get(id: string): Promise<MemoryEntry | null>;
getByKey(namespace: string, key: string): Promise<MemoryEntry | null>;
update(id: string, updateData: MemoryEntryUpdate): Promise<MemoryEntry | null>;
delete(id: string): Promise<boolean>;
query(q: MemoryQuery): Promise<MemoryEntry[]>;
search(embedding: Float32Array, options: SearchOptions): Promise<SearchResult[]>;
bulkInsert(entries: MemoryEntry[]): Promise<void>;
bulkDelete(ids: string[]): Promise<number>;
count(namespace?: string): Promise<number>;
listNamespaces(): Promise<string[]>;
clearNamespace(namespace: string): Promise<number>;
getStats(): Promise<BackendStats>;
healthCheck(): Promise<HealthCheckResult>;
private tryNativeInit;
private compositeKey;
private bruteForceSearch;
private recordTiming;
private avg;
private loadFromDisk;
private persistToDisk;
}
//# sourceMappingURL=rvf-backend.d.ts.map