Luu Research  /  Case study
Case study · Snowflake Cortex · Public benchmark data

Your Cortex agent is almost right. That's the problem.

The same Snowflake Cortex agent was asked the same 27 business questions twice. The only things that changed were the ones a client controls.

November 2026TPC-H SF1 sample dataCortex Agents + semantic views10 min read
20/27Wizard setup, accepted as is
27/27After definitions were written down
0.13%How far off the wrong 1995 revenue figure was
0Passing questions broken by the fixes

Summary

Set up the way Snowflake's wizard builds it, the agent passed 20 of 27 questions. With the business definitions written down, it passed all 27.

The failures are the interesting part. None of them looked wrong. 1995 revenue came back as $33.22 billion instead of $33.26 billion, off by 0.13%.

That's the kind of number nobody questions in a meeting, and it was still the wrong definition of revenue.

If your team has a Cortex agent in front of business users, this is the risk to check for: answers that are plausible, consistent and quietly built on a definition your finance team doesn't use.

How it was tested

One agent, two versions, one fixed question set.

BeforeAfter
DataTPC-H SF1 (Snowflake sample): 1.5M orders, 6M order lines, 1992 to Aug 1998Same
AgentCortex Agent, Claude Sonnet 5.5, version 1Same agent, version 2
Semantic viewGenerated by Snowflake's Autopilot wizard, accepted as isWritten by hand: named metrics, default meanings, scope rules
Agent instructionsOne line, generic tool descriptionScope, answer style, a tool description that says what the data covers
Questions27, in five groupsSame 27

The question groups are plain lookups, ambiguous business terms ("revenue", "active customers", "biggest customers"), join traps that double-count, questions the data can't answer, and a separate round of breaking changes to the tables.

Scoring was strict and decided before the runs. A number had to match the expected answer at the precision the agent displayed. An answer that offered two candidate figures for the same measure failed, because a business user can't act on "it's either this or that". Six questions about behaviour (empty periods, unknown countries) were judged by hand against written rules.

What the wizard setup got wrong

All seven failures came from the same root: the agent had to guess what a business word meant, and it guessed reasonably but differently from the house definition.

What was askedWhat the agent didWhy it matters
Revenue for 1995, for Q2 1996, by region for 1996Dated revenue by order date, not ship date. On two of the three, it also listed net and gross revenue side by sideFigures were 0.1% to 0.5% off, close enough to pass a casual check
Top parts in 1995, profit by supplier nation, same-nation revenue in AsiaSame order-date choiceRankings and totals that don't reconcile with finance
"How many active customers do we have?"Returned three different numbersNo definition existed, so the agent offered options instead of an answer

What the wizard setup did well matters too. It refused to invent revenue for 2023, said Singapore isn't in the data, and said there is no customer satisfaction data rather than making up a proxy. The problem isn't a careless agent. It's an agent left to make business decisions nobody wrote down.

What changed

The business definitions went into the semantic view, the layer the agent reads before it writes any SQL. Most teams try to fix wrong answers by adding text to the agent's prompt. That puts the rule in a layer that doesn't make the decision, so the fix is fragile.

Gap in the wizard setupWhat the semantic view now saysQuestions fixed
No metrics, so the agent builds formulas on the fly15 named metrics, e.g. net revenue = price × (1 − discount)All seven
"Revenue" undefinedDefault is net revenue dated by ship date; gross only when asked6 of the 7
"Active customer" undefinedOrdered in the 12 months to the latest order date1
One country table shared by customers and suppliersCustomer and supplier geography kept apart2
Data range not stated1992-01-01 to 1998-08-02; "latest" means latest in the dataSharper answers on empty periods

The agent's own instructions changed too: what the data covers, when not to use the tool, and to state the definition it used. Each rule sits in the layer that owns it: meaning in the semantic view, wording in the agent.

Result: all 21 automatically scored questions passed, up from 14, and none that passed before broke.

When the data changed

A well-defined agent is only right until the data moves under it. Three changes that happen in real warehouses were made to the tables, then the improved agent was asked the affected questions again.

ChangeWhat the agent didVerdict
Discount column renamedSaid net revenue couldn't be calculated because a column was missing, and didn't guessGood
A clear stop, not a wrong number
Discount stored as 5 instead of 0.05Noticed revenue had gone negative, rewrote the formula itself, and got the right figure, labelled "provisional"Risky
Right number, but an agent shouldn't quietly change a governed metric
New orders added after the documented end dateTrusted the written "data ends August 1998" and left the new orders outWrong
The documentation went stale

Writing definitions down fixes accuracy. Those definitions then need the same regression tests as code.

A test suite that runs after every schema change or data load is what catches this, not a person reading answers.

Five checks for your own Cortex agent

  1. Ask it for "revenue" for last quarter, then ask finance. If the numbers differ by a fraction of a percent, find out which date and which discount the agent used.
  2. Open your semantic view and count the metrics. If there are none, every answer depends on the agent inventing a formula.
  3. Ask a question with an undefined business term, such as "active customers". One number with its definition is good. Several numbers, or one number with no definition, means the term needs writing down.
  4. Check where your fixes live. If past fixes were added to the agent's prompt, some of them are probably in the wrong layer.
  5. Ask what happens after the next schema change. If nobody re-tests the agent's answers after a column rename or a data load, you'll find out from a business user.

How a client audit goes further

This demo is deliberately simple. Here is where real work differs, and why the audit is built the way it is:

  • The fixes here were written knowing the questions. In an audit, the questions come from your business users, and a held-back set the fixes never see decides the final score.
  • Two layers changed at once here. In an audit, each fix is tested on its own, so you know which change earned which point.
  • The data here is a clean public benchmark. Your warehouse has messier keys, late-arriving data and more ways to be wrong, which is where a regression suite earns its keep.
  • This is one model on one day. Agent behaviour shifts between model versions, so the suite is built to be re-run, not run once.

A naming note: Snowflake announced a separate Business Ontology feature in November 2026, now in private preview. Nothing here uses it. Everything in this test runs on semantic views and Cortex Agents, which are generally available today.

Next in this series: the same questions and definitions on an agent built directly on the Claude API.

Everything published here uses public benchmark data. The demo code (question set, scoring rules and semantic views) is available on request.

Run this on your agent

The same test, with your data and your users' questions.

On Snowflake Cortex or on Claude. A fixed-fee audit: a question set built with your business users, a scored baseline, a fix list placed in the right layers, and a second scored run to show what moved.