AI agent for reporting: automate the numbers and draft the narrative
Why the numbers must come from code, not the model
Language models are good at writing a sentence about a change and unreliable at arithmetic across many rows. If the model adds up sales, works out a percentage or picks the top ten products, a small error can reach a board paper and nobody notices. Let ordinary code compute every figure, store the results in a table, and give the model only that table to describe.
Keep a clear line between the two. The code owns the number, its definition and its source. The model owns the sentence. If a draft mentions a figure that is not in the table, the check should reject that draft before a person ever sees it.
The pipeline: extract, compute, check, draft, review
A reliable reporting agent runs the same five steps every time, and each one can be tested on its own.
- Extract: pull the data on a schedule from each source, such as an accounting export, a CRM report, an advertising account or a point-of-sale system.
- Compute: code calculates totals, changes against the previous period and the biggest movers, and writes them to a table.
- Check: validation rules look for missing days, duplicate rows and totals that do not match the source. A failed check stops the run and alerts a person.
- Draft: the model receives the verified table and the metric definitions, and writes the narrative in your house style.
- Review: a manager reads the draft, corrects anything wrong and approves it before it is sent.
Explaining what changed, without guessing why
The hardest part is the reason behind a change. A model is tempted to invent a cause that sounds plausible. Give it a fixed list of known drivers, such as a promotion, a price change, a stock shortage or a public holiday, taken from a calendar or a log your team already keeps. Each explanation should point to its source.
If no driver is recorded for a change, the draft should say that the cause is unknown and suggest what to check. A confident explanation with no source is the most dangerous line in a monthly report, so treat it as a defect.
Data definitions and the scheduling trap
Most reporting errors are definition errors. Does revenue include refunds? Is a customer counted once per month or once per visit? Write each metric definition down once, and have the agent read from that document rather than from habit. Changing a definition quietly breaks every comparison with past reports.
Check timing as well. A report scheduled before the nightly sync finishes runs on yesterday's data and still looks plausible. Run the agent only after the source has finished updating, and show the data date at the top of every draft.
Mistakes to avoid
Test the whole pipeline on last period's report. Compare the agent's figures with the figures your finance team has already signed off, and investigate every difference before you trust the agent with a live report.
- Letting the model calculate totals, averages or percentages.
- Publishing without a review step because the draft reads well.
- Changing a metric definition without versioning it, which breaks comparisons.
- Ignoring access rights, so a regional manager sees figures they should not.
- Judging the agent by how polished the text sounds rather than by whether the numbers are right.
How Hundred Seas helps
Hundred Seas is a product studio in Taipei. We build AI agents and AI CRM systems on Claude and on OpenAI models, and we choose the model for each task on cost, speed, quality and where the client's data has to stay. For reporting work we keep the calculations in ordinary code and give the model only the writing role, so every figure in a draft can be traced to its source.
A project begins with a scope step of about one week at a fixed price, which ends in a written plan and a firm quote. The software is then built in weekly releases, and a monthly run plan keeps the data connections and the pipeline working as your sources change.
Questions
- Can an AI model write my monthly report from raw data?
- It can draft the commentary, but it should not calculate the figures. Let code compute the totals and changes, then give the model a verified table to describe. A person checks the draft against that table before it goes to managers. This keeps every number traceable to its source.
- How do I stop the agent from inventing reasons for a sales change?
- Give it a fixed list of drivers from a log your team already keeps, such as promotions, price changes and holidays. Instruct it to say the cause is unknown when no driver is recorded. A sentence with no source should be removed at review.
- Which data sources can a reporting agent read?
- Most agents read exports or connections from accounting software, CRM platforms, advertising accounts, point-of-sale systems and spreadsheets. Check each tool's current export and API documentation, and confirm that the access permissions match what your staff already have before you connect anything.
- What checks should run before a report goes out?
- Check that every expected day, store or region is present, that no rows are duplicated, that totals match the source, and that the reporting period is correct. If a check fails, stop the run and alert a person. Never let the model fill a gap with an estimate.
- How often should a reporting agent run?
- Match the schedule to when the data arrives. Many teams run the agent after the nightly sync and before the morning meeting. Make sure each source has finished updating, or the report will look plausible while being out of date.