Compare retriever rankings on fixed relevance datasets with BEIR
Compare baseline and candidate retrievers on the same labeled dataset, then hand off ranking metrics, saved runs and query-level regressions before a RAG retrieval change.
npx skills add agentskillexchange/skills --skill compare-retriever-rankings-on-fixed-relevance-datasets-with-beir
Invoke this workflow before changing a RAG retriever when an operator needs a repeatable comparison against labeled relevance judgments. Supply a benchmark dataset and split, baseline and candidate retrievers, model revisions, scoring settings, and the cutoffs that matter to the application. The agent returns comparable ranking scores, saved retrieval runs, and a recommendation grounded in the observed differences.
What this skill actually does
Run a controlled retrieval comparison
- Install BEIR in an isolated Python environment. Choose one documented dataset and keep its corpus, queries, relevance judgments and split identical for both runs.
- Load the dataset with GenericDataLoader. Configure a supported retriever through EvaluateRetrieval; the upstream quick example demonstrates SentenceBERT with dense exact search.
- Run the baseline and candidate separately. Record model revisions, similarity function, prompts, batch settings and dataset identity so the comparison can be reproduced.
- Compute NDCG, MAP, recall and precision at the chosen cutoffs; calculate MRR when useful. Save each retrieval run and its metric results with the documented export helpers.
- Compare scores at matching cutoffs, inspect queries with worse rankings, and deliver the artifacts alongside the recommendation. State the dataset coverage limits before suggesting a production change.
Scope and handoff
This skill ends at an offline retriever comparison. It does not deploy a retrieval service, ingest production documents, train a model, or evaluate generated answers. Use it when a fixed relevance-labeled benchmark can resolve a retriever choice more reliably than informal search examples. The operator selects the dataset and models; the agent coordinates matched runs and reports evidence. The Python interface can be invoked from different agent runtimes and does not require a particular agent SDK or MCP server.
Prerequisites: Python 3.9 or later, pip, BEIR, the selected dataset and retriever dependencies, and compute/storage appropriate to the corpus and model. Model and dataset downloads may be needed. No benchmark was executed during metadata verification.