The AI highlights: what they say and how they’re checked
A few AI-written lines at the top of each digest point out what to act on first. Here’s what the model sees, what it writes and how it’s checked.
The highlights are a few short lines at the top of the daily digest that point out what to act on first. An AI model writes them from that morning’s numbers, and StockDigest checks them before anyone sees them. The forecast itself doesn’t use AI.
Where you see them
They sit near the top of the digest email, at the top of the dashboard as “Today’s highlights”, and in each saved digest in Digest history. Wherever they appear, they’re labelled “Written by AI from today’s numbers.”
They’re written once a day with the digest, so the dashboard shows them after that day’s digest is built at your digest time.
What the model receives
StockDigest works out the facts first and gives the model a short list: product and supplier names, location names (Pro stores with 2 or more locations), and numbers such as stock, sales per day, days left, lead time, reorder amounts, stock on the way and counts.
The model never receives customer data, individual orders, prices, your store’s name or the addresses on your digest list. StockDigest doesn’t store customer data at all: see Your data.
The model is Google’s Gemma, running on Cloudflare Workers AI. The facts only cover products already in that day’s digest.
What the highlights say
At most one line per kind of fact, in this order, skipping kinds with nothing to say:
| Kind | When it appears |
|---|---|
| Losing sales now | A product that was selling is out of stock. |
| Order first | A product will run out before a new order could arrive. Gives days left, lead time, the reorder amount and any stock on the way, soonest first. |
| One order to a supplier | Two or more products from the same supplier need reordering. |
| Selling faster | This week’s sales per day are at least 1.5 times the 4-week average, with at least 3 sold this week. |
| By location | Products are short at one of your locations (Pro), with one suggested transfer if there is one. |
| Not selling | Products in stock with no sales in your not-selling window, biggest piles first. |
The model is told to use only these facts, copy numbers exactly instead of calculating, keep product names as written and name at most 3 products per line. The lists below the highlights have the rest.
When products are flagged but none needs ordering and nothing else stands out (for example, low-stock products already covered by stock on the way), the highlights are one line saying nothing needs ordering today.
Days without highlights
On a day with nothing to report (nothing flagged, nothing in the not-selling list, no location short), no email is sent and the AI isn’t called. That day’s digest is still in the app.
On other days the lists already say everything worth saying, and StockDigest leaves the highlights out without calling the AI.
How they’re checked
Before the highlights are saved, StockDigest checks the model’s answer:
- It has between 1 and 6 lines, none longer than 300 characters.
- Every number in it appears in the facts StockDigest sent.
- Every product name in bold is one of the product names it sent.
- It contains no percentages. The facts never include any, so a percentage would be the model’s own arithmetic.
If any line fails, all of that day’s highlights are dropped and the digest goes out without them. The same happens if the AI service doesn’t answer. The next day’s digest tries again.
The check catches numbers and bold product names that weren’t in the facts. It can’t confirm that each number sits next to the right product, which is one reason the highlights carry the AI label. If a line ever reads oddly, go by the lists below it.
The forecast isn’t AI
Days left, statuses and reorder amounts come from plain math on your sales, explained in How forecasts work. The AI only turns some of those results into sentences. A digest without highlights lists exactly the same products and numbers as one with them.
Related: The digest email, Not-selling report, Stock per location.