Agno's Knowledge.search() now runs the reranker itself, in its own retrieval pipeline. It used to return whatever the vector database returned, so anything that reordered results had to be built into each adapter, and only some adapters had it.
Pass a reranker to Knowledge and every search goes through it:
from agno.knowledge.knowledge import Knowledge
from agno.knowledge.reranker import MMRReranker
knowledge = Knowledge(
vector_db=vector_db,
reranker=MMRReranker(candidate_multiplier=5, max_candidates=100),
)
results = knowledge.search("How do I rotate an API key?", max_results=5)
A reranker can only surface a document that the search retrieved in the first place. So the pipeline asks the vector database for more candidates than you requested: max_results times the reranker's candidate_multiplier, capped at max_candidates (100 by default). The reranker reorders that whole pool, and Knowledge returns the top max_results.
The pipeline ships with two new rerankers, MMRReranker for diverse results and RecencyReranker for fresh ones. Existing rerankers such as CohereReranker work on it too. Reranker.arerank now runs a synchronous reranker in a worker thread, so a reranker that calls a provider no longer blocks your event loop.
The vector database reranker is deprecated
Setting reranker on a vector database still works and now logs a deprecation warning. Move it to Knowledge(reranker=...), which applies to every vector database and supports async. If you set a reranker in both places, Agno applies the one on Knowledge and ignores the vector database's.
We also fixed several vector databases so rerankers get what they need. Cassandra, Chroma, Couchbase, Elasticsearch, OpenSearch, Pinecone and Upstash now attach their embedder to search results. Qdrant named-vector searches return a usable embedding, and PineconeDb takes return_vectors=True to include vectors in results.
See the cookbook, and learn more about reranking and search and retrieval in the documentation.
Frequently asked questions
Pass it to Knowledge, for example Knowledge(vector_db=..., reranker=MMRReranker()). Knowledge.search() then widens the fetch, reranks the candidates and returns the top results. The same reranker works with every vector database.
They set how many candidates the reranker sees. Agno asks the vector database for max_results times candidate_multiplier results, capped at max_candidates. Both are set on the reranker, and max_candidates defaults to 100.
Yes. Setting a reranker on a vector database still works and now logs a deprecation warning. The replacement is Knowledge(reranker=...), which works with every vector database, widens the candidate pool and supports async.
Agno applies only the reranker on Knowledge and ignores the one on the vector database, and it logs a warning that says which one to keep.


