Rerank
Use reranking to reorder candidate documents by relevance to a query. It is commonly applied after keyword or vector retrieval.
Basic request
The response contains a ranked results array. Each result identifies the source document index and includes a relevance score; the document can also be returned when return_documents is enabled.
Request fields
Retrieval workflow
Best practices
- Keep the original document index so results can be mapped back safely.
- Retrieve a manageable candidate set before reranking.
- Use
top_nto limit the context passed to a generation model. - Measure retrieval quality with your own data rather than relying on score thresholds copied from another model.
- Do not compare raw scores across different rerank models unless their documentation states that the scales are compatible.
