rankResults
rankResults(
results,weights?,halfLifeDays?,now?):SemanticSearchResult[]
Defined in: packages/memory-ltm/src/rank.ts:61
Re-rank semantic search results using a blended similarity + recency +
importance score. The returned array is a new array; input is not mutated.
The score on each result is replaced with the blended value.
Ordering is deterministic: ties are broken by ascending memory id so that equal-scoring results produce a stable, reproducible sequence.
Parameters
Section titled “Parameters”results
Section titled “results”Raw hits from the vector store (any order).
weights?
Section titled “weights?”RankingWeights = DEFAULT_RANKING_WEIGHTS
Relative weights (need not sum to 1; they are normalised).
halfLifeDays?
Section titled “halfLifeDays?”number = 30
Recency half-life in calendar days (default 30).
Date = ...
Reference time for age calculation (default: Date.now()).