TL;DR
AI agents can query your data warehouse in plain English, but only reliably when governed definitions connect human language to your actual schema and the SQL is generated in a way you can check. This guide explains the architecture, the failure points, and how to turn AI insights from the warehouse into decisions.
TL;DR
AI agents can query your data warehouse in plain English, but only reliably when governed definitions connect human language to your actual schema. Without them, the agent guesses at column names, invents metric definitions and returns answers that look correct but aren't. This guide explains the full architecture: what happens between your question and your answer, where the failure points are, how governance carries through, and how to turn AI insights from the warehouse into decisions.
Most analytics tools now offer a chat bar. Type a question, get a chart. The demo looks smooth. The production reality is different.
The gap between "AI can query your warehouse" and "AI reliably answers your product questions" comes down to one architectural problem that many vendors skip over: raw warehouse tables have no inherent meaning. A column called ev_ts could be an event timestamp or a TV series rating. A table called usr_actions could contain clicks, purchases or support tickets. Your data team knows what these mean. An AI agent, querying cold, does not.
This guide explains how AI agents work when querying a data warehouse, where they fail, and what the right architecture looks like for teams who need answers they can trust. It uses Mitzu as the concrete example throughout. Mitzu is an analytics platform on your data warehouse for BI, product analytics and experiment analysis, where the data team governs the metrics and everyone uses them through dashboards, an AI agent, Slack and their own AI assistants.
Who should prioritize AI on the warehouse?
- Strong fit: companies with stable warehouse models and recurring decision bottlenecks across product, growth and revenue teams.
- Strong fit: data teams that want to shorten the request queue without lowering analytical rigor.
- Weak fit: teams with unresolved KPI definitions and fragmented ownership.
- Weak fit: organizations expecting AI to replace data governance fundamentals.
What it actually means for an AI agent to "query your warehouse"?
When you ask an AI analytics tool "what was our 30-day retention for users who completed onboarding last quarter?", two distinct things happen in sequence.
Step 1: Natural language to SQL. The AI interprets your question, maps it to schema elements (tables, columns, filters, aggregations), and produces a SQL query. In most tools this is the NL-to-SQL step, the one that gets demoed at conferences.
Step 2: SQL to warehouse execution to answer. The query runs against your warehouse. The result comes back and is formatted into a chart or a number.
Step 2 is straightforward. Step 1 is where nearly every production deployment runs into trouble.
The NL-to-SQL step requires the AI to answer questions your data model doesn't state explicitly:
- Which table contains user events?
- Which column identifies a unique user?
- Which events count as "completing onboarding"?
- How is "30-day retention" defined: calendar days or a rolling window?
- Which users should be excluded, such as internal and test accounts?
A capable LLM will make reasonable guesses. On a clean, well-named schema with a handful of tables, those guesses are often right. On a real production warehouse, with dozens of event tables, snake_case column names, legacy prefixes and business-specific metric definitions, the guesses are often plausible but wrong.
The result is the most dangerous kind of analytics failure: a confident answer that looks correct but isn't.
Here is what the flow looks like in a tool built to handle this. When a product manager asks Mitzu "what was our 30-day retention for users who signed up via organic last month?", the question is not sent to an LLM with a raw schema dump. The agent maps it to the definitions in Mitzu's semantic layer: what the retention metric means, which property holds the acquisition channel, which value is "organic" in your data. From those it builds an analysis specification (cohort, return event, window, filter), and a deterministic engine, not the language model, turns that specification into SQL.
The query runs in your warehouse, and you get the answer together with the exact SQL that produced it. The same question gives the same SQL tomorrow.
Why raw text-to-SQL breaks on product data specifically?
General-purpose text-to-SQL systems have a harder time with product event data than with transactional or financial data. Here's why.
Event tables are structurally ambiguous. A page_viewed event carries a user ID, a timestamp, a URL and a set of properties. None of those properties have universally agreed meanings. Whether properties.source maps to your acquisition channel or your internal routing depends entirely on how your engineers instrumented it. An AI agent has no way to know without being told.
Business concepts don't map one-to-one to columns. "Activation" is not a column. It is a computed concept, perhaps the completion of three specific events within seven days of signup. "Monthly active user" could mean any event, or only a specific subset. "Churned" could mean 30 days without a session, a subscription cancellation event, or both. An LLM generating SQL from scratch has to guess at all of this.
Analysis methods are not SELECT statements. A funnel needs per-user step ordering and a conversion window; retention needs cohort bucketing and a return event. An LLM writing that SQL freehand can drop the window or double-count users, and the query still runs.
Schema drift compounds the problem. Event schemas change as products ship new features. Columns are renamed, new event types are added, old ones are deprecated. A text-to-SQL model prompted on last month's schema may generate valid SQL that returns wrong answers on this month's data.
A 2026 analysis of enterprise NL-to-SQL deployments found that while models can reach 80%+ accuracy on standardized benchmarks, production accuracy drops sharply when questions involve multi-step business logic, ambiguous column semantics or cross-table joins, which describes most real product analytics questions. For the full comparison, see analytics agents vs text-to-SQL.
The missing layer: semantic context
The solution is not a smarter LLM. It is a layer of structured business context between the AI and the raw warehouse schema.
This is what the industry calls a semantic layer: a mapping of business concepts to the data structures that implement them. It answers the questions that raw SQL can't:
| Human concept | Semantic layer definition |
|---|---|
| "activated user" | completed onboarding_completed event within 7 days of user_created |
| "30-day retention" | returned session within 30 days of first session, rolling window |
| "acquisition channel" | utm_source from first session, with fallback to referrer_domain |
| "churned" | no session in past 30 days AND no active subscription in subscriptions table |
| "product-qualified lead" | reached activation AND plan = 'free' AND company_size > 10 |
With a semantic layer like this, the agent doesn't need to guess what "activated user" means; it looks up the definition. If the definition changes, for example because engineering updated the onboarding flow, the semantic layer is updated once and every later answer reflects the change.
This is also why tools like dbt Semantic Layer and Cube exist: not to make SQL easier to write, but to keep business logic consistent across every system that consumes your data, including AI agents.
Mitzu's semantic layer holds metrics on fact and dimension tables, plus events, entities, properties and sampled property values. Its Configuration Agent scans the warehouse for event and dimension tables, identifiers and property values; Mitzu drafts metric definitions from the warehouse and dbt models, inheriting definitions already in dbt; and the data team reviews and owns the result. When a PM asks a question, the agent works within those definitions. It cannot invent a metric that hasn't been defined, and filters use values that exist in the data. That constraint is the mechanism that keeps answers trustworthy at scale. See Mitzu's semantic layer.
How warehouse-native analytics makes AI querying reliable?
The architecture matters as much as the semantic layer. There are two fundamentally different ways an AI tool can give you answers from warehouse data:
Copy-and-process architecture: a copy of your events is synced to the analytics tool's own database, and the AI queries that copy. This is how most traditional product analytics tools work, including some with warehouse connectors.
Direct-query architecture: the tool connects to your warehouse and runs queries against the data in place. No copy is made. This is what warehouse-native tools like Mitzu do.
The difference matters for AI reliability in two ways.
First, freshness. Copied data is always behind the warehouse. If the sync runs every six hours, an agent answering "why did signups drop this morning?" is working with stale data. In a direct-query architecture, the answer reflects whatever has landed in the warehouse when you ask, so freshness depends only on how often your own pipelines load data.
Second, governance. When data is copied to a third-party system, your warehouse access policies don't carry through. Columns that are masked or row-level-secured in Snowflake or BigQuery can sit in full in the tool's copy. In a direct-query architecture, those warehouse policies apply to every query the tool runs.
| Architecture layer | Copy-first analytics stack | Dashboard-only stack | Warehouse-native with governed definitions |
|---|---|---|---|
| Data freshness | Behind the warehouse by the sync interval | Depends on refresh schedules | Queries the warehouse as it is |
| Definition consistency | Medium: a second set of definitions | Medium to high for predefined views | High: one set of definitions owned by the data team |
| Explainability | Low to medium | Medium | High: SQL shown with every answer |
| Self-service across teams | Medium | Low to medium: new questions need new dashboards | High when governance is built in |
| Best fit | Product teams living inside one tool | Executive dashboard consumption | Fast, trusted decisions for every team |
When the two combine, governed definitions that describe business concepts and a direct-query architecture that runs governed SQL against live data, you get an architecture that makes AI analytics trustworthy.
What kinds of product questions can AI reliably answer?
Not every question is equal. Here's a realistic map of reliability today, given well-maintained definitions:
| Question type | Reliability | Notes |
|---|---|---|
| "What was our 7-day retention last month?" | High | Single metric, well-defined window |
| "Show me the funnel from signup to activation, by cohort week" | High | Multi-step, but deterministic once defined |
| "Which features correlate with 90-day retention?" | Medium | Correlation is computable; causation needs human judgment |
| "Why did our activation rate drop 12% last Tuesday?" | Medium to high | Needs a multi-step investigation rather than one query; a good agent breaks the change down and points to likely causes for a person to confirm |
| "What should we build next to improve retention?" | Low | Strategic judgment, not an analytics computation |
| "Which users are at risk of churning this month?" | Medium to high | Depends on how "churn risk" is defined in the semantic layer |
| "Compare retention for users acquired via paid vs. organic in Q1" | High | Segmented metric, well-scoped |
The pattern: questions on well-defined metrics return reliable answers. Diagnostic questions need an agent that investigates, breaking the change down by segment, channel and funnel step, rather than one that returns a single chart. Strategic questions still need human judgment; AI speeds up the analysis behind them, not the decision.
This is a useful filter when evaluating any AI analytics tool. Ask your vendor: "Can you answer this specific question against my actual schema?" Then inspect the SQL. If the SQL is wrong, or the vendor won't show it, the reliability story is incomplete.
Mitzu shows the SQL behind every answer, one click from the result rather than buried in a debug panel. Product managers shouldn't have to trust a black box, and data teams shouldn't have to audit answers they can't inspect. When a number looks wrong, you open the query, find the issue and fix the definition, and every later answer uses the fix. More on this in AI analytics hallucinations and SQL transparency.
Example: a product and growth planning question
Take a common SaaS planning question: did activation gains from the new onboarding flow increase paid conversion, or did the effect come from a change in channel mix? In a dashboard-only setup, this takes several handoffs and a custom analysis thread. With an agent on governed definitions, the team can work through it in one conversation: slice activation cohorts, split by channel source, change the conversion window, and check each step's SQL along the way.
The advantage is not only speed. It is continuity. Product and growth see how definitions and joins shape the conclusion, which cuts down re-litigation in planning meetings, and new stakeholders can follow the logic because it is explicit rather than hidden inside a dashboard.
"AI insight quality depends less on how eloquent the model is and more on whether your organization can verify each answer path."
Practical setup: what you need before AI can query your product data
Teams that get AI analytics working reliably in production have usually done four things before turning on the AI layer.
- Clean event schema with agreed naming conventions. Events should have consistent names (
user_signed_up, notsignup_evin one table anduser.registerin another), and properties should be documented. It doesn't need to be perfect, but a person should be able to explain what each event means. - Core metrics defined in a semantic layer. The five or ten metrics that matter most, such as activation rate, 7-day retention, funnel conversion, MAU and net revenue, should be formally defined and owned by the data team. This is the work many teams skip and then blame the AI tool for.
- Warehouse access with appropriate permissions. The tool needs read access to the relevant tables. In a direct-query architecture, row-level security and masking policies apply to its connection. Verify this before assuming it.
- A review process for high-impact answers. Even with good definitions, some answers will be wrong or misread. The right model is neither "trust every answer" nor "approve every query": routine questions on governed metrics flow freely, and high-impact numbers, such as financial or board-facing ones, get analyst sign-off before they are shared.
Teams that skip step 2 report the most reliability problems. The AI is not at fault; it amplifies the lack of a shared definition that already existed. The good news is that adding an AI layer often forces the metric definition conversation data teams have been deferring for years.
A first-quarter rollout sequence
- Pick one high-value use case with stable definitions, for example activation conversion or retention risk.
- Name a definition owner and an analyst review owner before the pilot starts.
- Require the SQL to travel with every answer shared beyond the person who asked.
- Track acceptance and correction rates weekly and publish them.
- Expand to adjacent domains only while those rates stay healthy.
The order matters because most failures are scaling failures, not pilot failures. Teams that launch widely too early run into inconsistent interpretations and lose business confidence; teams that expand in stages build trust faster.
Limitations to communicate internally
AI does not remove the need for clean modeling. If source entities are inconsistent, the agent can expose the inconsistency but cannot settle ownership conflicts. Treat the rollout as a forcing function for clear definitions, not a shortcut around data quality work. There is also a behavioral limit: broad prompts produce broad answers.
Share example questions and escalation templates so business users learn to ask scoped, decision-oriented questions.
From insight to decision
Many teams overinvest in generating insights and underinvest in acting on them. A reliable workflow names who receives an insight, what threshold triggers action, and how the follow-up is measured. Without that, even good insights become interesting artifacts rather than operational improvements.
A practical method is to pair each recurring insight class with an action owner. If retention risk spikes in a segment, product owns the intervention. If acquisition efficiency drops, growth owns the channel response. If metric discrepancies appear, data owns validation and the definition fix. Recurring checks don't have to wait for someone to ask: Mitzu's monitoring agents review a dashboard or KPIs on a schedule and email the team on every run, or only when a condition you describe in plain English is met, with the analysis attached.
Postmortem questions for a wrong AI insight
- Was the source metric definition stable and owned?
- Did the question include a clear time window and segment bounds?
- Was the SQL reviewed before the insight was shared?
- Did recipients understand the confidence level and what decision it was meant to inform?
- Which definition change prevents a repeat?
The governance question: who controls what the AI can see?
One question enterprise buyers ask immediately on hearing "AI can query your warehouse" is: what stops it from seeing data it shouldn't?
In a copy-based architecture, the answer is usually the analytics tool's own access controls, which are separate from your warehouse policies, need to be configured separately, and are often incomplete for complex permission models.
In a direct-query, warehouse-native architecture, part of the answer is the controls that already govern your warehouse. The tool queries through credentials your data team sets up, so a column masked for that role in Snowflake stays masked, and row-level security policies in BigQuery restrict what the tool's queries return. The other part is the tool's own roles, which decide what each person can see inside it.
This is not a minor detail. For any company handling personal, health or financial data, the governance gap in copy-based architectures is a real compliance risk. It is also a procurement question: security teams increasingly ask "where does the AI run?" in vendor reviews. "On your warehouse, under your existing policies" is a much cleaner answer than "on a copy in our cloud."
In Mitzu, queries run in your warehouse through the connection your data team configures, so masking and row-level security policies defined in Snowflake, BigQuery or Databricks apply. There is no Mitzu-side copy of your data. On top of that, Mitzu roles decide what each person sees, and they follow that person to dashboards, the in-app agent, Slack, MCP clients and scheduled agents. Nobody needs a warehouse account, and every query is logged with user identity, timestamp and the full SQL. See data governance in Mitzu.
FAQ
What is the difference between text-to-SQL and an AI agent querying a warehouse?
Text-to-SQL converts a natural language question into one SQL query. An AI agent goes further: it plans the analysis, runs it, checks the result and may take more steps, like drilling into a sub-question, before returning an answer. Whether the agent writes the SQL itself or hands an analysis specification to a deterministic engine decides whether the same question gives the same answer.
Why does AI analytics need a semantic layer?
Because warehouse tables don't carry their own meaning. Column names, event types and table structures encode business logic, but that logic lives in the heads of the data team, not in the schema. A semantic layer makes it explicit and machine-readable, so an agent can answer without guessing what your business concepts mean.
What are AI insights from a data warehouse?
Answers an AI agent produces from live warehouse data, using governed definitions and query logic you can check, rather than from static dashboard snapshots or a copied event store.
Can I use ChatGPT or Claude directly to query my warehouse?
General LLMs can write SQL from natural language, and with the right MCP setup they can run it against your warehouse. The limits are governance and consistency: connected straight to the warehouse, the assistant writes its own SQL for every question, without your metric definitions or permissions, so two people can get two different revenue numbers. For ad-hoc technical exploration that can be fine. For team-wide self-service, connect the assistant to a governed backend instead; Mitzu's MCP server lets Claude, ChatGPT, Cursor and GitHub Copilot answer from your governed metrics.
Does the AI see all my data?
In a warehouse-native architecture, queries run with the permissions of the connection your data team configures, and warehouse policies apply to them. In Mitzu, roles then decide what each person can see, in every surface. Nothing is copied out of the warehouse, you decide whether query results are sent to the model, and your data is never used to train AI models. In copy-based architectures, data is transferred to the vendor's systems and governed by their access model separately from your warehouse.
How long does it take to set up AI on warehouse data for product analytics?
Connecting a warehouse-native tool is quick. The longer part is the definitions, and how long they take depends on what your team has documented already. In Mitzu, the Configuration Agent scans the warehouse and Mitzu drafts metric definitions from your tables and dbt models, so the data team reviews rather than authors from scratch. Teams with well-maintained dbt models move fastest; teams starting from scratch should plan time to agree on their core metrics.
How quickly can a team see value?
Most teams see early value from a scoped pilot on one domain, then expand once acceptance rates and review habits are stable.
What questions should I ask any AI analytics vendor during evaluation?
Four questions cut through most demos: (1) Show me the SQL for this specific question against my actual schema. (2) Does the language model write that SQL, or does an engine generate it from a specification? (3) Where are metric definitions kept, and who owns them? (4) Where is my data processed: in my warehouse or on your servers? For the full framework, see evaluating AI analytics agents for enterprise data.
Key Takeaways
- An AI agent answers from your warehouse in two steps: turning the question into SQL, then running it. The first step is where reliability is won or lost.
- Raw text-to-SQL breaks on product data because event tables carry no inherent meaning, and business concepts like "activation" and "churn" must be defined explicitly.
- Governed definitions that the data team owns are the prerequisite for reliable AI analytics, not an optional extra. Having a deterministic engine, rather than the model, write the SQL makes answers repeatable.
- Warehouse-native, direct-query architecture keeps your warehouse policies in force and reads live data; copy-based architectures do neither.
- AI reliably answers questions on well-defined metrics, funnels and retention, and a good agent can investigate why a number moved. Strategic judgment still belongs to people.
- Insights only pay off with action owners: pair each recurring insight with the team that acts on it, and let scheduled agents do the watching.
How to get started with Mitzu?
Mitzu connects to Snowflake, BigQuery, Databricks, Redshift, ClickHouse and other warehouses. Your data team reviews the definitions Mitzu drafts, and everyone can then ask questions in plain English. Queries run in your warehouse, and the SQL is always visible.
- Connect your data warehouse: point Mitzu at your warehouse with read credentials.
- Review your definitions: the Configuration Agent indexes events, entities and property values, and Mitzu drafts metrics such as activation or net revenue for your data team to review.
- Start analyzing: ask questions in plain English, inspect the SQL behind every answer, and put a monitoring agent on a dashboard to email the team when a KPI moves.
Start free on your warehouse, or book a demo and see it on your own data.
