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
ParameterTypeDefaultDescription
weightfloat0.3Share 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_daysfloat30.0Age in days at which the recency term drops to half. Must be greater than 0.
timestamp_keystr"updated_at"Metadata key read for each document's timestamp. Accepts an ISO 8601 string, a datetime, or epoch seconds or milliseconds.
score_keysTuple[str, ...]("similarity_score", "search_score", "score")Metadata keys tried, in order, for the search score.
candidate_multiplierint3Candidates Knowledge fetches per requested result.
max_candidatesint100Ceiling 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.