Level 2: AI layer
Evals and receipts: test the questions, keep proof of every answer.
Before people rely on AI answers, test the questions they'll ask against answers you worked out by hand. After, keep a receipt for every answer so anyone can check where a number came from.
On this page
Parts 1 to 6 build the model, the contracts, the catalog, the routing order and the tools. None of that proves the answers are right. Two kinds of proof do: evals, which you run before people rely on the answers, and receipts, which you keep for every answer afterward.
Two kinds of proof
An eval is a test: a set of real questions with answers you worked out by hand, run against the whole system. A receipt is a record: for one answer, the route, the request, the definition, the status and the query, kept where someone can check it later. Evals catch problems before launch. Receipts let you trace one number back when someone questions it.
Diagram · Evals and receipts: test the AI route like you test the model
Build the eval set
Start from the question list in part 5. For each question, write down the expected route and the expected result, worked out by hand, not by the system you're testing. Include the traps on purpose: a question with no period, a question about term amounts, a customer that doesn't exist, a period with no data. A good eval set has as many “should refuse” rows as “should answer” rows.
| Question | Expected route | Expected result |
|---|---|---|
| April 2025 net revenue, C-001, P-01 | Tier 1 | COMPLETE, 100.00 |
| Same, by accounting date | Tier 1 | COMPLETE, -20.00 |
| July 2025 net revenue, C-001, P-01 | Tier 1 | NO_RECORDS_IN_PERIOD, no value |
| Net revenue for C-999 | Tier 1 | NO_MATCHED_RECORDS, no value |
| Revenue for all time | Tier 1 tool | Rejected: period required |
| Add up the contract terms as revenue | Decline | Rejected or declined, no number |
Expected answers worked out by hand on the example. A template for your own set, not a scorecard. Example data, not from a client.
I work the expected numbers out in SQL, outside the tool being tested:
-- Expected answers for the eval set, -- worked out by hand in SQL. SELECT SUM(CASE WHEN reporting_date >= '2025-04-01' AND reporting_date < '2025-05-01' THEN amount END) AS april_reporting, SUM(CASE WHEN accounting_date >= '2025-04-01' AND accounting_date < '2025-05-01' THEN amount END) AS april_accounting, COUNT(CASE WHEN reporting_date >= '2025-07-01' AND reporting_date < '2025-08-01' THEN 1 END) AS july_rows FROM revenue WHERE customer = 'C-001' AND product = 'P-01';
| april_reporting | april_accounting | july_rows |
|---|---|---|
| 100.00 | -20.00 | 0 |
Result on the example. Example data, not from a client.
The same checks belong in your build, as tests that run every time the model changes. Guide 7 covers reconciliation tests like these. Here they double as the expected answers.
Score the route, status and value
Score each run on three things, not on wording. Did it take the expected route? Did it return the expected status? If it returned a value, is it the expected value? An answer that says 100.00 by way of free-form SQL fails, even though the number is right, because next month the same route can return 200.00.
A refusal scores as a pass when refusal was expected. A confident number on the “all time” question is the worst result in the set.
Diagram · Eval set and receipt: the template and the record
Run it more than once
The same question can get a different answer on a second run. Microsoft says so plainly in the docs for Prep data for AI, a preview feature in Power BI: Copilot “doesn't always produce the exact same response, even with the same input.” dbt's 2026 benchmark ran each of its 11 questions 20 times for the same reason. Run each eval question several times and report the spread, not the best run.
Tooling exists for this. The Fabric data agent evaluation SDK Preview takes a set of questions with expected answers and runs them against an agent from a notebook. A spreadsheet and a script work too. The set matters more than the tool.
Keep a receipt
Once people are relying on the answers, log one receipt per answer. Here's what one looks like for the April question:
{
"question": "April 2025, C-001, P-01?",
"asked_by": "viewer-role test user",
"route": "tier 1: semantic query",
"request": {
"operation": "recognized_revenue",
"customer_id": "C-001",
"product_code": "P-01",
"date_basis": "reporting",
"period_start": "2025-04-01",
"period_end_exclusive": "2025-05-01"
},
"metric": "net_revenue",
"definition_version": "net_revenue v1.0",
"answer_status": "COMPLETE",
"value": 100.0,
"rows_read": 2,
"query_text": "SELECT SUM(amount) ...",
"answered_at": "2027-02-16T09:30:00-05:00"
}
Every field answers a question someone will ask later. Which route? Which definition, and which version of it? Was it complete? How many rows went in? The rows_read of 2 is R-001 and R-002, the two April reporting entries. If a later version of net_revenue changes the number, the receipt shows which definition produced the old one.
Store receipts where the people who own the metric can read them, and keep them as long as you'd keep the report the number ended up in.
What I check before and after launch
- Does the eval set include trap questions that should be refused?
- Were expected answers worked out outside the system being tested?
- Is each question run several times and scored on route, status and value?
- Does every live answer leave a receipt with route, definition version and status?
Test before people rely on it. Keep proof after.
Related
- Where the receipts go so the next agent finds themProject Wiki
- All 8 parts of this seriesSeries overview
- All the diagrams in one placeDiagrams
- Level 1: Model the data (7 guides)Read level 1
- The 4-question checklistChecklist