AI agents for data analytics: from question to insight
A data agent answers business questions in plain English. It looks at what data exists, writes and runs a query (often SQL), checks the numbers, makes a chart and explains the result as short business insights. Data analysis is one of the most useful jobs for AI agents, as long as it is set up carefully.
Everyday analogy
A smart junior analyst on your team. You ask "Why did profit drop in Q3?". They check which tables exist, pull the right numbers, double-check the totals, make a chart and send you three bullet points. You still review it before it goes to the board.
Example
A manager asks: "Compare Q3 and Q2 revenue by region and flag any region that dropped by more than 10%." The agent lists the tables, writes a SQL query on the sales table, sees that the North region fell 14%, makes a bar chart, and replies with the query it used plus three insights, which the analyst checks before sharing.
From question to insight
- Understand the business question.
- Explore the data: which tables and columns exist, and what the KPIs mean.
- Write and run a query: read-only SQL, so it can never change the data.
- Analyse: trends and outliers, often with Python.
- Show and explain: a chart plus a short summary for the manager.
| Use case | What the agent does |
|---|---|
| Text-to-SQL | Turns questions into database queries and answers |
| Excel cleaning | Fixes types, duplicates and blanks |
| Power BI helper | Writes and explains DAX formulas |
| KPI reports | Sends a weekly summary automatically |
| Anomaly alerts | Flags unusual drops or spikes |
| Data quality checks | Looks for missing values, impossible ranges and stale data |
Rules that keep numbers right
- Give the agent the table descriptions and KPI definitions
- Read-only database access
- Always show the query it used
- Sanity checks: row counts, totals, date ranges
- A human reviews numbers before they go to leadership
Try this prompt
"Compare Q3 vs Q2 revenue by region. Flag any region that dropped more than 10%. Show the SQL you used and write 3 short insights for my manager."
Try it yourself
About 15 minBe the data agent
- Open any spreadsheet you have (or the free messy-sales file in the Clean sales data project).
- Ask an AI chatbot a business question about it, using the "Try this prompt" pattern.
- Check one number by hand and note whether the AI got it right.
What you should see: Good insights fast, and a reminder of why a human always checks the numbers.
Use any free AI chatbot (ChatGPT, Claude, Gemini or Copilot). Never paste private or confidential information.