import { TurboVector, TurboEntry, InfiniteMemoryStats } from '../types.js'; /** * TurboQuant compressor — PolarQuant + QJL pipeline for 6x vector compression. * * PolarQuant: Convert Cartesian vector → polar coordinates (radius + angles). * Quantize angles to 2 bits each using fixed circular grid. * Recursive: [x,y,z...] → [r, θ₁, θ₂, ...] → pack angles as 2-bit codes. * * QJL (Quantized Johnson-Lindenstrauss): * Apply deterministic random rotation matrix → take sign of each dim → 1 bit/dim. * Unbiased estimator for dot products via popcount. * * Combined: 3 bits/dim total vs 16-bit float = 6x compression. * Zero accuracy loss on retrieval benchmarks. */ export declare class TurboMemory { private memoryStore; private indexCache; private hotCache; private maxHotCache; private storeDir; constructor(customDir?: string); /** Convert Cartesian vector to polar coordinates (radius + angles) */ private cartesianToPolar; /** Quantize a single angle to 2 bits (4 possible values on circular grid) */ private quantizeAngle2Bit; /** Pack 2-bit values into Uint8Array (4 values per byte) */ private pack2Bit; /** Unpack 2-bit values from Uint8Array */ private unpack2Bit; /** Generate deterministic random rotation matrix (seeded) */ private generateRotationMatrix; /** Seeded PRNG (xorshift32) */ private createSeededRNG; /** Apply QJL: rotate then take sign → 1 bit per dimension */ private applyQJL; /** Compress a high-dimensional vector using TurboQuant pipeline */ compress(vector: number[]): TurboVector; /** Approximate reconstruction from compressed vector */ decompress(tv: TurboVector): number[]; /** Fast similarity via popcount on QJL 1-bit vectors */ private qjlSimilarity; /** Population count (number of set bits) */ private popcount; /** Store a vector with metadata — infinite retention */ store(key: string, vector: number[], metadata?: Record): Promise; /** Search for top-K most similar vectors */ search(query: number[], topK?: number): Promise; /** Get memory statistics */ stats(): InfiniteMemoryStats; private estimateMemoryUsage; private persistChunk; private saveIndex; private loadFromDisk; } //# sourceMappingURL=turbo-memory.d.ts.map