← Back to the journal

DataFocus · Journal

Build a golden question set to test your AI data assistant

A step-by-step method for analysts: choose 25 to 40 questions with known answers, record the definition and expected SQL for each, rerun after every change, and use query receipts to explain drift.

To check whether an AI assistant answers business questions correctly, build a golden question set: a fixed list of questions whose correct answers you already know, each stored with its business definition, the expected SQL and the source tables. Run the whole list every time something changes, such as a metric definition, the model or the data model, and compare each result with what you recorded. A set of 25 to 40 questions is enough to start, and it will tell you more than any number of ad hoc demos. This tutorial shows how to pick the questions, what to record, how to read the evidence an answer returns, and how to turn the results into acceptance criteria.

Why is spot-checking a demo not an evaluation?

A demo shows the assistant answering questions that someone chose because they work. You cannot tell from it whether the answer to the next question will be right, whether it stays right after you change a definition, or whether it refuses what it should refuse. A spot check also has no memory: next month nobody remembers which questions were tried or what the right numbers were.

A golden set fixes all three. The questions are chosen in advance, the expected answers are written down by someone who owns the metric, and the run is repeatable. NIST makes the same general point for generative AI. Its 2024 Generative AI Profile (NIST AI 600-1), published on 26 July 2024 as a companion to the AI Risk Management Framework, is a voluntary, cross-sectoral resource for managing the risks of generative AI systems. A golden set is one small, practical way for an analyst to check, rather than assume, that answers over business data are right.

How do I choose the questions?

Start from one business area, not the whole company. DataFocus's getting-started guidance says to define the task, its business owner, acceptance criteria and permitted scope first, and to start with synthetic data rather than customer information. Its product brief suggests the same narrowing: pick a business question that has data, policy documents and a clear owner, such as order delivery or purchase approvals, and expand to the next area later. That owner is also the person who signs off on your expected answers.

Within that area, draw questions from three groups.

GroupWhat it checksExample (hypothetical)
Definition questionsThe assistant uses the agreed metric, not a plausible guess"What was net revenue last quarter?" where net revenue excludes returns and internal transfers
Edge casesFilters, time boundaries, nulls, ties, fiscal calendars"Orders shipped on the last day of the month", "customers with no orders this year"
Out-of-scope requestsThe assistant refuses cleanly"Show me salaries by employee" asked by someone without access; a question about data that is not modelled

Aim for roughly half definition questions, a third edge cases and the rest out-of-scope requests. Add each real mistake you find later as a new question, so the set grows from your own failures.

Out-of-scope questions need a precise pass condition. In DataFocus's published homepage demo, a request outside the user's authorized scope is refused without revealing content, counts or whether the record exists; the example response reads "No order O-1003 was found in your authorized scope." The identity sets the visible scope, not the wording of the question. For your set, that means a refusal test should name the identity asking, and the pass condition should say what the reply may not disclose, for example not even confirming that the record exists.

What do I record for each question?

Keep one row per question in a spreadsheet or a file in version control. These fields are enough:

  1. ID and question text, exactly as a user would type it.
  2. Asked as (the user or role), so permission-dependent answers are testable.
  3. Business definition, in one sentence, with the owner's name.
  4. Expected answer: the number, list or refusal, with the date the data was frozen.
  5. Expected SQL, written by hand against the source tables.
  6. Source tables the answer should come from.
  7. Pass rule: exact match, tolerance, or "refuses without confirming existence".

Here is a hypothetical row. The SQL is illustrative, not run.

-- Q-007: "What was net revenue in Q3 2026?"
-- Definition (owner: finance): order total minus returns, excluding internal transfers
-- Illustrative, not run
SELECT SUM(o.total_amount - COALESCE(r.return_amount, 0)) AS net_revenue
FROM orders o
LEFT JOIN returns r ON r.order_id = o.order_id
WHERE o.order_type <> 'INTERNAL_TRANSFER'
  AND o.order_date >= '2026-07-01' AND o.order_date < '2026-10-01';

Writing the SQL yourself matters for a second reason. It forces you to decide the join, the filter and the date boundary before you see what the assistant did, so you are not talking yourself into accepting its version.

Freeze the data. Run the set against a fixed snapshot or a closed period, otherwise a changed number could mean new data rather than a changed answer.

How do I run the set and read the receipts?

Ask each question as the recorded identity and capture the answer together with its evidence. In DataFocus, every query returns the SQL that ran, the tables it used and a data fingerprint, and the AI follows the objects and relationships defined in the ontology instead of guessing. In the ontology agent, the data cited in an answer comes from the tables and documents bound to the ontology, and "View processing details" shows which data the agent queried and which tools it called. In OT Heavy, the result's right-hand rail has a "Query SQL Statement" panel that shows the SQL the search actually ran and its computation time.

Compare in this order:

  1. Tables. Did the answer use the source tables you listed? A right number from the wrong table is a coincidence, and it will break later.
  2. SQL. Compare the filters, joins and date boundaries with your expected SQL. Textual differences are fine; differences in meaning are not.
  3. Value. Compare the result with your expected answer under the pass rule.
  4. Fingerprint. Store it with the run. If the fingerprint changes while the question and the data snapshot are unchanged, treat that as a signal to look at the SQL and tables before trusting the number.

Mark each question pass, fail or "right value, wrong path". The third state is the one a plain answer-versus-answer comparison misses, and it is where receipts earn their place.

How do I rerun after a definition or model change?

Rerun the full set whenever one of these changes: a metric definition, the data model or the bound tables, the configured language model, or the permission rules. A definition set once in the ontology and used by search analysis, dashboards, control panels, the ontology agent and external agents gives all of them the same figures. That is convenient for you as a tester: changing a definition changes every consumer at once, so one regression run covers the change, and a question that now fails shows exactly which answers a definition edit affected.

Keep a results table per run, with the date, what changed and one line per question:

RunChangePassFailWrong path
2026-11-01Baseline3131
2026-11-08Net revenue now excludes transfers3320

(Illustrative layout with made-up counts.) When a question flips from pass to fail, open its receipt, diff the SQL and tables against the last passing run, and decide whether the answer drifted or the new definition is simply correct and your expected answer is out of date. Update the expected value only with the metric owner's agreement, and record why.

How do I turn the results into acceptance criteria?

Agree the rules before the first full run, with the business owner:

  • Every definition question must pass with the expected tables. No exceptions.
  • Every out-of-scope question must refuse without disclosing content, counts or existence.
  • "Right value, wrong path" counts as a fail until the path is explained.
  • Any failure in a question marked critical (for example, anything feeding a board report) blocks release of a change.
  • Failures from earlier runs stay in the set permanently.

Write these into the task definition next to the owner and the permitted scope. Notice what the rules leave out: a single accuracy percentage. A 95 percent score can hide the one question the CFO will ask, so tie acceptance to named questions rather than a headline rate.

When is a golden set not enough?

A golden set tests the questions you thought of. It does not cover wording you never imagined, and it cannot show that a new type of question is safe. Keep a log of real user questions that surprised you and promote the informative ones into the set. Also remember that an expected answer is only as good as its author: have a second analyst review the SQL for the definition questions.

Next step

Choose one business area, write ten questions with expected SQL this week, and run them against your own environment with synthetic or frozen data. The editions page and release notes at datafocus.ai/download list the installers for both free editions, and the product brief describes how the ontology, definitions and query evidence fit together.