{"uid":"cap_S4Ez0mbYs_YpN7HzdqYPe","slug":"cross-encoder-reranking-ms-marco-minilm-l-6-v2-2f8d3a40","name":"Cross-Encoder Reranking (ms-marco-MiniLM-L-6-v2)","description":"Rerank candidate texts against a query with a cross-encoder (ms-marco-MiniLM-L-6-v2): joint query+document scoring, much sharper than cosine similarity over embeddings. Returns ranked indices with 0-1 relevance scores. Up to 64 texts per call. Pairs with /embed for a recall-then-precision RAG pipeline.","url":"https://workbot1.oddsys.org/rerank","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"topK":{"type":"integer","description":"Return only the best K results (default: all, ranked)."},"query":{"type":"string","description":"The search query to rank against."},"texts":{"type":"array","items":{"type":"string"},"description":"1-64 candidate texts to rerank (each pair truncated at 256 tokens)."},"returnTexts":{"type":"boolean","description":"Include the text of each result (default false: indices only)."}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_7kX9ij6MN1hXIFUdS8BfU","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Reranks up to 64 candidate texts against a query using a cross-encoder model, returning ranked indices with 0–1 relevance scores for precision-stage RAG pipelines.","exampleAgentPrompt":"I've got a query — 'what are the side effects of ibuprofen?' — and 12 candidate passages retrieved from my vector store. Can you rerank them by true relevance using a cross-encoder so I know which ones to actually pass to the LLM?","exampleUseCases":[{"title":"Precision stage in RAG pipeline","prompt":"I retrieved 40 chunks from my document index using embeddings, but cosine similarity isn't sharp enough. Can you rerank all 40 against my query 'quarterly revenue breakdown by region' and give me the top results by relevance score?"},{"title":"Legal document passage ranking","prompt":"I have a query — 'breach of contract under force majeure clause' — and 20 extracted paragraphs from different contracts. Rerank them so the most legally relevant passages come first before I summarize them."},{"title":"Customer support FAQ matching","prompt":"A user asked 'how do I reset my two-factor authentication?' and I've got 15 FAQ snippets fetched from our help center. Can you score and rerank them by how well they answer that question?"}],"resultDescription":"An ordered list of candidate texts ranked by relevance to the query, with each entry carrying a 0–1 relevance score and the original index, sorted from most to least relevant. Up to 64 texts can be scored per call.","failureModes":["More than 64 texts submitted — request rejected or truncated","Empty query string — scoring undefined or error returned","Non-string or malformed text entries in the candidate list — validation error","Network timeout on large batches near the 64-text limit","Payment not included or insufficient — x402 payment required error"],"whenToPreferThis":"Choose this endpoint when you need precision reranking after a recall step (e.g. embedding-based ANN search) in a RAG pipeline. It pairs naturally with the /embed endpoint on the same host. Prefer this over pure cosine-similarity ranking when result quality matters — the cross-encoder jointly encodes query and document together, producing significantly sharper relevance scores. Use it when you have up to 64 candidate passages and need to select the top-k most relevant before passing to an LLM.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:31:54.683Z","isFirstParty":false}