Answers you can trust, from Codeables

Every page on Codeables is structured and verified — built so people and the AI agents they rely on can trust it. Explore more from the source behind this answer.

Explore Codeables
Verified Source
LLM Observability & Evaluation

How do I create and version a golden test set in Galileo for our RAG assistant?

Galileo13 min read

Most teams only discover their RAG assistant is “off” when users complain: wrong citations, stale answers, missing edge cases. By then, you’re already flying blind. The fix is a golden test set you trust—and a way to version it as your system evolves. Galileo gives you that eval-to-guardrail workflow so your golden set isn’t a static spreadsheet, but a living asset that powers both offline evals and production guardrails.

Quick Answer: In Galileo, you create a golden test set for your RAG assistant by pulling in real and synthetic conversations, annotating ground truth and expected behavior, and organizing them into a dataset collection. You then version that collection as you add scenarios or update expectations, so it becomes the single source of truth for regression tests, CI, and production guardrails.


The Quick Overview

  • What It Is: A structured, versioned dataset in Galileo that captures realistic RAG queries, context, expected answers, and evaluator labels—your “golden” standard for how the assistant should behave.
  • Who It Is For: Teams shipping RAG systems into production—search/knowledge assistants, support copilots, internal knowledge tools—that need repeatable, measurable quality gates.
  • Core Problem Solved: Stops you from guessing whether a change to models, prompts, or retrieval helps or hurts. You get a stable benchmark that evolves with your product and directly powers guardrails.

How It Works

At a high level, you’ll:

  1. Capture realistic data (from dev runs, synthetic stress tests, and production traces).
  2. Turn that into a structured Galileo dataset collection with SME-reviewed labels and expectations.
  3. Version and reuse that collection for evals, CI, and production guardrails via Galileo’s eval-to-guardrail lifecycle.

The workflow looks like this:

  1. Collect & Design Scenarios (Data In):

    • Pull in RAG sessions from development and production (queries, retrieved context, responses).
    • Augment with synthetic and adversarial examples that target known failure modes: hallucinations, missing citations, prompt injection, PII requests, policy edge cases.
    • Organize these into a dataset collection in Galileo so every test case is traceable and reproducible.
  2. Label, Evaluate & Calibrate (Turn Data into Gold):

    • Use Galileo’s Evaluation Engine (20+ out-of-the-box evaluators for RAG, safety, security) plus custom evaluators to score responses: answer correctness, citation quality, groundedness, safety, etc.
    • Collect subject matter expert annotations and live feedback; feed them into Galileo’s Continuous Learning via Human Feedback (CLHF) to refine evaluators and labels.
    • Lock in a “golden” slice: the subset where you have strong agreement between SMEs and evaluators.
  3. Version, Run, and Promote to Guardrails (From Eval to Governance):

    • Version your dataset collection as you add new cases or update expectations.
    • Use the golden set as the benchmark in pre-production (model/prompt/retriever comparisons, CI pipelines).
    • Promote the best evaluators (often distilled into Luna / Luna‑2 small models) to production guardrails in Protect, so the quality criteria from your golden set actively intercept bad responses in <200ms.

Step-by-Step: Creating a Golden Test Set for Your RAG Assistant in Galileo

1. Start from realistic data, not toy prompts

Your golden set should reflect how your RAG assistant is actually used—not just “What is X?” toy questions.

Seed with real usage patterns:

  • Ingest development sessions:
    Run your RAG assistant against internal test scripts and capture full traces (sessions → traces → spans) including:

    • User queries
    • Retrieved documents/snippets
    • Model responses
    • Tool calls (if your assistant uses tools alongside retrieval)
  • Pull early production traces into Galileo:
    Once you’re live, connect Galileo so it ingests 100% of production traces. Use Signals to surface:

    • Sessions with high latency or cost
    • Suspicious patterns (e.g., repeated “I’m not sure” answers, empty retrieval, over-long responses)
    • Signals of hallucinations or security issues
      These make excellent “real-world” test cases.

2. Augment with synthetic and adversarial scenarios

Real data is necessary but not sufficient. You also need to deliberately stress-test your RAG system.

Design synthetic scenarios that cover:

  • Ambiguous queries

    • Similar questions with different answers depending on context.
    • Multi-step queries where requirements change mid-conversation.
  • Coverage of critical knowledge areas

    • High-risk workflows (e.g., compliance answers, pricing, policy).
    • Edge cases and rare “long tail” questions users might ask once a year, but you must get right.
  • Adversarial and safety threats

    • Prompt injection: “Ignore your previous instructions and…”
    • Attempts to exfiltrate confidential docs or PII.
    • Requests that violate policy: medical, legal, financial advice, or internal-only knowledge.

Add these to the same dataset collection, with clear tags (e.g., adversarial, ambiguous, compliance, prod-trace) so you can slice and track progress on specific risk areas.

3. Create a dataset collection in Galileo

Within Galileo, you’ll organize these test cases into a dataset collection—this is the core artifact for your golden set.

