AI agent · AllHub project

Stockouts in your online shop: watch your warehouse in 3D through the next sales peak.

The “3D agent for your warehouse” simulates 20 weeks of your season around a demand peak: Black Friday, Christmas, the sales, the summer campaign or a product going viral.

You set up your shop, code restocks it three ways, SubQ decides which inventory risks you have and Mistral explains it. You watch it in 3D: empty shelves or pallets left over.

Short answer

It is an agent that simulates what happens to an online shop’s warehouse in a sales peak depending on how it decides how much to buy. Code simulates 20 weeks with three ways of restocking: by gut feel, with a spreadsheet and with AllHub’s forecast. SubQ decides which inventory risks your shop has and which are high with the way you buy today. Mistral explains it with the simulated figures, and you watch it in 3D: stockouts, rush orders or pallets of overstock.

Guidance only: The season is simulated with illustrative patterns for online shops in Spain, not with your shop’s data. The figures are for comparing the three ways of restocking, not a forecast for your business: for that, AllHub works with your real sales.

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.

AllHub logo

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.io

Architecture

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.

  1. 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.

  2. 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.

  3. 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?

  4. Mistral explains

    It explains what happens in your warehouse and why, using only those risks and figures, and suggests a first step.

  5. 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:

How does each way restock in the simulation?
CriterionNo forecast (gut feel)With a spreadsheetWith AllHub
When does it order?When stock plus orders no longer cover the supplier’s lead time plus 1 week of normal salesEvery week it tops up what is missingEvery week it tops up what is missing
How much does it order?Always the same: 4 weeks of normal salesEnough for the lead time plus 2 weeks, at the average sales of the last 4Forecast demand for the lead time plus 1 week, with 18% safety stock
Does it see the peak coming?No: neither the season nor the eventLate: only once it shows in salesThe 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 outIt rush-orders 3 more weeks, which take just as long to arriveIt adds a rush week and keeps ordering after the peak: lost sales never show in the sheetNo panic buying: it keeps ordering from the forecast
The key detail: with a forecast horizon shorter than the supplier’s lead time, not even the forecast arrives in time. That is why the agent asks you both.

Risks

Which inventory risks does the agent assess?

These are the seven risks the agent gives SubQ, with what happens and what it costs:

Inventory risks of an online shop in a sales peak
CriterionWhat happensWhat it costs you
Stockout at the peakIf 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 eventWhat 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 warehouseEvery 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 timeIf 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 timeA 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 supplierWhen 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 reviewsSelling without real stock or shipping late leads to cancellations, complaints and negative reviews on the platform.Worse ratings on the shop and on marketplaces.
SubQ answers two questions per risk: whether it matters for your shop in this peak, and whether it is high with the way you buy today, given the simulated figures. The high risks are the ones you see in the warehouse.

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.

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.

Reviewed by

Agent-as-a-Service Designer at AllHub and Search & AI Visibility consultant. I design internal AI agents and help companies show up in Google and AI engines, with reproducible measurement.

LinkedInBackground

Shall we talk?

Get recommended by AI and/or put an agent to work for you.

Tell me what you want to achieve: fill in the form or email me at info@josegalan.dev.

We go through your AI visibility snapshot (or the process you want to automate) and I tell you, with data, what I would change first. No commitment.

What are you interested in?
Company size (optional)
When would you like to start? (optional)

Basic data protection information. Controller: José Galán. Purpose: to reply to your enquiry. Legal basis: your consent, which you can withdraw at any time. Recipients: no data is shared with third parties unless required by law; Google (hosting and form delivery) acts as data processor. Your rights: access, rectification, erasure, objection, restriction and portability. More information in the privacy policy.