The hard question is what revenue means

A business intelligence agent promises a useful interaction: ask why a number changed and receive an explanation with supporting data. The technical challenge starts before SQL generation. Does revenue mean invoiced, recognised or collected revenue? Which exchange rate applies? Are cancelled accounts included? A query can execute perfectly and still answer the wrong business question.

Begin with a decision that recurs: a weekly commercial review, an operational backlog or a customer retention discussion. Collect the questions people already ask and the approved answers analysts produce. That gives the agent a clear scope and gives the data team something concrete to validate. A focused assistant can become useful while the wider warehouse continues to evolve.

Build on a semantic layer

Architect scale aligned with a crystal reference block

A semantic layer exposes agreed measures, dimensions, filters and relationships. It connects business vocabulary to maintained calculations. Document grain, valid joins, time conventions and ownership. Where the question is predictable, let the agent request a metric through a typed tool and generate the SQL deterministically. More open exploration can use constrained SQL over curated views.

Snowflake’s verified query repository illustrates a useful pattern: pair a business question with SQL that has been checked, and use relevant examples to guide future requests. Its April 2026 release added verified queries to semantic views. The broader design lesson applies across platforms: reviewed definitions and examples should be maintained assets, with an owner and a change process.

Separate interpretation from access

The language model can help interpret intent and explain results. Database roles, row access policies and the query service should enforce what it can read. Use read-only credentials, restricted datasets, query timeouts and resource limits. A prompt asking the model to behave carefully does not replace those controls. Log enough to diagnose a result without creating an unnecessary copy of sensitive data.

Show the measure definition, filters and freshness alongside the answer. When a question is ambiguous, ask whether the user means gross margin or contribution margin before calculating it. When explaining a change, distinguish an observed association from a causal conclusion. A segment breakdown can reveal where a difference sits; establishing why it happened may require additional evidence.

Test the answer as a business result

Brass combination latch on a leather document case

Keep a reviewed question set covering calendar boundaries, missing values, duplicate rows, permission differences and misleading joins. Compare the resulting tables and aggregates with an analyst-approved reference. Snowflake’s evaluation documentation describes executing generated SQL and checking results against verified queries. It also removes selected evaluation examples from the runtime context, a useful safeguard against testing memorised answers.

Monitor correction rates, analyst handovers, response time and whether colleagues can make the intended decision. Add new approved questions as usage reveals gaps. The outcome is a governed route into existing business intelligence: faster access to trusted measures, explanations people can inspect, and less repeated interpretation work for the data team. Sustainable adoption depends on owning the definitions as carefully as the interface.

Sources & further reading

Written by Gilles Jacobs, AI & data engineering consultant at Exverbai.