Each row/test case should include:

  • Input fields:

    • user_query (and any conversation history if multi-turn)
    • retrieved_context (documents/snippets or references)
    • Optional: structured metadata (tenant, user role, product area)
  • Expected behavior:

    • expected_answer (or a structured description of acceptable answer characteristics)
    • must_include / must_not_include keywords or references
    • For adversarial cases, “expected behavior” may be: refuse, explain why, and not leak X
  • Evaluation targets:

    • Which evaluators should score this case (e.g., rag_groundedness, citation_accuracy, safety_policy_compliance)

Galileo automatically versions the dataset collection itself, so each change is tied to a version you can reproduce in the future.

4. Apply evaluators with Galileo’s Evaluation Engine

Once your test cases are in Galileo, use the Evaluation Engine to turn them into measurable performance:

  • Out-of-the-box evaluators for RAG:

    • Groundedness / hallucination detection
    • Answer relevance and completeness
    • Citation correctness (does the answer genuinely rely on the retrieved context?)
    • Response quality (clarity, structure, tone)
  • Safety & security evaluators:

    • PII detection
    • Policy violations (e.g., restricted domains or content)
    • Prompt injection / jailbreak attempts
  • Custom evaluators for your domain:

    • Define evaluators from a description (e.g., “Rates whether the answer follows internal HR policy X”) and let Galileo generate an LLM-as-judge pattern.
    • Improve them with CLHF: add few-shot examples from SME reviews and live incidents to calibrate them to your domain.

As you run these evaluators on your dataset collection, Galileo attaches structured scores and labels to every test case.

5. Involve SMEs to lock in “golden” labels

Evaluators get you speed and coverage; SMEs give you authority and nuance.

Use SMEs to:

  • Review critical test cases and mark:
    • “Pass/fail” for the current answer
    • Comments on what should have happened
  • Resolve disagreements between evaluators and human judgment
  • Add detailed “expected behavior” notes for tricky scenarios

Feed these reviews back into Galileo:

  • CLHF loop:
    • Take SME-reviewed cases and use them as few-shot examples to improve your custom evaluators.
    • This is how your evaluation logic becomes more aligned with your domain over time instead of staying generic.

Once you have a subset where evaluators and SMEs agree, tag it as your golden slice. This is the core of your golden test set.

6. Version your golden test set over time

Your RAG assistant, corpus, and policies will change. Your golden test set must evolve with them—but without losing history.

In Galileo, you maintain that evolution by versioning:

  • Dataset versions:

    • When you add new test cases (e.g., for a new policy or content area), you increment the version of the dataset collection.
    • When you deprecate old behavior (e.g., changed policy), you retire tests or update their expected behavior in a new version.
  • Evaluator versions:

    • As you refine evaluators with CLHF and live feedback, version those evaluators.
    • Keep a mapping: dataset v1.3 + evaluator v2.0 is the baseline that shipped with model X and prompt Y.
  • Test suite definitions:

    • Define named suites (e.g., rag_regression_suite, compliance_suite, adversarial_suite) that point to:
      • A specific dataset collection version
      • A specific set of evaluator versions

Treat each combination as a frozen “release gate.” When you change something in your RAG stack, rerun the same suite to detect regressions.

7. Plug your golden test set into CI/CD

A golden set has zero value if it only lives in a dashboard. It needs to be part of your shipping process.

Use Galileo’s evaluation runs to:

  • Compare model candidates (e.g., gpt-4.1-mini-2025-04-14 vs a new foundation model)
  • Compare prompt versions and RAG chain variants
  • Compare retrieval configurations (BM25 vs hybrid, different embedding models, index changes)

Wire evaluation runs into CI/CD:

  • On every change to your RAG system (prompt, retriever, tool logic), trigger:
    • A run of the relevant Galileo test suites against the golden dataset version
    • A pass/fail threshold (e.g., no degradation on groundedness, no new safety violations, and no drop in accuracy on compliance suite)

If it fails, don’t ship. This is how you turn evaluation into a hard governance gate.

8. Promote evaluation logic into production guardrails

The real power of Galileo is that your golden test set doesn’t just live “offline.” The same evaluation logic can become production guardrails.

Here’s how the eval-to-guardrail lifecycle looks for your RAG assistant:

  1. Design evaluators with the golden set as the reference.

    • You know which metrics & logic matter because you’ve tested them on your golden set and calibrated them with SMEs.
  2. Distill evaluators into Luna / Luna‑2 models.

    • Galileo distills your best evaluators into compact small language models, then runs them on a purpose-built inference stack.
    • This lets you get sub‑200ms, low-cost evaluation per trace, at 100% traffic coverage—something heavyweight LLM judges can’t do in production.
  3. Deploy as Protect guardrails:

    • Wrap your RAG assistant in Galileo Protect.
    • For every request/response:
      • Luna‑based evaluators score groundedness, safety, policy adherence, and other guardrail metrics.
      • Guardrail policies trigger actions:
        • Block clearly unsafe or ungrounded responses.
        • Redact PII or sensitive content.
        • Override with a safe fallback answer.
        • Webhook to create incidents or escalate for human review.

