AI agent for data analytics: how it works, step by step
Asking your dataAn AI agent for data analytics reads your data, lets code compute, explains the result and checks it. The four steps, the limits, and what to ask first.
Four steps between your question and the answer
An AI agent for data analytics is software that takes a question about your business, finds the numbers that answer it and explains them in plain words. "Agent" here simply means it carries out a job with several steps on its own, instead of replying to a single message the way a chatbot does.
From the outside it looks like one step: you ask, it answers. Inside, a well-built agent goes through four. It reads your data, code computes the figures, the agent explains them, and the explanation is checked before you see it.
Knowing these steps helps you judge any agent you are offered, and helps you ask it better questions. So here they are, one at a time.
Step 1: it reads your data
Everything starts with the records your business already keeps. For a shop or restaurant, that means sales from the POS, the point-of-sale system at the counter, plus stock, purchases, payroll and the accounting books.
A careful agent only reads these records. It does not change a price, delete a bill or place an order. That is the first thing to confirm before you connect anything.
The data is usually copied in on a schedule rather than second by second. So every answer should say which day it is "as of", meaning the last day the figures cover. An answer without a date is an answer you cannot fully trust.
Step 2: code computes the figures
This is the step that decides whether the numbers are right. The sums, averages and comparisons should be done by ordinary code with fixed formulas, not by the AI.
Take gross profit, which is sales minus what the goods you sold cost you. In a good setup it is defined once, with one formula, and every report and every answer uses that same formula. Ask the same question in March and in June and you get a figure worked out the same way both times.
Why not let the AI do the maths? Because a language model writes text by predicting likely words. It can produce a total that looks right, is wrong, and sounds completely sure. Code either computes the figure correctly or fails in a way someone can trace and fix.
Step 3: the agent explains
Only now does the AI come in. It reads the figures that code produced and writes what they mean in plain words.
Here is a made-up example. You ask why one outlet sold less last week. Code returns these figures: RM 42,000 from 1,500 bills last week, against RM 48,000 from 1,600 bills the week before. The average bill, which is sales divided by the number of bills, was RM 28.00 last week and RM 30.00 the week before.
The agent turns that into a sentence. Sales fell by RM 6,000, or 12.5%. Half came from fewer bills: 100 fewer bills at the old average of RM 30.00 is RM 3,000. The other half came from smaller bills: RM 2.00 less on each of the 1,500 bills is RM 3,000.
That is the value of the agent. You did not open a spreadsheet, and you got the reason, not just the total. But notice that every number in its sentence came from step 2.
Step 4: the explanation is checked
Even when code does the maths, the AI could still copy a figure wrongly into its sentence, or round it in a misleading way. So a good agent has one more step: every number in the written explanation is compared with the figures code produced, before you read it.
If they do not match, the explanation is rewritten or held back. In iSenang, every number in the Retail Agent's and Finance Agent's notes is checked against the system's figures, and a note that fails the check twice is not published.
When you test an agent, ask what happens when a check fails. If the answer is "it never fails", keep asking.
What an agent cannot do
It only knows what is in your data. It can see that bills fell at one outlet. It cannot see that the car park was closed, a supervisor was on leave or a new shop opened across the road. You bring that part.
It should not guess. If your data does not cover a question, a good agent says so plainly instead of inventing a number. If a month's books are not closed yet, it should say that rather than report a loss that is not real.
It is not a live till. Because the data arrives on a schedule, it is built for weekly and monthly decisions, not for watching the counter minute by minute.
And it does not decide for you. It can tell you that smaller bills explain half of a drop. Whether to retrain staff, change the menu or wait a week is still your call.
What to ask it first
Start with questions you already know the answer to. Ask for last month's sales, or the outlet you know had a bad week. If the agent agrees with figures you trust, you can trust it with the questions you cannot answer yourself.
Then ask "why" questions, because that is where an agent saves the most time. Why did sales change last month? Why did gross profit change? Which outlet moved the most last week, and was it fewer bills or smaller bills?
Finally, ask something your data cannot answer, such as what a competitor charges. A good agent says it does not know. That one test tells you a lot.
Each of these is a question you can ask iSenang, your AI data analyst. It reads your sales and accounts without changing anything in your systems, the figures come from code with one fixed formula for each measure, and when a question is not covered by your data, it says so instead of guessing.