Skip to content
Fourohtwo

Rerank search results or RAG chunks by relevance to a query

agents.crowdspark.me/v1/text/rerank

Rerank search results or RAG chunks by relevance to a query: JSON body {query, documents, top_k}. Up to 50 documents (strings or {id, text}), each up to 2,000 chars. Returns the documents sorted by a 0-1 relevance score from the bge-reranker-base cross-encoder. Texts are not stored.

BaseAnswering
POSThttps://agents.crowdspark.me/v1/text/rerank

Uptime100% of 3 checks 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://agents.crowdspark.me/v1/text/rerank", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"query":"how do plants make food","top_k":2,"documents":["Photosynthesis turns light, water and carbon dioxide into sugar.","The stock market closed higher on Friday.","Chlorophyll absorbs sunlight in leaves."]}),
});
console.log(await res.json());

Example input

{
  "query": "how do plants make food",
  "top_k": 2,
  "documents": [
    "Photosynthesis turns light, water and carbon dioxide into sugar.",
    "The stock market closed higher on Friday.",
    "Chlorophyll absorbs sunlight in leaves."
  ]
}

More from Agent ToolsProvider status