Rerankers
Concept
Section titled “Concept”A reranker takes the top-k nodes returned by an initial retriever (usually a dense vector search, keyword search, or a hybrid of the two) and re-orders them based on a stronger, and typically slower, measure of query-document relevance. Reranking is one of the highest-leverage knobs in a RAG pipeline: initial retrievers are tuned for recall over a large corpus, and a reranker lets you recover precision before nodes reach the LLM.
In LlamaIndex, rerankers are implemented as node postprocessors that run between retrieval and response synthesis.
Usage pattern
Section titled “Usage pattern”from llama_index.core.postprocessor import SentenceTransformerRerank
reranker = SentenceTransformerRerank( model="cross-encoder/ms-marco-MiniLM-L6-v2", top_n=3)
query_engine = index.as_query_engine( similarity_top_k=10, node_postprocessors=[reranker],)response = query_engine.query("What did the author do in college?")The retriever fetches a wider set (similarity_top_k=10) and the reranker prunes it down to the best top_n=3 before the LLM sees them.
Choosing a reranker
Section titled “Choosing a reranker”- No API key, local, strong quality:
SentenceTransformerRerankis the recommended default. Pair with a modern cross-encoder likeQwen/Qwen3-Reranker-0.6B(stronger, multilingual) orcross-encoder/ms-marco-MiniLM-L6-v2(smaller, faster). Browse more models on the Sentence Transformers cross-encoder list and the MTEB leaderboard. - Hosted API, minimal setup:
CohereRerank,JinaRerank,VoyageAIRerank,MixedbreadAIRerank. Good options when you’d rather not run inference yourself. - Highest quality, latency is not critical:
LLMRerank,RankGPTRerank,RankLLMRerank. These use an LLM itself to judge relevance. - Multimodal late interaction (documents as images):
ColPaliRerank. - Text late interaction:
ColbertRerank. Useful when the query and document contain narrow technical terms.
For the full reference including every integration and every model, see the Node Postprocessors guide. Rerankers are one category of node postprocessors.
Further reading
Section titled “Further reading”- Node Postprocessors guide: every supported reranker with code examples.
- Sentence Transformers cross-encoder documentation: speed/accuracy tradeoffs for open-source models.
- Advanced retrieval: how reranking fits into a broader retrieval strategy.