export interface RecallWeights { readonly relevance?: number; readonly recency?: number; readonly confidence?: number; } export interface RecallRankingOptions { readonly weights?: RecallWeights; readonly recencyHalfLifeMs?: number; readonly candidatePool?: number; } export declare const DEFAULT_RECALL_WEIGHTS: { readonly relevance: 0.6; readonly recency: 0.3; readonly confidence: 0.1; }; export declare const DEFAULT_RECENCY_HALF_LIFE_MS: number; export declare const DEFAULT_CANDIDATE_POOL = 256; /** * BM25-smoothed inverse document frequency. Always positive — a token present * in every memory (df = corpusSize) still carries a small weight rather than * zeroing out or going negative (as unsmoothed idf would). */ export declare function idf(df: number, corpusSize: number): number; /** * Exponential recency decay in (0, 1]. age = referenceMs − updatedMs, clamped ≥ 0; * invalid/absent timestamps degrade to age 0 (decay 1). Non-positive/non-finite * halfLife falls back to the default. */ export declare function recencyDecay(updatedAt: string, referenceNow: string, halfLifeMs?: number): number; /** * Composite recall score: wRel·relevance + wRec·recency + wConf·confidence. * * relevance = Σ idf(matched query tokens) / Σ idf(all query tokens) — the * fraction of the query's information this memory matches (0..1). Query * tokens matching nothing inflate only the shared denominator, so relative * ordering is unaffected. * * recency = 2^(−age / halfLife), age measured from `referenceNow` back to * `updatedAt`, clamped ≥ 0. Invalid timestamps degrade to age 0. A * non-positive or non-finite halfLifeMs falls back to the default. * * `queryTokens` are expected to be deduplicated, as produced by `tokenize()`. */ export declare function scoreMemory(args: { readonly memoryTokens: ReadonlySet; readonly queryTokens: readonly string[]; readonly dfByToken: ReadonlyMap; readonly corpusSize: number; readonly updatedAt: string; readonly confidence: number; readonly referenceNow: string; readonly options?: RecallRankingOptions; }): number; //# sourceMappingURL=score.d.ts.map