AI implementationTomasz Stępnik · a developer, not a slide deck

Reports · AI · 6 min read

The Monday report that assembles itself: anatomy from source to inbox


The Monday report is the most common first AI project in a small company, because it is measurable: you know how long it took, and you can see when it arrived. Here is what it is made of, step by step.

The starting point

The example I will use (an illustration, not a specific company): on Monday morning the sales manager opens the CRM, exports last week’s opportunities, opens a spreadsheet with the targets, a second spreadsheet with campaign leads, builds a table out of them, writes five sentences of commentary and sends it to management. Three hours, every week.

That report can be assembled automatically. Not because AI is clever, but because the report has a fixed structure. AI does one thing in it: it writes the commentary.

1. Sources

We write down where every figure comes from: which object in the CRM, which filter, which spreadsheet, which tab. Often two spreadsheets count the same thing differently; we agree which one is the “truth”, and the other stops being a source.

Sources have to be machine-readable: the CRM through its API, spreadsheets through the Google or Microsoft APIs, a database through an SQL connection. A file someone emails on Friday is not a source; it is another manual task.

2. A read-only account

The report does not run on the manager’s account, nor the administrator’s. It gets its own account in every source, read-only, limited to the objects and fields it needs. In the CRM that is a separate user with its own permission set. In the database it is a user with SELECT on specific views, not on tables. In a spreadsheet it is “can view” sharing.

A script that can only read cannot do damage, even if it is changed badly or its credentials leak. More in the article on the read-only account.

3. The query

A query counts the figures: a CRM report, an SQL query, a spreadsheet formula. Not a language model. The model is good at writing and poor at arithmetic.

The query returns a table: this week, last week, target, differences. That table appears in full in the report, below the commentary. Anyone can check it.

4. The AI commentary and its rules

The model receives the table and an instruction. The instruction is specific and written down, because it will be revised:

  • Write only about figures that are in the table. Do not introduce others.
  • Point out the three largest changes against last week and against target.
  • Do not invent reasons. If the data does not say why something fell, say that it does not.
  • Length: five sentences. Tone: as in the three attached past reports.
  • If the table is empty or has fewer rows than usual, do not write commentary. Say that something is wrong with the source.

We set these rules on the prototype by comparing AI’s commentary with what the manager would have written. Usually after three or four revisions of the instruction the difference stops mattering.

5. Verification

Before the report goes out, a second step checks the commentary: every number in the text must appear in the table, every name (product, region, salesperson) must be in the data. If not, the report does not go out, and the responsible person gets a warning with the commentary and the table. It is a simple step that deals with most of the worry about “making things up”.

6. Delivery

An email to a distribution list, a message on the team channel, a PDF in a Drive folder, a row in a history spreadsheet. At a fixed time. The email subject carries the date and one headline figure, so you can tell from the inbox whether it is worth opening.

7. What breaks

What happenedSymptomSafeguard
Someone renamed a field in the CRMThe query errors or returns an empty columnAn alert instead of a report; no report goes out full of zeros
A spreadsheet was moved or a tab renamedData from one source is missingRow count checked against previous weeks
An access token expiredThe script cannot log inAn alert; the token expiry date in the maintainer’s calendar
The vendor changed the modelThe commentary changes tone or lengthModel version pinned; changes made deliberately, with a test
A bank holiday weekFigures far lower, commentary “raises the alarm”A holiday calendar in the model’s instruction

8. Who watches

An automatic report still needs someone to look after it, but that takes fifteen minutes a month instead of three hours a week: the maintainer reviews the run log and alerts and reads a few commentaries in a row to check they still make sense. For the first month the manager who used to assemble the report does the same; they will spot a problem fastest.

If someone at your company assembles a report like this every week, this is how a recurring reports project goes: from a call and a sample report to a month of observation.