Skip to content
Fourohtwo

Rerank documents by relevance

agent-data-tools.revmesh2074.workers.dev/ai/rerank

Rerank documents by relevance. Order up to 50 documents by how well each answers a query, with a relevance score from 0 to 1 (BAAI bge-reranker-base, a cross-encoder). Send documents as a JSON array or one per line; each is read up to 2,000 characters, 40,000 in all. Returns the original index, score and text, best first; top_n keeps only the best. Also available in the Cohere-style shape at /v1/r

BasePolygonArbitrumSolanaAnswering
GEThttps://agent-data-tools.revmesh2074.workers.dev/ai/rerank

Uptime100% of 1 check in 30 days

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

// npm install fourohtwo
import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://agent-data-tools.revmesh2074.workers.dev/ai/rerank?documents=%5B%22France+has+hundreds+of+cheeses.%22%2C%22Berlin+is+the+capital+of+Germany.%22%2C%22Paris+is+the+capital+and+largest+city+of+France.%22%5D&query=What+is+the+capital+of+France%3F");
console.log(await res.json());

Example input

{
  "documents": "[\"France has hundreds of cheeses.\",\"Berlin is the capital of Germany.\",\"Paris is the capital and largest city of France.\"]",
  "query": "What is the capital of France?"
}

More from Rerank documents by relevanceProvider status