# RAG Testset Builder

> Builds verifiable RAG ground-truth test sets from local documents with automated quote checking and versioned exports.

RAG Testset Builder is a paid AI agent skill on Agensi by Uttam Sharma, in LLM Ops. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $100 (one-time purchase)
- Creator: [Uttam Sharma](https://www.agensi.io/creators/uttam-sharma)
- Category: [LLM Ops](https://www.agensi.io/skills/llm-ops)
- Version: 1.0
- Last updated: 2026-11-25
- Security: scan passed (2026-11-25); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/rag-testset-builder
- Tags: llm-ops, python, rag-evaluation, testing, data-science

## About this skill

Testing a RAG pipeline with vibes and "it feels right" responses is not a strategy. You need a verifiable, ground-truth test set where every answer is anchored to a specific page and quote. This skill automates the creation of that golden set, moving from a raw corpus to a frozen, peer-reviewed test plan without letting hallucinations leak into your evaluation data.

### What it does
- **Source Sampling** performs seeded draws across your corpus, supporting random, grouped (by year, folder, or type), or user-defined samples.
- **Fact Extraction** converts pages and sections into atomic fact cards, strictly enforcing word-for-word quotes to prevent model drift.
- **Automated Query Planning** balances test sets across seven types, including lookup, filtering, trends, summarization, and edge cases.
- **Multi-Stage Verification** runs scripted checks for quote validity, number accuracy, "nothing found" confirmation, and answerability.
- **Artifact Generation** produces versioned `.jsonl` test sets and professional `.docx` test documents with blank columns for manual testers.

### How it works
1. **Initialize** the workspace using `rtb init` and configure your domain, personas, and LLM providers in the `config.yaml`.
2. **Sample and Extract** your documents to build a corpus map and extract fact cards, with mandatory human checkpoints for the sample and query plan.
3. **Generate and Check** the queries and ground truths using your LLM, followed by automated scripts that reject any items failing quote or logic checks.
4. **Review and Freeze** the set via an Excel-based review sheet, then sign off to generate the final versioned test artifacts.

### Frameworks & tools
Built with Python 3.12. It integrates with OpenAI, Azure OpenAI, and Anthropic for generation, uses Pandas for trend analysis, and exports to JSONL and Word formats.

### Why this beats prompting it yourself
Manual test generation is prone to hallucinated ground truths and poor document coverage. This skill enforces a "nothing enters unchecked" rule, verifying every quote against the source page by script before a human ever sees it.

### Use cases
- Build a golden set for a corporate chatbot using SharePoint or local file exports.
- Create complex trend and analytics test queries from structured logs and documents.
- Verify RAG performance against specific personas and edge cases like out-of-scope data.
- Generate versioned evaluation datasets for CI/CD pipeline scoring.

### Known limitations
Does not support direct ingestion from SharePoint, Blob, or S3; files must be synced to a local folder or CSV list first. Requires Python 3.12 or later.

## Requires

- Python

## 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 Testset Builder 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 does this prevent hallucinations from entering the actual test set?

Unlike basic prompting, this skill uses scripted verification to ensure every answer is anchored to a literal quote and page number, preventing 'hallucinated' ground truth data from ruining your evaluation.

### Which LLM providers and frameworks are compatible with the builder?

The skill is built on Python 3.12 and supports major LLM providers including OpenAI, Azure OpenAI, and Anthropic for the generation and verification phases.

### What exactly is included in the purchase of the RAG Testset Builder?

You will receive the complete Python skill package, documentation for the `rtb` CLI, and template configurations for your domain-specific personas and test plans.

### Can I connect this directly to my live SharePoint or AWS S3 bucket?

No, this skill requires files to be synced to a local directory or referenced in a CSV list before processing begins.

### What file formats does the skill export for my RAG evaluation?

The skill generates versioned `.jsonl` files for automated pipelines and professional `.docx` files designed for manual human-in-the-loop review and sign-off.

### How difficult is the initial configuration and setup process?

Setup is handled via the `rtb init` command, which creates a workspace where you can define your data sources and LLM credentials in a `config.yaml` file.

---

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.
