Context
What is the 3D agent for your warehouse?
A stockout is rarely seen coming from a spreadsheet. When sales climb, the supplier takes weeks and the order arrives after the peak has gone. Whatever is left over ends up in the sales.
This agent shows it with your warehouse in 3D: you pick the sector, the channel, the catalogue size, the supplier’s lead time, the forecast horizon, how you buy today and which peak to simulate.
I designed it for AllHub. It is an example of a custom AI agent for a SaaS: instead of describing the product, it shows what changes in each visitor’s own warehouse.
About AllHub
AllHub connects your shop and forecasts demand per product and category from your real sales and stock: with confidence scores, stockout and overstock alerts, seasonal peaks and scenarios. To see how it works inside, I explain it in AI demand forecasting.
Go to AllHub.ioArchitecture
How does the agent work?
Just like IA Ocupación: code does what code can do, and AI decides and explains only where it adds something.
Facts
From your answers, code describes the shop and builds a 20-week season for three product families of your sector, with the peak in the middle. No AI.
Simulation
Code restocks week by week the three ways, respecting the supplier’s lead time: sales served and lost, stock left over and rush orders.
SubQ decides
For each inventory risk it answers two yes-or-no questions: does it matter for your shop in this peak? Is it high with the way you buy today?
Mistral explains
It explains what happens in your warehouse and why, using only those risks and figures, and suggests a first step.
You watch it in 3D
Your warehouse lives through the season with each way of restocking, week by week. You decide.
You do not type anything: you pick closed options. The same combination always gives the same result, so it is cached for a week.
While nobody is using it, the scene loops a demo through the three ways of restocking, worked out by code alone, without calling any model.
Simulation
Three ways of restocking: gut feel, spreadsheet and AllHub
Each simulation restocks the same season three ways. These are their rules, as code applies them:
| Criterion | No forecast (gut feel) | With a spreadsheet | With AllHub |
|---|---|---|---|
| When does it order? | When stock plus orders no longer cover the supplier’s lead time plus 1 week of normal sales | Every week it tops up what is missing | Every week it tops up what is missing |
| How much does it order? | Always the same: 4 weeks of normal sales | Enough for the lead time plus 2 weeks, at the average sales of the last 4 | Forecast demand for the lead time plus 1 week, with 18% safety stock |
| Does it see the peak coming? | No: neither the season nor the event | Late: only once it shows in sales | The season, always; the event, if it falls within the horizon you pick. A viral product, as soon as it starts to climb |
| If it runs out | It rush-orders 3 more weeks, which take just as long to arrive | It adds a rush week and keeps ordering after the peak: lost sales never show in the sheet | No panic buying: it keeps ordering from the forecast |
Risks
Which inventory risks does the agent assess?
These are the seven risks the agent gives SubQ, with what happens and what it costs:
| Criterion | What happens | What it costs you |
|---|---|---|
| Stockout at the peak | If stock does not arrive before the demand peak, sales are lost and customers buy elsewhere. | Lost sales and customers who do not come back. |
| Overstock after the event | What is bought for the peak and not sold stays in the warehouse and ends up discounted or unsold. | Dead stock cleared at a discount. |
| Cash tied up in the warehouse | Every unit waiting on the shelf is money not available for other purchases. | Less cash for the rest of the business. |
| Supplier lead time longer than your reaction time | If the supplier takes longer than it takes you to notice you are running out, the order arrives late. | Orders that arrive after the peak. |
| Forecast horizon shorter than the replenishment lead time | A forecast only helps buying if it looks further ahead than the goods take to arrive. | The alert comes when there is no time left to restock. |
| Rush orders to the supplier | When a product runs out, last-minute restocks are ordered, which cost more and sometimes the supplier has no capacity. | Express freight and worse purchase prices. |
| Delays and negative reviews | Selling without real stock or shipping late leads to cancellations, complaints and negative reviews on the platform. | Worse ratings on the shop and on marketplaces. |
Digital twin
The 3D scene: your warehouse, week by week
The scene invents nothing: it draws the stock code computes for each week and each way of restocking.
Shelves that fill and empty
Each product family has its own racking. Boxes go up and down with each week’s stock, and the warehouse TV and calendar show the week and the peak.
Lorries on the supplier’s lead time
Orders arrive by lorry when they are due given the lead time you chose, and the forklift puts them on the shelves. Rush orders often arrive late.
Stockout
When a shelf runs empty, the “SOLD OUT” sign appears and the floor turns red: those are sales going to another shop.
Overstock
If a lot of stock is left after the peak, extra pallets appear with a “-50%” tag: money sitting still that will end up in the sales.
Meanwhile parcels leave on the conveyor for your customers’ orders, and the counter shows lost sales, stock in the warehouse and demand served.
Reliability
Verification: SubQ checks the explanation
After the explanation, SubQ steps in again to check Mistral with these questions:
Does it make anything up?
Each explanation of a risk is checked against its description and the simulated figures: causes, amounts or consequences that are not there count as a failure.
Does it overstate AllHub?
AllHub forecasts demand per product and category from your sales and stock, with confidence scores, stockout and overstock alerts, seasonal peaks and scenarios. If the text says it guarantees accuracy, prevents stockouts or buys for you, it fails.
If it fails, another round
If any failure probability goes above 70%, Mistral Medium rewrites it and SubQ checks it again. If it still fails, it is flagged.
It does not touch the numbers
Lost sales, stock left over, rush orders and high risks are computed by code. Mistral only explains them.
Privacy
Security and data
The same defences as the other agents, reviewed against the OWASP Top 10 for LLM applications.
You do not type anything
You only pick closed options. No text of yours reaches a model, so there is no data to leak and no instructions to inject.
Its own keys
The agent uses its own SubQ and Mistral keys, so its spend and usage are measured separately.
Against abuse
Self-hosted ALTCHA proof of work, per-visitor and global limits, a daily cap on new queries and a one-week cache.
No tracking
The IP is only used in memory for the limits. Usage leaves an anonymous record with the options chosen and the cost.
Honesty
Status and limits
What does the agent do today, and what not? No frills.
What it does today
- It really calls SubQ and Mistral for each new setup, and shows you the cost.
- It simulates 20 weeks with five sectors, five peaks and three ways of restocking.
- It draws in 3D exactly the stock code computes, week by week.
What it does not do
- The season is an illustrative pattern, not your shop’s sales.
- It is not a forecast: it compares ways of restocking in a scenario.
- It does not look at your orders, your real suppliers or your current stock.
To do it with your data, the step is not a simulator: it is connecting your shop to AllHub so the forecast comes from your real sales.
Key points
- Facts: From your answers, code describes the shop and builds a 20-week season for three product families of your sector, with the peak in the middle. No AI.
- Simulation: Code restocks week by week the three ways, respecting the supplier’s lead time: sales served and lost, stock left over and rush orders.
- SubQ decides: For each inventory risk it answers two yes-or-no questions: does it matter for your shop in this peak? Is it high with the way you buy today?
- Mistral explains: It explains what happens in your warehouse and why, using only those risks and figures, and suggests a first step.
- You watch it in 3D: Your warehouse lives through the season with each way of restocking, week by week. You decide.
FAQ
Frequently asked questions
What is a stockout?
It is running out of a product while customers keep asking for it. In an online shop it means lost sales, cancelled orders and customers who buy elsewhere.
How do you avoid stockouts in a sales peak?
By ordering before it shows: with a forecast that looks further ahead than the supplier’s lead time and some safety stock. Buying by gut feel or from the average of recent weeks reacts late.
Why does a spreadsheet fall short?
Because it only sees what was sold. Sales lost to stockouts never appear, so the peak looks smaller than it was and orders keep going in after it has passed.
What is overstock?
It is the stock left over after the peak. It takes up space, ties up cash and usually ends up sold at a discount.
Does the agent know my shop?
No. It only uses what you pick in the form and an illustrative season for your sector. For a forecast from your real sales, there is AllHub.
What do SubQ and Mistral do?
SubQ decides: which risks matter for your shop and which are high with the way you buy, and then checks the explanation. Mistral writes it in plain language, using only the risks and the computed figures.
Does it keep any of my data?
You do not type anything, you only pick options. An anonymous record of the options and the cost of each query remains, with no IP or personal data.
Custom AI agents
Want an agent like this for your SaaS?
We design it with your product, your customers and your rules: a simulator that shows what changes in each visitor’s situation and takes them to try it.
More on the forecast
AllHub’s demand-forecast agent page and its early access:
This 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.