Business
The problem: buying stock by gut feeling
Ordering too much ties up cash in products that don’t sell. Ordering too little means stockouts, lost sales and customers who go elsewhere. In many ecommerce SMEs that decision is made with a spreadsheet and the owner’s instinct, with no real demand planning.
The temptation is to ask a generative AI for the sales forecast. The problem is that a language model returns a figure that sounds right but can’t be reproduced or challenged afterwards. You shouldn’t buy stock on a number like that.
Features
What it does
The agent answers three questions a store owner asks every week: how much will I sell, what is about to run out, and how far can I trust the answer. It is ecommerce demand forecasting that does the job of sales forecasting software and inventory forecasting software in one, with statistics rather than a language model.
It forecasts demand per product
It handles the demand prediction for each product: the expected orders over one week, one month or three months. Every forecast carries a confidence calculated from the data, and you set the minimum: anything below it stays out of the report.
Forecast Configuration
Only include predictions above this confidence level.
3 of 3 predictions above threshold
It warns you before a stockout
It turns the forecast into inventory forecasting: it combines it with current stock to work out how many days it will last, and flags the risk as high, medium or low against your alert window. If the catalogue doesn’t report stock, the risk is marked unknown, never as an alarm.
When to alert
Alert when a product will run out within this window.
Predicted demand: 34 units / week
It reaches your inbox and dashboard
It prepares a demand forecasting email report for several people on the team and keeps the forecast in the dashboard. It discounts the days your store doesn’t ship and sticks to the products that matter most.
Architecture
How it works inside: statistics, not guesswork
The engine is pure arithmetic: the same inputs always give the same output. So a disputed forecast can be re-run, reviewed and compared with what actually happened.
1Inputs
Store orders
Which products each order contained, and when
Catalogue stock
Units on hand, when the platform reports them
Your settings
Horizon, minimum confidence, stock alert and closures
2Statistical engine
Two four-week windows
Compares the last four weeks with the four before
Damped trend
Carries only half of the change forward, with a cap
Capped confidence
Stability, volume and history; never above 90%
Confidence filter
Anything below your minimum is not shown
3Outputs
Expected orders
Per product, for the chosen horizon
Cover and risk
Days the stock lasts: high, medium, low or unknown risk
Report and dashboard
By email to the team and in the AllHub dashboard
Under 28 days of history or four orders: “not enough history”, no row and no invented figure.
Choosing statistics over generative AI was the first design decision of this demand forecasting software, and the most important one. These are the others:
Damped trend
A two-week promotion shouldn’t turn into a quarterly growth curve. The engine only carries half of the observed change forward, and caps it.
Capped confidence
No forecast goes above 90% confidence, however clean the series looks. That is the difference between a confident forecast and one that only sounds confident.
Minimum history
It takes at least 28 days of history and four orders of a product to forecast it. Below that, the report says “not enough history” and shows no figure.
First sales are not a trend
A product with no sales in the previous period has no measurable trend, so its first orders are never presented as exploding demand.
Security
Security: an agent that only reads
A forecast doesn’t need to change anything, so the agent can’t change anything.
A single permission
Its permission contract grants one capability only: reading the catalogue. It can’t change prices, stock or orders.
Authorisation on every run
Before each calculation, AllHub’s security layer checks that the agent is authorised for that store. If it isn’t, it doesn’t run.
Every store isolated
Data is read filtered by store, so a forecast never mixes histories.
Bounded usage
Every run counts against the plan’s quota. When it runs out, the agent stops and logs it.
Nothing to manipulate in the figure
Because the calculation doesn’t go through a language model, there are no instructions anyone could try to inject to change the number.
GDPR
Privacy and data (GDPR)
Forecasting how much will sell doesn’t require knowing who buys.
No personal data in the calculation
The engine only uses which products each order contained and when it was placed, plus catalogue stock.
Forecasts expire with their data
Order history is kept for six months and forecasts are deleted on the same schedule: no conclusion outlives the data behind it.
Recipients you choose
The report only goes to the addresses the team sets up.
EU-first design
Infrastructure designed for the European Union.
Responsible AI
Transparency: every figure says where it comes from
A forecast is only useful if the owner knows how far to trust it.
Reproducible
The same history always produces the same figure, so any forecast can be recalculated and challenged.
Confidence explained
Each figure comes with its confidence, calculated from three observable factors: how steady weekly sales are, how many orders sit behind it and how much history there is.
It says what it measures
The report makes clear that it counts orders containing the product, not units.
Context, not invented data
The holidays you mark travel to the report as context, but they don’t change the figure: there is no holiday calendar behind them to feed it.
People in charge
Human control: the agent proposes, you buy
Restocking decisions involve money, so a person makes them.
It doesn’t order from suppliers
It gives you the forecast, the days of cover and the stockout risk. The decision to restock is yours.
You set the thresholds
The team decides the horizon, minimum confidence, alert window and closures.
Everything is logged
If the agent isn’t active it doesn’t run, and every run records its outcome, including when it produces no forecast at all.
Stock Alerts & Delivery
Where to deliver
No recipients yet — add at least one to receive reports.
Honesty
Where it stands, and its limits
The engine is built. This is what it does today and what it doesn’t do yet.
Works today
- Forecasting engine built and covered by automated tests.
- Per-product forecasts at one week, one month or three months, with confidence and stockout risk.
- Email report and dashboard view.
Limits
- The automatic weekly run is being switched on at AllHub.
- Today order history comes from Shopify stores. Other platforms get “not enough history” until their orders are connected.
- It measures orders containing the product, not units. For products bought several at a time the figure runs low, and the report says so.
- It doesn’t detect seasonality yet: holidays are context, not a factor in the calculation.
The allhub.io page presents the full product. This page focuses on the engine underneath and on what is already built.
Seasonal trend detection
Learned from your real sales history — peaks detected automatically.
Scenario factors
Pick the moments that spike demand for your store.
Projected demand — Decorative Candle Lanterns
For your company
What this case shows
Not every AI agent needs a language model, and sales forecasting is a clear example. Knowing when to use statistics, when to use generative AI and when a fixed rule will do is part of the design. Retail demand forecasting that drives purchases needs a calculation you can audit.
That is how I design every custom AI agent: first I understand the decision it has to support, then I choose the technique. If the challenge is a whole process, we map it first with the MAPA method.
What sits behind it
- The technique is chosen for the decision it supports, not for the hype.
- Reproducible numbers, with their confidence explained.
- Honest about missing data: an empty report beats an invented one.
- Least privilege: the agent only reads.
- The buying decision stays with a person.
FAQ
Frequently asked questions
What is a demand forecast agent?
It is a system that estimates how much each product will sell over a period and warns you if stock won’t last. AllHub’s agent calculates expected orders per product for one week, one month or three months, with a confidence score and a stockout risk.
Does it use generative AI to calculate the forecast?
No. The figure comes from a reproducible statistical method: it compares recent weeks with the ones before and applies a damped trend. A language model would give a convincing number that can’t be reproduced, and you shouldn’t buy stock on that.
What data does it need?
The store’s order history and catalogue stock. It takes at least 28 days of history and four orders of a product to forecast it; below that, the agent reports that there isn’t enough history instead of giving a figure.
What does the confidence of each forecast mean?
It is a percentage calculated from three observable factors: how steady weekly sales are, how many orders sit behind the figure and how much history exists. It never goes above 90%, and you can set a minimum so you only see forecasts that clear it.
Does the agent place orders with suppliers?
No. It only has permission to read the catalogue. It gives you the forecast, the days of cover and the stockout risk, and the restocking decision is yours.
Can you design a forecasting agent for my company?
Yes. I design custom AI agents that analyse your data and explain what matters, using the right technique for each decision: statistics, generative AI or rules. We start with a call, and I’ll tell you honestly whether an agent makes sense for your case.
Custom AI agents
Want to get ahead of your demand?
Tell me which decision you want to make with more data and less guesswork. On a call we’ll see whether a custom AI agent makes sense and which technique suits it.
Original source
The Demand Forecast product page on allhub.io describes the agent as AllHub presents it. This page explains how it is designed inside.
allhub.io/en/ai-agents/demand-forecastThis article was created with the help of AI and reviewed by José Galán. I take great care over every post and every translation, but the odd mistake can still slip through. If you find one, write to me: you will be helping me improve.
