Rerank Documents
rerank_documentsRanks candidate documents by relevance to a query, returning scores and original positions to surface the most pertinent results for retrieval-augmented generation.
Instructions
Order documents by how well they answer a query, with Qwen3-Reranker-8B (NaN API). This is the second half of a RAG pipeline: embed_text builds the vectors a search runs over, and this one ranks what that search returns. Returns one line per document with its relevance score and its position in the input list, in the order the reranker gives them back.
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_documents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Query against which each document's relevance is measured | |
| top_n | No | Limit response to the N most relevant documents | |
| documents | Yes | Candidate texts to re-rank, typically the top hits of a vector search |