A regional dairy producer wakes up to two complaints on the same morning. Half its yogurt shipments to one supermarket chain arrived too close to their sell-by date, so the retailer refused them (spoilage). Meanwhile, three stores in a neighboring region ran empty of the same product by noon (out-of-stock).
Both problems are inventory failures, but they pull in opposite directions. Fix spoilage by shipping less, and you create more out-of-stocks. Fix out-of-stocks by shipping more, and you create more spoilage.
This is the defining tension of FMCG supply chains, especially for perishables: freshness versus availability, with working capitalworking capitalWorking capital is the difference between a company's current assets and current liabilities, measuring short-term liquidity and the funds available to run daily operations.View full definition → (the cash tied up in stock) squeezed in the middle. Traditional forecasting tools treat these as separate. AI-driven optimization treats them as one problem.
Most companies still run on safety stock rules: keep a fixed buffer of extra units to absorb demand swings. A common formula sets the buffer based on average demand and its variability.
That works for stable, non-perishable goods. It breaks in FMCG for three reasons:
That last point has a name: multi-echelon inventory optimization (MEIO). An echelon is one stage in the network. MEIO optimizes stock across all echelons at once, instead of each depot hoarding its own buffer.
Imagine each regional depot independently keeping five days of yogurt "just in case." Multiply that across twenty depots and you are holding a mountain of perishable stock, most of which will never be needed in any single location.
MEIO asks a smarter question: where in the network should each unit of buffer actually sit?
Often the answer is to hold less at the edges (stores, depots) and slightly more centrally, where one buffer can serve many locations. This is called risk pooling: variability averages out when you combine demand across regions. A central buffer of 1,000 units can cover the same service risk as 3,000 units spread thinly across depots, because the depots rarely all spike at once.
For fresh dairy, MEIO adds a hard constraint: freshness. A unit held centrally must still reachreachThe number of unique people exposed to your message in a given period. Unlike impressions, reach counts each person once, no matter how often they see it.View full definition → the shelf with enough remaining shelf life. So the model balances pooling benefits against transit time and remaining days of life.
The MIT Center for Transportation and Logistics publishes accessible research on these network trade-offs if you want to go deeper.
Forecasting tells you what demand might be. It does not tell you what to *do*. Replenishment is a decision problem: how much to order, for each SKU, at each location, every day, given uncertain demand and perishability.
Reinforcement learning (RL) is a branch of AI where an agent learns a policy (a rule for choosing actions) by trial and error against a reward signal. Think of it as learning to play a game where the "score" is your business objective.
For dairy replenishment, the setup looks like this:
The RL agent runs millions of simulated days against historical and synthetic demand. It learns, for example, that shipping extra to a specific store before a hot weekend pays off, but only for products with more than four days of shelf life left.
Crucially, RL learns policies that classic rules cannot express. A fixed safety-stock formula says "keep X days." An RL policy says "keep X days, unless product age exceeds Y and it is midweek with no promotion, in which case ship less and let the central depot absorb the risk." That conditional logic is exactly what the freshness-versus-availability trade-off requires.
Here is the core idea of the reward, in pseudocode. This is illustrative, not production code.
def daily_reward(sales, demand, spoiled_units, ending_stock):
stockout_units = max(demand - sales, 0)
reward = (
REVENUE_PER_UNIT * sales
- STOCKOUT_PENALTY * stockout_units # missed sales, unhappy retailer
- SPOILAGE_COST * spoiled_units # perished dairy, disposal cost
- HOLDING_COST * ending_stock # working capital tied up
)
return rewardThe agent tunes its ordering policy to maximize the sum of these daily rewards over time. Change the penalties, and you change behavior: raise SPOILAGE_COST and the agent gets more conservative on fresh SKUs.
RL and MEIO are only as good as their inputs and constraints.
Data you need:
Guardrails that matter:
A practical rollout usually starts in shadow mode: the AI generates recommendations, humans keep making the real decisions, and the two are compared for several weeks. Only after the AI consistently beats the incumbent method on spoilage, service, and stock does it take control, often one product category at a time.
For our dairy producer, a well-tuned system does not chase one metric. It reports on all three at once:
The win is moving all three in the right direction together, or accepting a tiny, deliberate trade in one to gain a lot in another. Vendors sometimes advertise large improvements; treat headline figures as estimates and insist on your own shadow-mode test before believing them.
Knowledge check
1. Why does the excerpt describe freshness and availability as a 'two-sided problem no spreadsheet can solve'?
2. A company sells shelf-stable canned soup with steady, predictable demand. Why might classic safety-stock rules work fine here but fail for fresh yogurt?
3. What best captures the purpose of multi-echelon inventory optimization (MEIO)?
4. Select ALL correct answers. Why do classic fixed safety-stock rules break down in FMCG supply chains?
Select all the correct answers.
5. Select ALL correct answers about the role of working capital in the FMCG inventory problem.
Select all the correct answers.
Optimizing forecasts instead of decisions. A more accurate forecast that still feeds a rigid ordering rule leaves most of the value on the table. The decision policy is where the money is.
Ignoring the retailer's constraints. Many grocery chains reject deliveries below a minimum remaining shelf life (a "days-to-expiry" requirement). If your model does not encode the retailer's acceptance rules, its "optimal" shipments get bounced at the dock.
Training on a world that no longer exists. Demand patterns shift: new competitors, price inflation, changed consumer habits. RL policies need periodic retraining, and monitoring for drift (when live conditions diverge from training data).
Over-centralizing perishables. Risk pooling saves cash, but for very short-life products, holding stock too far from the shelf just relocates spoilage. The model must respect transit time as a first-class constraint.
Return to that producer with two complaints. Under an AI-driven system, the morning looks different. Overnight, the agent saw a heatwave forecast for one region and a promotion starting in another. It pushed fresher stock toward the promotion region, held slightly more at the central depot to cover heatwave uncertainty, and trimmed shipments of older stock to the chain that enforces strict shelf-life acceptance.
Spoilage and out-of-stocks stop being a tug-of-war. They become two terms in a single objective the system solves every night.