# RAG Golden Set & Retrieval Eval Gate

> Build a small, honest golden test set for your RAG or search system, score Recall@k, nDCG, citation hits and abstention, label every miss by pipeline stage, and get a pass/fail gate with a bootstrap confidence interval for each change to your embedder, chunker or reranker.

RAG Golden Set & Retrieval Eval Gate is a paid AI agent skill on Agensi by Vijay Kumar, in LLM Ops. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $7 (one-time purchase)
- Creator: [Vijay Kumar](https://www.agensi.io/creators/vijay-kumar-1)
- Category: [LLM Ops](https://www.agensi.io/skills/llm-ops)
- Version: 1.1.0
- Last updated: 2026-12-03
- Security: scan passed (2026-12-03); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/rag-golden-set-retrieval-eval-gate
- Tags: llm-ops, testing, database, rag-evaluation, recallk, ndcg, golden-set, retrieval

## What it does

- Guides you through writing 15 to 50 real fixtures with stable ids, hard cases and unanswerable questions
- Scores Recall@k, nDCG@k, citation hit rate, prompt tokens and abstention, split by difficulty
- Labels each miss by stage (retrieval, rerank drop or packer drop) when your run includes stage lists
- Compares a candidate against a baseline with a paired bootstrap interval, so noise is not mistaken for gains
- Applies a pass or fail gate covering quality, tokens, latency and abstention, with exit codes for CI
- Scores code-review bots and linters too, with expected, tolerated and clean-repo false-positive checks

## Who it's for

- **AI founders and product owners:** Stop guessing if your AI search is getting better and prove it with real numbers. Try: "Build a golden test set for my customer support RAG system."
- **Software engineers building AI features:** Add a quality gate to your code so poor search results never make it to production. Try: "Compare these two embedding models using my retrieval test suite."
- **Data analysts and researchers:** Find exactly which part of your data pipeline is losing the right information. Try: "Show me why the retriever missed the document about refund policies."

## About this skill

"It feels better" is not a result. Teams change a chunk size, swap an embedding model or add a reranker, try five queries by hand, and ship. Weeks later quality is worse and nobody knows which change did it.

**RAG Golden Set & Retrieval Eval Gate** teaches your agent a repeatable way to measure retrieval. It first helps you write a small golden set from real questions: stable document ids instead of chunk UUIDs, a mix of easy and hard questions, and a few questions the corpus cannot answer, so you can see whether the system admits it does not know. You run your own retriever and save the results as JSON.

The bundled scorer then reports Recall@k, nDCG@k, citation hit rate, prompt tokens, latency and abstention, per difficulty level. When your run includes the output of each stage, it names where every miss happened: nothing retrieved, a reranker that pushed the answer out, or a token budget that cut it from the prompt. To judge a change, it compares candidate and baseline, shows a bootstrap interval so you know whether a gain is real on a small suite, and applies a gate: no more than 5% relative loss in recall or nDCG, no more than 2 points of recall lost, and some real gain in quality, tokens or latency.

The same scorer also evaluates finding-style systems, such as code-review bots, with expected findings, tolerated false positives and a clean repo that must stay silent.

**You end up with** a golden set, a baseline run, and a one-line pass or fail for every future change.

## Known limitations

Only measures if documents were found, not the quality of the written answer. Requires you to provide stable IDs for your documents.

## Technical details

Files: `SKILL.md`, `README.md`, `scripts/score.py` (about 10 KB, standard library only, commands `retrieval`, `compare`, `findings`), `references/building-a-golden-set.md`, `examples/` (suite, two runs, findings suite and run). JSON inputs; YAML works only if PyYAML is already installed. Permissions to expect in the scan: file read only, no network.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the RAG Golden Set & Retrieval Eval Gate skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How do I know if changing my AI search settings actually improved things?

This skill helps you move away from guessing if your AI search is better after a change. It uses a small set of proven questions and answers to calculate real accuracy scores and pinpoint exactly where a search system is failing, such as during the initial lookup or the final ranking step.

### What do I need to prepare before using this skill?

You need to provide a list of questions and the specific document IDs that the AI should find for each one. You also need to run your own search system and save those results into a simple data file that the skill can read and analyze.

### Can this tell me why my AI is missing the right information?

The skill identifies whether a failure happened because the right information was never found, was found but ranked too low, or was found but cut out of the final summary. This helps you decide if you need a better search model, different keyword settings, or more space for text.

### What kind of report does the skill produce?

You will get a report showing standard industry scores like Recall and nDCG, which measure how many right answers were found and how high they appeared in the list. When comparing two versions, it provides a pass or fail result based on whether the new version is truly better or just creating more noise.

### Are there things this skill cannot measure?

This skill focuses on whether the right documents were found, not on how well the AI wrote the final response or if the summary is grammatically correct. It also requires your document IDs to stay consistent to accurately track improvements over time.

### What should I say to my AI agent to get it to start the evaluation?

You can ask your agent to evaluate your RAG, build a golden set, or compare two retrievers. You can also ask it to check if a specific change helped your retrieval quality or to run a regression test for search.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
