Search Result Reranking
Cohere's reranking models improve search relevance by reordering results using cross-encoder scoring. Get the most relevant results at the top.
export COHERE_API_KEY=...
Reranking is a two-stage retrieval technique that improves search quality beyond initial vector similarity.
The Searcher agent uses embeddings to find candidates quickly.
Cross-encoder analyzes query-document pairs for true relevance.
Embeddings are fast but approximate. Cross-encoders are slow but precise. By using embeddings to narrow down candidates (100 -> 20) and then reranking the top results, you get the best of both worlds: speed AND accuracy.
Optimized for English language content. Best performance for English-only knowledge bases.
Supports 100+ languages. Use for multilingual knowledge bases or non-English content.
{
"query": "authentication problems",
"documents": [
"Login timeout issue in production",
"JWT token expired after 24 hours",
"Session cookie settings guide",
"Password reset flow documentation"
],
"top_n": 3,
"model": "rerank-english-v3.0"
}
{
"results": [
{
"index": 1,
"relevance_score": 0.94,
"document": "JWT token expired after 24 hours"
},
{
"index": 0,
"relevance_score": 0.91,
"document": "Login timeout issue in production"
},
{
"index": 2,
"relevance_score": 0.72,
"document": "Session cookie settings guide"
}
]
}
Cohere reranking is optional. If no API key is configured, search results will use embedding similarity scores only. Add Cohere when you want to improve result quality.
Based on reranking 10 documents per search. Actual cost depends on documents per query.
Create an account at dashboard.cohere.com and generate an API key.
All semantic searches now use Cohere reranking automatically.
Add Cohere reranking to get the most relevant results first.