Recency Reranker
RecencyReranker blends each search result's relevance score with an exponential decay on its age.
RecencyReranker blends each search result's relevance score with an exponential decay on its age, so newer documents rank higher when relevance is close. Pass it to the reranker parameter of Knowledge. See Boost Recent Documents.
from agno.knowledge.reranker.recency import RecencyReranker| Parameter | Type | Default | Description |
|---|---|---|---|
weight | float | 0.3 | Share of the score given to recency, from 0.0 to 1.0. 0.0 ranks by relevance alone and 1.0 by age alone. |
half_life_days | float | 30.0 | Age in days at which the recency term drops to half. Must be greater than 0. |
timestamp_key | str | "updated_at" | Metadata key read for each document's timestamp. Accepts an ISO 8601 string, a datetime, or epoch seconds or milliseconds. |
score_keys | Tuple[str, ...] | ("similarity_score", "search_score", "score") | Metadata keys tried, in order, for the search score. |
candidate_multiplier | int | 3 | Candidates Knowledge fetches per requested result. |
max_candidates | int | 100 | Ceiling on the candidate fetch. It never reduces the fetch below max_results. |
When timestamp_key is missing from a document's metadata, the reranker uses the _agno_updated_at value that PgVector adds when built with return_updated_at=True.