AI Agent for Data Analysis, Explained: From a Plain-English Question to a Checked Number
AI agent for data analysis explained: how a question becomes a query, why the query must be shown, the checks that catch a misunderstood question, the weekly report, what it must never compute.
Written by Max Zeshut
Founder at Agentmelt
TL;DR: An AI agent for data analysis turns a question in plain words into a query against your warehouse or your spreadsheets, runs it, checks the result against the basics — row counts, totals that reconcile to a known figure, the time window, the definitions — and returns a chart with the query attached so a person can verify it. Its second job is the recurring report: every Monday the numbers pulled, the variances found, the narrative drafted for review. The rule that makes it trustworthy is that the model never computes a number: code runs the query, code does the arithmetic, and the model writes the question, the checks and the explanation. An agent that returns a figure without its query is a chatbot with confidence.
Buildable version: the weekly reporting workflow — numbers pulled, narrative drafted, sent on Monday; a free template and the price to have it run for you.
What the agent does with a question
"How much did we spend on cloud across all entities last year, and with whom?" goes through five steps, and the value is in the middle three:
- Interpret the question into a definition the data can answer: which tables, what "cloud" means in your category taxonomy, which entities, the fiscal or calendar year, the currency.
- State the assumptions back — "cloud = categories AWS, GCP, Azure, SaaS-infrastructure; all four entities; calendar 2025; converted to USD at month-end rates" — because the most common failure of chat-to-SQL tools is answering a different question fluently.
- Generate and run the query against a read-only connection.
- Check the result: does the total reconcile to the ledger's cloud total for the same period; are the row counts plausible; did the time window exclude a partial month; is any entity missing.
- Return the answer with its working: the chart, the table, the query, the assumptions, and the checks that passed.
Step 2 and step 4 are what separate a data-analysis agent from a demo. A person who reads the assumptions catches a misunderstanding in seconds; a person who only sees the number cannot.
What the agent must never do
- Compute a number itself. Totals, variances, growth rates and savings estimates are arithmetic over query results, done by code. A model asked to "estimate" produces a confident figure with no trail.
- Write to the source. The connection is read-only; results go to the BI tool, a sheet or the report, never back.
- Answer without the query. If the working cannot be shown, the answer is not delivered.
- Invent a definition. "Active customer" means what the data dictionary says; if there is no dictionary, the agent states the definition it used and the report owner fixes it once.
The recurring report
Most of the value of a data-analysis agent is not ad-hoc questions; it is the report someone assembles every Monday from the same queries. The weekly reporting workflow:
- Runs every metric from a catalogue — each defined once, with an owner and a target.
- Assembles the table: this week, last week, same week last year, target; deltas and flags for metrics outside their tolerance band.
- Pulls context — releases, campaigns, incidents, holidays — from the calendar, the changelog and the incident tracker.
- Drafts the narrative from the table, the context and last week's approved report: the three biggest moves with likely causes, phrased as likely and tied to an event; where no event exists, the narrative says the cause is unknown.
- Renders the report and a Slack-length version; the owner approves or edits; edits are kept for next week's context.
- Distributes and archives.
The guardrail that matters: every number in the narrative must appear in the metrics table. The agent cannot introduce a figure, only explain one.
Accuracy: what to expect
| Task | Reliability | The check |
|---|---|---|
| Generating the query for a well-defined question | High | Runs, returns plausible counts |
| Interpreting an ambiguous question | Medium — this is the risk | Assumptions stated; a person reads them |
| Reconciling a total to a known figure | High when the known figure exists | The check is part of the workflow |
| Explaining a variance from context | Medium — plausible, not certain | Phrased as likely; tied to a named event |
| Computing anything | Not the model's job | Code does it |
Chat-to-SQL benchmarks quote accuracy figures that depend entirely on how clean the schema and the question are. In a real warehouse the honest measure is how often the stated assumptions were the intended ones — which the report owner sees every week.
What it needs
A read-only connection to the warehouse (BigQuery, Snowflake, Postgres) or to the sheets; a data dictionary, even a short one — the definitions of the twenty terms people ask about; a metric catalogue for the report; and one owner who reads the assumptions. Warehouses that need new models before a question can be answered are a data-engineering project first; the agent does not fix a schema.
Cost
As an installed workflow, the weekly report is $197 a month per report with up to thirty metrics from up to five sources, or $249 one-time installed in your own tools; board decks with custom charts and multi-team roll-ups are a custom build. The ad-hoc question agent is built on the same connection and catalogue. Against an analyst's Monday, the report pays for itself in the first week; against the analyst, it is not a replacement — it is what gives them the rest of the week.
Questions, answered
How does an AI agent do data analysis?
It interprets a plain-English question into a definition the data can answer, states its assumptions, generates and runs a read-only query, checks the result against known totals and plausible counts, and returns the chart with the query and the checks attached. For recurring reports it runs a metric catalogue weekly and drafts the narrative from the numbers and the week's events, for the owner to approve. The model writes the question and the explanation; code computes every number.
How accurate is an AI data analysis agent?
Reliable at generating a query for a clear question and at reconciling a total to a known figure; the risk is an ambiguous question interpreted differently from what was meant. That is why the agent states its assumptions with every answer and why the report owner reads them — a misunderstanding is caught in seconds when the working is shown and never when only the number is.
Can a data analysis agent write to our database?
It should not, and the workflows here use a read-only user that can query and nothing else. Results are written to the BI tool, a sheet or the report. Data migration is a separate workflow with its own confirmation steps.
What is the difference between a data analysis agent and a BI dashboard?
The dashboard answers the questions someone anticipated; the agent answers the follow-up nobody built a chart for, and drafts the narrative the dashboard cannot. Most teams keep the dashboard for the known metrics and use the agent for the questions and the Monday report.