/** * design/81 Slice 5 — the shared distance primitives for the consolidation `searchScored` retrieval, extracted * BYTE-IDENTICAL from the original PgMemoryStore implementation so the File (portable/TOC) and Pg (native/TOB) * backends rank on ONE source of truth and can't drift. The `{@link import("./runner/memory-consolidation.js")}` * band `{0.05, 0.3}` is defined on this cosine-distance scale; the lexical `1 - Jaccard ∈ [0,1] ⊂ [0,2]` is the * same-zero-point stand-in used when no embedding vector is present (fail-open per row). * * The capability LADDER a store reports via {@link import("./memory.js").MemoryStore.vectorMode}: * - `lexical` — no embedder: `1 - Jaccard(terms)` everywhere. * - `portable` — embedder + IN-PROCESS cosine over stored vectors (File jsonl / Pg jsonb / MySQL JSON — ANY * backend that can store a float array; O(n) over the scope, no index). * - `native` — embedder + a backend index/operator (pgvector `<=>` / TiDB `VEC_COSINE_DISTANCE`). * MySQL is NOT "can't support vectors" — it is `portable`-capable (JSON column + in-process cosine), just not * `native`. A deployment injects an embedder (config-driven); the store then reports the achieved rung. */ /** Lower-cased alphanumeric term set of a string (for the lexical stand-in distance). */ export declare function termSet(s: string): Set; /** Lexical stand-in distance: `1 - Jaccard(terms)` ∈ [0,1] ⊂ [0,2]; `null` = no overlap (not a candidate). */ export declare function jaccardDistance(query: Set, text: string): number | null; /** Cosine distance ∈ [0,2] (0 = identical), the {@link import("./memory.js").ScoredMemory} contract. Uses * `Math.min(a.length,b.length)` — a store MUST only call this on dimension-matched vectors (the row-level * dimension guard lives at the caller; a mismatch falls open to {@link jaccardDistance}). */ export declare function cosineDistance(a: number[], b: number[]): number; //# sourceMappingURL=memory-vector.d.ts.map