rerank_evaluate
Evaluate RAG retrieval quality: rank passages against a query and compute Precision@k / Recall@k plus a PASS/FAIL CI verdict from ground-truth relevance labels. Three modes, all keyless except the last. (1) BYO scores — give each passage the score your own reranker produced (Cohere, Jina, a self-hosted NIM, a cross-encoder): deterministic, offline, and it evaluates YOUR reranker rather than someone else's. This is the mode to gate CI on. (2) Default, no scores and no key — ranks with local BM25, a lexical keyword baseline: it answers "does a keyword floor already surface my relevant passages?", never "is my neural reranker good". (3) Live NVIDIA reranker — supply api_key for an NVIDIA account that still has reranking entitlement; NVIDIA retired its hosted reranking endpoints on 2026-05-18, so this one is for accounts that were grandfathered in.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The search query or question to rank against | |
| top_k | No | k for Precision@k evaluation (default 3) | |
| api_key | No | Your NVIDIA API key (BYOK), used only when no passage carries a score. Transits RAM for the single call, never stored. | |
| passages | Yes | Array of passage objects to rank (min 2, max 20) | |
| threshold | No | Minimum Precision@k to PASS (0-1, default 0.5) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | ||
| mode | No | ||
| model | No | ||
| ranked | No | ||
| verdict | No | ||
| threshold | No | ||
| latency_ms | No | ||
| recall_at_k | No | ||
| precision_at_k | No | ||
| total_passages | No | ||
| has_ground_truth | No |