Analyze top-k stability
analyze_topk_stabilityMeasures Jaccard overlap between top-K bi-rank and cross-rank results per query to detect whether reranking changes top-K membership, flagging stable top-K when reranking barely affects results.
Instructions
Jaccard overlap between top-K-by-bi-rank and top-K-by-cross-rank per query, aggregated. High mean Jaccard means the reranker isn't actually changing the top-K membership. Surfaces topk_stable (WARNING) when the rerank is barely earning its place at this K. Reads from mcpg_rag.rerank_events; returns a report with zero counts when the table doesn't exist or the window is empty.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "analyze_topk_stability"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | ||
| days | No | ||
| model | No | ||
| database | No | Optional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected. | |
| retrieval_index | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | Yes | ||
| model | Yes | ||
| findings | Yes | ||
| p25_jaccard | Yes | ||
| p75_jaccard | Yes | ||
| query_count | Yes | ||
| window_days | Yes | ||
| mean_jaccard | Yes | ||
| retrieval_index | Yes |