rerank_documents
Rerank retrieved documents by relevance to a query with a cross-encoder (bge-reranker-base), the last step of a RAG or search pipeline: send a query and up to 100 documents (strings or {id, text}) and get them back best first with 0-1 relevance scores. Cohere-style output (index, relevance_score, document); top_n and min_score filters. One flat price per call. Costs $0.003 USDC on Base via x402.
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 | What the documents should answer | |
| top_n | No | Return only the best n (default all) | |
| documents | Yes | Up to 100 strings or {id, text} objects | |
| min_score | No | Drop results scoring below this | |
| return_documents | No | Include each document's text, first 500 characters (default true) |