feat(memory): Add opt-in temporal decay for hybrid search scoring

Exponential decay (half-life configurable, default 30 days) applied
before MMR re-ranking. Dated daily files (memory/YYYY-MM-DD.md) use
filename date; evergreen files (MEMORY.md, topic files) are not
decayed; other sources fall back to file mtime.

Config: memorySearch.query.hybrid.temporalDecay.{enabled, halfLifeDays}
Default: disabled (backwards compatible, opt-in).
This commit is contained in:
Rodrigo Uroz
2026-02-10 08:42:22 -03:00
committed by Peter Steinberger
parent fa9420069a
commit 6b3e0710f4
13 changed files with 1372 additions and 35 deletions

View File

@@ -334,6 +334,20 @@ export type MemorySearchConfig = {
textWeight?: number;
/** Multiplier for candidate pool size (default: 4). */
candidateMultiplier?: number;
/** Optional MMR re-ranking for result diversity. */
mmr?: {
/** Enable MMR re-ranking (default: false). */
enabled?: boolean;
/** Lambda: 0 = max diversity, 1 = max relevance (default: 0.7). */
lambda?: number;
};
/** Optional temporal decay to boost recency in hybrid scoring. */
temporalDecay?: {
/** Enable temporal decay (default: false). */
enabled?: boolean;
/** Half-life in days for exponential decay (default: 30). */
halfLifeDays?: number;
};
};
};
/** Index cache behavior. */