KodaLink
Case study · Data Science & AI Engineering
Case study · Data Science & AI Engineering

From unreliable forecasts to trusted replenishment decisions

Machine-learning forecasts that drive restocking decisions — and an AI agent that diagnoses pipeline failures in minutes, not hours.

Microsoft Fabric · Azure AI Foundry · Power BI
Trusted forecasts Automated recommendations AI-assisted operations Monitored in production
The starting point

Forecasts too inaccurate to act on

An organization responsible for recurring replenishment across its customers' locations relied on demand forecasts that planners frequently had to override. Every restocking decision depended on those forecasts — and they weren't good enough to trust.

× What it was costing

  • Manual overrides — planners corrected orders by hand, every cycle.
  • Slow replenishment — a labor-intensive process with long lead times.
  • Costly errors — excess stock at some locations, stockouts at others, near-empty truck dispatches.
  • No monitoring — nobody knew when the model started to drift.
  • Hours lost per incident — when a data run failed, someone spent about three hours digging through logs.
  • Know-how in a few heads — only a handful of people knew where to look.

→ What they actually needed

  • Forecasts accurate enough that planners stop second-guessing them.
  • Forecasts turned into ready-to-approve order recommendations.
  • A pipeline that runs reliably and flags its own problems.
  • Fast answers when something breaks, without waiting for an expert.
The solution

Forecasting and an AI agent, working together

Two pieces, built end to end: a forecasting engine that drives restocking, and an AI agent that accelerates diagnosis when something fails.

~30%lower forecast error
2×faster restocking
~1.5×more recommendations accepted in one operation
Hours → minutesto diagnose a failure

Demand forecasting

Gradient-boosting models (many simple models combined, each one correcting the errors of the previous) learn from sales history, inventory, promotions and receipts to forecast demand per location and product.

Restocking recommendations

Business rules turn each forecast into an order recommendation that planners approve or adjust.

Production pipeline

Automated pipelines with a DEV → PROD release process, monitoring dashboards and exception alerts.

AI diagnostic agent

When a run fails, an LLM agent investigates first and hands the team a diagnosis.

How the agent works

Detect

A pipeline error triggers the agent automatically.

Gather

It pulls logs, data-quality checks and run history.

Reason

The LLM identifies the most likely root cause.

Report

The team gets the cause, the evidence and a next step.

Why this matters

The value is not only a better forecast. The operating model changes: planners work from recommendations instead of rebuilding decisions by hand, monitoring becomes part of the process, and recurring failures are triaged automatically before an expert steps in.

Representative technologyPythonXGBoost / LightGBMMicrosoft FabricAzure AI FoundryPower BISQL
A closer look

Every item, every day, in one view

Illustrative screen — fictitious data, no real client information.

Illustrative replenishment screen with fictitious data: demand forecast chart, item-level table of opening inventory, forecast, recommendations, receipts and projected inventory.

Replenishment view — demand forecast, system recommendations, receipts and projected inventory per item.

The results

What changed, in numbers

AreaBeforeAfter
Forecast errorToo high to trust~30% lower
Restocking lead timeBaselineCut in half
Recommendations accepted by planners (one operation)Less than half~1.5× more
Total truck time on the roadBaseline2–4% lower
Time to diagnose a pipeline failure~3 hoursMinutes
Why it works

Built to be trusted, not just to be accurate

Measured against the real process

Every model was backtested against how planners worked before — not against a vacuum.

Built with a Microsoft data & AI stack

Fabric pipelines, Azure AI Foundry and Power BI — one coherent stack, from data to monitoring.

People handle the exceptions

The system recommends, planners decide, and the agent does the first investigation.

The outcome

Planners focus on the exceptions

Trusted numbers

In one operation, planners accepted far more recommendations instead of rewriting them.

Faster restocking

Customer locations get the right stock sooner, with fewer near-empty truck dispatches.

Faster incident triage

Failures are diagnosed in minutes — the knowledge no longer sits with a few people.

Applies to: Distributors, manufacturers and retailers with recurring replenishment, VMI programs or perishable stock — and any team that spends hours triaging recurring errors or tickets.

Your operation

Still adjusting forecasts by hand?

Tell us which recurring decision is eating your team's time. We'll show you what a forecast-driven, AI-monitored process could look like for your business.

Paulo de Tarso Silva Carvalho Founder · Microsoft Cloud, Security & AI Solutions Consultant paulo@kodalinktech.com kodalinktech.com