Analyze rerank NDCG
analyze_rerank_ndcgEvaluate reranking quality by comparing NDCG@k between bi-encoder and cross-encoder orderings, reporting whether reranking improves or harms retrieval relevance.
Instructions
NDCG@k under bi-encoder ordering vs cross-encoder ordering, averaged across labeled queries (ground_truth_relevance IS NOT NULL). Reports the delta (cross - bi) — positive = the rerank is adding real ranking quality, negative = it's hurting. Surfaces rerank_hurts_ndcg (CRITICAL) or rerank_lifts_ndcg (GOOD evidence). Reads from mcpg_rag.rerank_events; returns zero counts when no labeled rows exist in the window.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | ||
| days | No | ||
| model | No | ||
| database | No | Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids. | |
| retrieval_index | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | Yes | ||
| delta | Yes | ||
| model | Yes | ||
| findings | Yes | ||
| window_days | Yes | ||
| retrieval_index | Yes | ||
| labeled_query_count | Yes | ||
| ndcg_at_k_under_bi_order | Yes | ||
| ndcg_at_k_under_cross_order | Yes |