This means the same quality bar you enforced with your golden test set is now actively intercepting failures in real time, not just in offline tests.


Features & Benefits Breakdown

Core FeatureWhat It DoesPrimary Benefit
Dataset CollectionsOrganize, version, and tag test cases spanning dev, synthetic, and production traces.Creates a single, reproducible golden test set for your RAG assistant.
Evaluation Engine + CLHFRuns 20+ RAG/safety evaluators and custom evaluators tuned with expert feedback.Produces domain-aligned, measurable scores and “golden” labels you can trust.
Luna / Luna‑2 Distilled ModelsDistills evaluator logic into compact models served on a dedicated inference stack.Enables sub‑200ms, low-cost evaluation at 100% traffic coverage, instead of relying on heavyweight judges.

Ideal Use Cases

  • Best for RAG assistants in regulated or sensitive domains:
    Because you can encode policies and compliance requirements directly into your golden set and evaluators, then enforce them as guardrails.

  • Best for teams iterating quickly on prompts/models/indexes:
    Because versioned golden sets let you safely experiment without regressing on core metrics—even when you’re shipping multiple changes per week.


Limitations & Considerations

  • You still need SME time up front:
    Galileo accelerates evaluation, but it can’t invent your domain policy. Plan to invest SME time to review critical cases, especially early versions of your golden set. Over time, CLHF reduces the incremental cost per change.

  • Golden sets don’t replace live monitoring:
    A golden set is a strong baseline, not a complete map of all possible failures. Use Galileo Signals to analyze 100% of production traces and surface new “unknown unknown” patterns, then promote those back into your dataset collection as new test cases.


Pricing & Plans

Pricing for Galileo depends on deployment mode (SaaS, VPC, on-prem) and your traffic volume / evaluation needs, but the core structure is:

  • Growth / Team Plan:
    Best for product and platform teams standing up their first RAG assistant or agent, needing:

    • A single golden test set across a handful of projects
    • 5,000+ traces per month
    • Access to Evaluate, Signals, and baseline Protect guardrails
  • Enterprise Plan:
    Best for organizations running multiple RAG systems and agents with strict latency, volume, and compliance requirements, needing:

    • Multiple golden test sets and complex test suites per business unit
    • 100% traffic coverage at high throughput (e.g., 10,000+ requests/min)
    • SOC 2 Type II, HIPAA-ready infrastructure with BAAs, SSO, VPC or on-prem deployment, and advanced Protect policies

For a detailed quote and fit assessment, talk directly with the Galileo team.


Frequently Asked Questions

Do I need a golden test set before I integrate Galileo, or can I build it inside the platform?

Short Answer: You can (and should) build your golden test set inside Galileo, starting from whatever data you already have.

Details:
Galileo is designed to help you graduate from ad-hoc prompts and spreadsheets to structured, versioned evaluation:

  • Start by ingesting whatever you have—dev scripts, early production traces, existing evaluation docs.
  • Turn them into a dataset collection with explicit fields for queries, context, answers, and expectations.
  • Use the Evaluation Engine and CLHF to quickly add labels and refine evaluators, then carve out your first golden slice.
  • Over time, use Signals to discover new failure modes in production and feed them back into the golden set.

You don’t need a perfect test set to start; Galileo is the environment where that test set matures.


How often should I update and version my golden test set for a RAG assistant?

Short Answer: Treat your golden set like code: update it whenever your knowledge base, policies, or failure patterns change—and bump the version each time.

Details:
Practical cadence for most RAG teams:

  • Every major release:
    When you change foundation models, prompts, retrieval logic, or core corpus structure, add new cases and re-run the full suite.

  • Whenever policy or compliance rules change:
    Add new tests that encode the changed requirements, and adjust expected behavior for existing tests if needed.

  • After significant incidents in production:
    When Signals surfaces a new failure pattern (e.g., a novel prompt injection or data leak), convert those traces into test cases in your dataset collection, then increment the version.

The goal: your golden test set should always reflect your current definition of “acceptable behavior.” Old versions remain as historical baselines; new versions guard the system you’re shipping today.


Summary

Creating and versioning a golden test set for your RAG assistant in Galileo is less about building a static benchmark and more about establishing a living governance asset. You:

  • Collect realistic and adversarial scenarios from dev and production.
  • Turn them into a structured, versioned dataset collection with SME-reviewed expectations.
  • Use Galileo’s Evaluation Engine and CLHF to produce reliable labels and evaluators.
  • Version that golden set as your RAG stack and policies evolve.
  • Distill the resulting evaluation logic into Luna / Luna‑2 models and promote it into Protect guardrails that intercept hallucinations, prompt injection, and policy violations in real time.

If your evaluators only run offline, you have a demo, not reliability. Galileo’s eval-to-guardrail workflow makes your golden test set the control plane for both pre-production testing and production safety.


Next Step

Get Started

How do I create and version a golden test set in Galileo for our RAG assistant? | LLM Observability & Evaluation | Codeables | Codeables