What are rerankers?
- Combine results from multiple search strategies (hybrid search)
- Reduce redundancy by diversifying results
- Optimize the relevance-diversity trade-off
- Improve the overall user experience of your search application
When to use rerankers?
- Merge multiple search methods: Combine vector search with BM25 keyword search, or merge results from multiple vector searches
- Diversify results: Eliminate near-duplicate content and show varied perspectives
- Optimize ranking: Fine-tune the balance between relevance and variety based on your use case
- Improve search quality: Leverage sophisticated ranking algorithms without changing your underlying search infrastructure
Best practices for reranking
- Retrieve more results initially: Fetch 100-200 candidates to give rerankers sufficient options to work with
- Apply rerankers before RANGE: Rerank first, then limit the number of results returned
- Choose the right reranker: Use RRF for combining searches, MMR for diversification
- Test with your data: Experiment with different parameters to find what works best for your use case
Reciprocal Rank Fusion using RerankRRF
- Combine multiple ranked lists without requiring score calibration.
- Good for merging results from different search methods.
Syntax
Example: Hybrid search fusion
- Schema:
- Query:
Maximal Marginal Relevance using RerankMMR
- Balances relevance with diversity to reduce redundancy.
- Good for showing varied results instead of similar or duplicate content.
Syntax
Example: Simple diversification
- Schema:
- Query:
Chaining Rerankers
Example: Fusion and diversification
- Schema:
- Query: