Sign in

Blog · AI and self-service analytics

Why the model must never do the arithmetic: a design rule for AI sales analytics

The one rule that makes AI analytics safe to put in front of a sales desk or a bank: the language model chooses the calculation and explains the result, and deterministic code computes every figure. Why the alternative fails, and what the rule changes in practice.

The short answerA language model should never compute a figure that a person will act on. It should read the question, pick the calculation, call deterministic code to run it, and explain the result. Every number then comes from a function that can be tested, and the chart and the answer cannot disagree because they call the same one. Models that do the arithmetic themselves produce confident numbers with no provenance, which is worse than no number.

Every vendor now says their analytics product has AI in it. The question a buyer should ask is a narrow one: when the assistant tells me a number, where did the number come from? If the answer is "the model", the product is not safe to put in front of a sales desk, let alone a bank. This article explains the rule that makes it safe, and what follows from it.

The rule

The model never does the arithmetic.

A language model reads the question, decides which calculation answers it, calls a deterministic function to run that calculation on the rows, and explains the result. The model handles intent, tool selection and explanation. Code handles aggregation, ranking, penetration, growth, every figure.

Three things follow immediately.

Every figure has provenance. The answer names the function and its inputs. "Eleven accounts, from accounts_filter(region=NE, growth>0, coverage<0.5)." A reader can check it, rerun it, or disagree with it.

A chart and an answer cannot disagree. The screen that shows coverage by region and the assistant that answers a question about coverage in a region call the same function on the same rows. There is no second calculation to drift.

The floor is deterministic. When the model is rate-limited, over budget or unreachable, the planner still maps common questions to tools and answers correctly. The product degrades to a slower interface, not to silence or to guesses.

Why the alternative fails

Handing a model the rows and asking for a total looks like it works in a demo. It fails in three ways that are invisible until they matter.

It is wrong sometimes and confident always. A model producing a sum is producing the most plausible next token, not performing addition. On small tables it is often right. On real exports it is wrong often enough that nobody can rely on it, and the tone of the wrong answers is identical to the tone of the right ones.

There is no audit trail. When finance asks where a figure came from, "the model said so" is not an answer. A function name with its inputs is.

Permissions live in a prompt. If the model sees all the rows and is told "only answer for this salesperson's clients", the permission is a suggestion. If the scope is applied in the data layer before any row is read, the model cannot leak what it never saw.

What the rule changes in practice

A tool registry becomes the product. Every screen, the planner and the assistant call the same registry of functions: revenue, coverage, penetration, ranking, opportunity detection, risk. Adding a capability means adding a tool, and every surface gets it.

Assertions become the test. The roll-up is asserted on every dataset: region equals teams equals people equals accounts, to the penny. If the identity fails, the data is wrong, and the report says where, before the model sees a question.

The model's job gets smaller and more valuable. It translates "why is the Midwest down" into a call to the coverage trend function with region set to Midwest, then writes two sentences about the result. That is the part a spreadsheet never did, and the part a person with a question actually needs.

A worked example

A salesperson asks: "Which of my accounts grew last quarter but are below fifty percent coverage?"

  1. The model recognises a filter on two measures and a scope of "my accounts".
  2. The scope gate resolves "my" to the salesperson's account IDs, in the data layer.
  3. The model calls accounts_filter with growth greater than zero and coverage below 0.5, then rank by revenue.
  4. The functions return eleven rows.
  5. The model writes: "Eleven accounts. Together they grew 18 percent quarter on quarter and sit at 41 percent average coverage. The three largest are 2291, 0876 and 1140." Every figure in that sentence came from the function output, and the sentence ends with the function names.

If the salesperson clicks through to the coverage screen, the same eleven accounts show the same figures, because the screen called the same functions.

How to check a vendor

Ask three questions.

  1. When the assistant gives a number, does it name the calculation that produced it?
  2. If I ask the assistant and open the dashboard, can the two disagree?
  3. What happens when the model is unavailable?

A product built on the rule answers yes, no, and "it still answers". A product built on the model answers no, yes, and "it stops".

Covirage is built on the rule. The self-service analytics page describes it, and the upload page shows the deterministic half on its own: the validation report and the roll-up on your rows, before any model is involved.

Questions people ask

Can a language model add up a column of numbers?

Sometimes, and you will not know which times. Models are trained to produce plausible text, and a plausible total is not a correct one. On a spreadsheet of a few hundred rows, error rates on sums and rankings are high enough that no finance team would accept them, and there is no way to audit which answers were right.

Doesn't that make the AI part pointless?

The opposite. The hard part of analytics was never the arithmetic; spreadsheets have done that for forty years. The hard part is that the person with the question cannot express it in the tool's terms. The model does that translation, which is the part it is good at, and the tools do the part they are good at.

How do you know the model chose the right calculation?

Because it says which one it chose, and the answer names the tool and its inputs. A reader can see that the question about coverage in the Northeast was answered by the coverage function with region set to Northeast, and can disagree with the choice, which is a conversation about the question rather than about whether the number is real.