Rank passages by relevance
rerankOrders candidate passages by how well they answer a query using a local cross-encoder, returning each passage best-first with relevance scores and original indexes.
Instructions
Order passages you already have by how well each answers a query, with a cross-encoder, locally. Returns every passage best first, each with its original index in documents, a relevance from 0 to 1 and its start. Use it on search results or a shortlist of tens of passages; to find passages in files use search_folder, and to score just two texts use similarity. Slower per passage than similarity but more precise.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>",
"documents": "<documents>"
},
"name": "rerank"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The question or need the passages should answer. | |
| documents | Yes | The candidate passages, each a sentence to a few paragraphs; longer ones are cut off. |