<![CDATA[Samir Saci]]>https://www.samirsaci.com/https://www.samirsaci.com/favicon.pngSamir Sacihttps://www.samirsaci.com/Ghost 6.34Sat, 25 Apr 2026 06:33:07 GMT60<![CDATA[I Simulated an International Supply Chain and Let OpenClaw Monitor It]]>https://www.samirsaci.com/i-simulated-an-international-supply-chain-and-let-openclaw-monitor-it/69ddef4b1006b80001152250Tue, 21 Apr 2026 07:31:00 GMT

A few weeks ago, I published an article showing how an AI agent could help a fashion company analyse failures in its distribution chain.

The idea was to connect Claude Opus 4.6 to transportation data to explain late store deliveries.

This agent was able to investigate, by connecting to the shipment data, and find the root cause of specific failures.

Why was a Shanghai store delivered with a 45-hour delay when every team supposedly hit their target?

A week later, I received a message from a potential customer: Mario, a logistics director at a fashion company based in Milan.

"We have exactly this problem: when I ask the teams, everybody is on time, but 18% of our shipments arrive late. Can your AI agent monitor this in real time?"

They ship luxury goods from a Milan warehouse to 67 stores worldwide through a complex chain involving multiple teams that depend on one another to ensure orders are delivered on time.

I Simulated an International Supply Chain and Let OpenClaw Monitor It
Distribution Chain of Mario's Retail Company: each team can cause delays- (Image by Samir Saci)
Mario: "My team is overwhelmed by the complaints from stores and cannot keep up with the analysis workload."

To convince Mario, I built a simulation of his entire distribution chain (including realistic delays) running 24/7 on a live server.

I Simulated an International Supply Chain and Let OpenClaw Monitor It
Mario's distribution chain's digital twin is live with OpenClaw monitoring it on the side - (Image by Samir Saci)

As Mario's team already uses OpenClaw for daily operations, I connected it to the simulation and created a team of analyst agents powered by Codex.

I Simulated an International Supply Chain and Let OpenClaw Monitor It
Four OpenClaw's Personas that will help Mario's team- (Image by Samir Saci)

In this article, I will explain how these agents help Mario's analysts keep up with alerts and status updates and send them directly to operational teams via Telegram.

Together, they form a team of AI investigators running 24/7 on their behalf.

Mario's Challenge: Managing a Chain Where Every Team Depends on the Next

To share this solution publicly without using Mario's confidential data, I built a simulator that reproduces his entire distribution chain.

We have a similar network, including process variability and delays that lead to the same cascade patterns Mario faces, and it runs 24/7 on a live server.

I Simulated an International Supply Chain and Let OpenClaw Monitor It
Tuesday April 14th, 11:49 am (UTC+2) Snapshot - (Image by Samir Saci)

For example, I checked Tuesday morning; there were 4 shipments currently flying to Changi Airport in Singapore.

This living digital twin will be our playground to test OpenClaw's capabilities.

For a live demo,

How luxury goods travel from Milan to Tokyo

Throughout the day, stores across Asia and the Middle East send replenishment orders to Mario's distribution centre on the outskirts of Milan.

Order XD-487: We need 10 bags of reference YYY delivered at Shanghai Store 451 by May 1st, 2026.

Each order follows the same journey through 8 steps owned by 4 different teams.

I Simulated an International Supply Chain and Let OpenClaw Monitor It
8 steps involving 4 teams from the creation of the order - (Image by Samir Saci)

They need to respect fixed daily schedules (flight take off, customs clearance) that create bottlenecks nobody sees coming.

Because Shanghai stores shipments missed yesterday's flight, they will be delivered with 2 days delays.

Our simulator continuously generates 500+ orders per day with realistic variability at each step.

I Simulated an International Supply Chain and Let OpenClaw Monitor It
April 18th, 04:11 pm: Three shpments were en route to Riyadh stores - (Image by Samir Saci)

Some shipments flow smoothly. Others hit the cascading delays that make Mario's life difficult.

I Simulated an International Supply Chain and Let OpenClaw Monitor It
Live Dashboard Monitoring Mario's Distribution Chain - (Image by Samir Saci)
Why does Mario need support from agents?

Mario's Nightmare: A delay that nobody owns

Every Monday morning, store managers escalate the same complaint to Mario: shipments arriving days late, empty shelves for new collection launches, unhappy customers walking out.

For a brand that sells scarcity, being late means lost sales.

Therefore, Mario tries to find the root cause of these delays. But when he asks, every team defends itself.

I Simulated an International Supply Chain and Let OpenClaw Monitor It
Examples of failures in the distribution chain - (Image by Samir Saci)

In the example above, everyone is on time, yet the shipment is late. Nobody owns the problem.

So Mario asks his analyst to dig through the data. But with 90 late deliveries every day across 8 cities, Excel and CSV exports are not enough. They can only review a few cases a week.

What Mario really needs is a team of agents that investigates every late shipment for him, around the clock.

Meet the AI Performance Managers

Openclaw manages a team of Agentic Analysts.

Each agent is connected to the system where every shipment, route, and delivery are tracked: Transportation Management System (TMS).

They run 24/7 and cover a specific scope of responsibility.

I Simulated an International Supply Chain and Let OpenClaw Monitor It
Example of Agents setup by Mario's team - (Image by Samir Saci)

Four global personas watch the entire network:

  • Marco, the Distribution Network Manager, runs the overall anomaly sweep and flags any city that is drifting.
  • Elena, the Transportation Manager, hunts for situations where a team blamed for a delay they did not cause.
  • Giovanni, the Central DC Operations Manager, monitors warehouse throughput.
  • Yuki, the Air Freight Manager, tracks flight variability and quantifies the downstream impact on late deliveries.

We need agents to monitor last-mile delivery and echo store complaints.

Eight regional personas each watch a single city in China, Japan, Saudi Arabia and the UAE.

I Simulated an International Supply Chain and Let OpenClaw Monitor It
8 local logistics manager monitoring the performance from their city - (Image by Samir Saci)

Every hour, each persona runs its own investigation:

  1. Pulls transactional data from the backend, analyses the performance of their scope and spots the failures.
  2. When something needs attention, the persona posts a flash report to the dashboard and sends a summary to the operational team on Telegram.
I Simulated an International Supply Chain and Let OpenClaw Monitor It
Example of flash reports posted by the Air Freight Manager - (Image by Samir Saci)

Each report has three parts that match how a human analyst would brief Mario:

  • The headline, a one-line title identifying the issue (e.g. Air Freight - Warehouse Explanation)
  • The summary, a single sentence with the finding (e.g. Pick & pack delays pushed several shipments past the flight readiness deadline)
  • The full analysis, with specific shipment IDs, durations, and how much each step went over its target.

The idea is to provide only the information needed for the analyst to take action.

For that, each prompt is editable in the admin panel, so the operational team can adjust what Elena looks for or how Li Wei formats his Shanghai briefings without writing a single line of code.

I Simulated an International Supply Chain and Let OpenClaw Monitor It
Transportation Manager Persona - (Image by Samir Saci)

With this team of AI agents running around the clock, Mario no longer walks into his Monday meeting empty-handed.

I Simulated an International Supply Chain and Let OpenClaw Monitor It
Examples of alerts that the team will receive in their Telegram, Slack adapted to their scope - (Image by Samir Saci)

Every late shipment has a name, a root cause, and a responsible team, already documented and ready to discuss.

What Changed for Mario

A few weeks after the agents were connected to his Transportation Management System, Mario's week looks different.

Before OpenClaw, my Mondays were a war zone. Now I get the brief at 8am.

Monday meetings are now 20 minutes, not 2 hours. 

Instead of each team showing up with its own version of the truth, Mario walks in with a consolidated brief already written by the agents.

I Simulated an International Supply Chain and Let OpenClaw Monitor It
Mario's analysts can pull all the late orders by destination and run analyses - (Image by Samir Saci)

Every late shipment has a name, a documented root cause, and a responsible team. The meeting is about what to fix next, not who to blame.

Local Managers can answer the complaints of their stores without asking Mario for support.

Regional teams get local visibility. 

Li Wei, sitting in Shanghai XinTianDi office, receives the same type of reports as Omar, who monitors shipments from Dubai's Marina.

Each local logistics manager receives a targeted daily briefing on their own stores, in their own scope.

I Simulated an International Supply Chain and Let OpenClaw Monitor It
Example of analysis for Li Wei - (Image by Samir Saci)

The report also includes two additional outputs: TOOLS CALLED and METRICS that can be used, on demand by OpenClaw, to reconstitute the data transformation that led to the results here.

I wanted to ensure the replicability, so these local managers do not need to wait for Milan to export a filtered CSV.

Problems surface before customers complain. 

The agents run every hour, around the clock.

When a flight delay threatens to cascade, the operational team sees it in Telegram before the store manager in Shanghai picks up the phone.

I Simulated an International Supply Chain and Let OpenClaw Monitor It
Alert of flight delays towards Seoul (ICN) - (Image by Samir Saci)

Instead of spending their mornings pivoting CSVs, Mario's analysts can now focus on coordinating with the teams:

  • Alert Seoul local logistics teams and stores: "You may face delays for the incoming shipments."
  • Ask the Air Freight team when the situation will improve.

The business case is not about replacing analysts.

It is about giving his team the visibility, the evidence, and the time to actually solve the problems their data keeps pointing at.

Conclusion

Should You Let OpenClaw Monitor Your Supply Chain?

We did not pick OpenClaw at random.

Mario was already using it for other automations, so adding supply chain monitoring did not require onboarding a new tool.

OpenClaw runs on their own infrastructure with scoped access to the transportation management system, so sensitive data never leaves their perimeter.

I Simulated an International Supply Chain and Let OpenClaw Monitor It
OpenClaw activity in the last 24 hours - (Image by Samir Saci)

For instance, when his team wants to adjust what Elena checks, they do it in natural language from their Slack channel, without calling a developer.

This exact setup will not fit everybody.

The point of this article is to show what becomes possible when you give AI agents a live 24/7 connection to your operational data and the right tools to query it.

See it live

You can explore the platform yourself at plan.supply-science.com/openclaw

The simulation is running right now with live shipments flowing through Milan to Asia and the Middle East, and OpenClaw's personas are posting flash reports every 4 hours.

About Me

Let's connect on LinkedIn and Twitter. I am a Supply Chain Engineer who is using data analytics to improve logistics operations and reduce costs.

If you're looking for tailored consulting solutions to optimise your supply chain and meet sustainability goals, please contact me.

]]>
<![CDATA[How Spreadsheets Quietly Cost Supply Chains Millions]]>https://www.samirsaci.com/how-spreadsheets-quietly-cost-supply-chains-millions/69d4f88f41ee8f00012d444bSat, 11 Apr 2026 10:57:39 GMT

Last quarter, a fashion retailer ran a national TV campaign for its best-selling apparel line.

The demand planner updated the forecast on a Tuesday morning. But the supply team only found out eleven days later, in the monthly meeting!

By then, the factory lead time had expired, and two outlet stores had empty shelves for the first week of the campaign.

VP of Marketing: Tens of thousands of dollars in lost campaign revenue due to insufficient inventory!

The marketing budget was spent. The traffic showed up. The product did not.

This is what S&OP was supposed to fix, and in most retailers, it still has not.

This is not a technology problem. It is the way most retailers organise the conversation between Sales and Operations.

Integrated Business Planning, also known as Sales and Operations Planning (S&OP), is the process that translates sales forecasts ("We expect to sell 50 units next month") to products on the shelf ("75 units delivered at Store 125 last week").

How Spreadsheets Quietly Cost Supply Chains Millions
End-to-End Planning Process from Demand Planning to Distribution Planning - (Image by Samir Saci)

In a spreadsheet world, each team works on its own copy of the data, and a single forecast change takes weeks and the cost is measured in lost sales nobody can trace back to the original delay.

What should be a seamless process becomes a chain of emails and meetings, in which teams discover changes too late.

At a fashion retail company I've been working with, it took up to 27 days to see a change in the demand signal to be communicated to the warehouse teams.

How Spreadsheets Quietly Cost Supply Chains Millions
A nightmare in the siloted world of spreasheets - (Image by Samir Saci)

The information was trapped in isolated Excel files shared via email, with limited traceability and version control.

The root cause of poor planning execution is rarely the forecasting model alone. It is the siloed organisation around it.

Merch Team to Demand Planning: Can you send me forecast_jan2026_v12.xslx to prepare tomorrow's buying session?

In most companies, the answer is measured in weeks, and the cost shows up in next quarter's margin without anyone connecting the dots.

In the simulation you are about to read, it is one working day!

A perfect forecast that nobody downstream sees in time is worth nothing.

In this article, I will show how a connected planning platform turns that two-week delay into a same-day action plan, and why this single change can save retailers millions.

How Spreadsheets Quietly Cost Supply Chains Millions
A unique platform for our 5 teams - (Image by Samir Saci)

We will use a simulation platform that I designed from scratch, where you can experiment with how information flows across teams through integrated business planning.

There is a video version of this article for more details,

The Five Teams That Don't Talk

To make this concrete, let's look at SupFashion, a mid-size European fashion retailer that is small enough to be agile and big enough to feel every planning failure in its margin.

A Mid-Size Fashion Retailer with a Complex Supply Chain

SupFashion is a mid-size fashion retailer based in Europe.

It sells four product lines (wallets, bags, luggage, apparel), sources from five factories on three continents, and runs 12 stores across the United States and Europe.

How Spreadsheets Quietly Cost Supply Chains Millions
Five Distribution Centers (Central, Regional) - (Image by Samir Saci)

The brand is small by industry standards, but the planning challenges are exactly the same as those of a global fashion giant.

How Spreadsheets Quietly Cost Supply Chains Millions
How product physically moves from factories to stores in SupFashion: 5 factories, 1 central warehouse, 4 regional warehouses, 18 stores. - (Image by Samir Saci)

The five teams in the chain

To plan and run this network, four planning teams work in sequence every month, supported by a finance team that closes the loop.

How Spreadsheets Quietly Cost Supply Chains Millions
Information Flowing from Demand to Distribution Planning - (Image by Samir Saci)

Each team's job depends on the output of the team before it:

  1. The merchandiser cannot lock a buy plan until the demand planner has signed off on the forecast.
  2. The supply planner cannot place a factory order until the buy plan is approved.
  3. Finance cannot project margin until production and freight costs are confirmed.

Here is the catch. None of these five teams works in the same tool!

Five Teams, Five Spreadsheets, Zero Conversation

This is how every planning error enters the system. Not through bad models, but through copy-and-paste.

In a SupFashion, each of these five teams works on its own copy of the data, in its own tool:

  • A demand planner has forecast_jan2026_v22.xlsx.
  • The merchandiser has buy_plan_SS26_FINAL_v3.xlsx.
  • The supply planner manages a Google Sheet shared with the factory.
  • Distribution runs on a Power BI dashboard built three years ago by someone who has since left.
  • Finance reconciles all of it in a separate system, two weeks after the fact.

When the demand planner changes a number, it sits in her file until the next monthly meeting.

From there, it travels by email and is re-typed across four teams. Two weeks later, the distribution finally hears about it.

Are we working on the right version of XXX.xlsx ?
How Spreadsheets Quietly Cost Supply Chains Millions
The illustration of the spreadsheet nightmare: multiple versions living in silots - (Image by Samir Saci)

In the next section, we will follow a single forecast change in detail and see what happens when those two weeks become one working day.

One Forecast Change, Two Realities

Let me introduce you to SupFashion's end-to-end planning team.

How Spreadsheets Quietly Cost Supply Chains Millions
End-to-end planning team of SupFashion - (Image by Samir Saci)

We will analyse how the entire process chain reacts to a change in the demand signal, considering two scenarios:

  • Scenario 1: The isolated spreadsheets world that SupFashion lives in today
  • Scenario 2: Planners working on the same connected platform SupPlan

We will discover how SupPlan enabled SupFashion to cut the end-to-end cycle time from 14 days to less than 24 hours.

The trigger: A Sports Fair Starting in May

It is Friday morning, April 10th.

Sarah, the demand planner at SupFashion, receives a message from the marketing director.

"The Base Layer Top - Black has been selected for the Southeast Summer Sports Fair in Charlotte and Atlanta (May 2026). We expect a 30% footfall increase in both stores. Please adjust the forecast accordingly."

Sarah knows from past campaigns that outlet stores in tier-2 cities respond strongest to TV advertising.

How Spreadsheets Quietly Cost Supply Chains Millions
Base Layer Top - Black is sold in multiple locations - (Image by Samir Saci)

She needs to increase the forecast for Base Layer Top - Black (Apparel category) at two Southeast US stores for May 2026:

  • +30 units at Charlotte Outlet (94 124)
  • +20 units at Atlanta Standard (136 156)

Total adjustment: +50 units for one month, two stores.

What happens at SupFashion today with spreadsheets

Sarah opens forecast_apr2026_v8.xlsx, updates the cells for Charlotte and Atlanta stores.

She saves the file and emails it to Marc, the merchandiser in charge of the North American market.

Timeline - Day 1 (Friday): Sarah sends the email.

  • Subject: Updated forecast for Base Layer Top, Charlotte + Atlanta, pls review.
How Spreadsheets Quietly Cost Supply Chains Millions
Day 1: the beginning of our cascading impacts - (Image by Samir Saci)

Timeline - Day 4 (Monday): Marc opens the email and

  1. Downloads the file, compares it with buy_plan_SS26_FINAL_v3.xlsx
  2. He manually re-types the new quantities into his own spreadsheet, but forgets Atlanta Standard.
How Spreadsheets Quietly Cost Supply Chains Millions
Buy Plan Managed by Marc by Store for Base Layer Top - Black - (Image by Samir Saci)

The Atlanta Standard buying plan does not account for the additional demand of 20 units.

How Spreadsheets Quietly Cost Supply Chains Millions
Day 3: A first information leakage in our E2E planning process - (Image by Samir Saci)

Unfortunately, he emailed the updated buy plan to Li Wei, the supply planner.

Timeline - Day 6 (Wednesday): Li Wei opens Marc's buy plan to update factory orders

  1. Checks the factory capacity of the apparel supplier, Dhaka Garments Ltd.
  2. Only updates the orders of Philadelphia Outlet.
  3. She found a problem!
How Spreadsheets Quietly Cost Supply Chains Millions
Li Wei Scopes: Production Flows to meet store buy quantity - (Image by Samir Saci)

With a 21-day lead time from Dhaka, she needed to commit on March 10th to receive goods by May 1st.

That was six days ago.

It is too late. The goods will not arrive on time for the campaign.
How Spreadsheets Quietly Cost Supply Chains Millions
Day 6: A first impact of the slow information transmission - (Image by Samir Saci)

Li Wei flags the issue in a reply-all email, but nobody responds until Wednesday.

Timeline - Day 11 (Monday): The monthly S&OP meeting happens.

  • Sarah presents her forecast.
  • Marc presents his buy plan with the Atlanta adjustment missing.
  • Li Wei raises the concern about the lead time.

The distribution team hears about the change for the first time.

How Spreadsheets Quietly Cost Supply Chains Millions
Day 11: The first time everybody sits at the same table - (Image by Samir Saci)
Distribution Team: "Where is the store allocation?"

It does not exist yet!

Timeline - Day 14+ (Thursday): Distribution finally receives the confirmed production order and starts planning the warehouse allocation.

But goods will arrive in late May at the earliest, missing the first two weeks of the Sports Fair.

How Spreadsheets Quietly Cost Supply Chains Millions
Day 14: Conclusion: stores will not be delivered On Time In Full - (Image by Samir Saci)

Result: investing in a marketing campaign without the inventory to convert it

  • Charlotte store will get late deliveries.
  • Atlanta gets nothing.

A $40,000 marketing investment that drives traffic to half-empty shelves in Charlotte and zero stock in Atlanta.

The lost sales from Atlanta alone exceed $1,500. The lost sales from Charlotte's late delivery push the total well past the cost of the campaign itself.

In the next section, we will simulate the exact same scenario using now SupPlan.

The same scenario, the same 52-day constraint, the same stores. The only variable we change is how the information travels.

What happens with a connected platform?

Let us imagine our scenario triggered by the same event at the exact same time.

But this time, Sarah uses the connected planning platform SupPlan instead of spreadsheets.

  1. Sarah opens the Demand Planning page and selects the Planner View tab.
  2. She filters by the SKU: Base Layer Top - Black.
How Spreadsheets Quietly Cost Supply Chains Millions
Planner View of the Demand Planning Module - (Image by Samir Saci)

Timeline - Day 1, 10:00 am: Sarah Opens the Planner View

  1. Sarah clicks on the forecast cell for Charlotte Outlet, 2026-05, types the new value, and presses Enter.
  2. She does the same for Atlanta Outlet.

For each change at the SKU x Store level, the tool provides an overview of the potential impacts.

How Spreadsheets Quietly Cost Supply Chains Millions
Cascade Impact Preview at the SKU x Store Level - (Image by Samir Saci)

She has increased the May forecast for Base Layer Top - Black by 50 units.

How Spreadsheets Quietly Cost Supply Chains Millions
Observation of the gap in 2026-05 due to the adjustment for the campaign.

These two changes are staged; that means they have not yet cascaded to the rest of the planning chain.

Timeline - Day 1, 11:00 am: Before saving, Sarah switches to the Forecasts tab.

The Cascade Impact Preview panel opens on the right.

How Spreadsheets Quietly Cost Supply Chains Millions
Overview of the impact of the staged changes - (Image by Samir Saci)

This window appears to inform Sarah about the cascading impact of these two changes:

  • Merchandising: what is the impact on buy? (+50 units)
  • Supply Planning: impact on factory orders? (+50 units to produce at Dhaka Garments, 52-day lead time)
  • Finance: additional revenue and costs? ($+3950 in revenue)

Sarah now sees the full downstream impact before committing to anything.

She saves the adjustment with the reason: "Southeast Sports Fair - May 2026" and clicks Run E2E Cascade to inform the other teams.

Timeline - Day 1, 02:15 pm: Marc opens the Merchandise Planning page.

A notification banner is already at the top of his screen:

How Spreadsheets Quietly Cost Supply Chains Millions
Notification appearing on the screen of Marc the Merchandiser - (Image by Samir Saci)
"Demand change: Base Layer Top - Black.
Forecast for Charlotte Outlet (Retail) in 2026-05 changed by +30 units (94 to 124).
Reason: TV campaign May-June, outlet stores, confirmed by marketing."

The system generates two updated buy orders for May 2026, already reflecting the new forecast quantities.

How Spreadsheets Quietly Cost Supply Chains Millions
New Buy Orders Generated from the change of demand forecast - (Image by Samir Saci)

Marc doesn't need to open an email, retype numbers, or reconcile a spreadsheet.

He simply opens the buy plan and finds two new draft lines already waiting for him with:

  • Updated quantities: former baseline + Sarah's forecast adjustments
  • Corresponding revenue projections: units x (unit price)
  • Margin impact: units x (unit margin)

He just has to approve each row and select the top-right button, Notify Supply, to inform Li Wei.

How Spreadsheets Quietly Cost Supply Chains Millions
Notify Supply transmits the two new Buy Orders of Marc to Li Wei - (Image by Samir Saci)

We saved a meeting and, more importantly, Marc will not miss Atlanta Standard!

Timeline - Day 1, 04:00 pm: Li Wei opens the Supply Planning page.

How Spreadsheets Quietly Cost Supply Chains Millions
Notifications received by Li Wei - (Image by Samir Saci)

The same notification is waiting for her informing her that:

  • Sarah updated the demand forecasts for the two stores
  • Marc created new buy orders reflecting this change

And she can find below two additional production orders created.

How Spreadsheets Quietly Cost Supply Chains Millions
Two additional production orders suggested by the tool following the forecast change - (Image by Samir Saci)

Unlike in the previous scenario, they are now expected to be delivered on time (May 1st, 2026).

If Li Wei confirms them today, the stores will be ready for the campaign!

How Spreadsheets Quietly Cost Supply Chains Millions
After confirmation she presses

She just has to press Notify Distribution, so the logistics team are informed about these additional shipments.

Timeline - Day 1, 05:30 pm: Omar Hassan, our distribution planner, receives a notification

How Spreadsheets Quietly Cost Supply Chains Millions
Notification of additional shipments - (Image by Samir Saci)

He is notified about the two new factory orders created by Li Wei.

How Spreadsheets Quietly Cost Supply Chains Millions
Details of the shipments - (Image by Samir Saci)

And two additional orders have been created, with a status of planned, to make sure that the finished goods received from the factory are transferred to the store.

Result of a completely integrated platform

Four teams aligned in a single working day, from demand forecast to distribution planning, without a single email, meeting, or re-typed number.

How Spreadsheets Quietly Cost Supply Chains Millions
14+ days vs 6 hours: Comparison of the timelines between the two scenarios - (Image by Samir Saci)

Because the cascade reached Li Wei on Day 1, the production order goes to Dhaka with the full 52-day lead time intact.

The product landed at the Southeast Regional DC on May 1st and reached Charlotte Outlet and Atlanta Standard by May 3rd.

Stores were replenished 2 days before customers arrived at the Sports Fair.

Atlanta also gets its +20 units (and avoids potential lost sales) because Sarah's adjustment was never lost in someone else's inbox.

Conclusion

I built SupPlan to simulate the impact of integrated business planning for medium-sized companies that still rely on spreadsheets and emails to coordinate their planning teams.

The SupFashion scenario shows that the problem is not with the forecast model.

It is the time it takes for a signal to travel from one team to the next.

What we covered in this article

The cascade from demand to supply: how a single forecast change propagates through merchandise and production planning, and why lead time constraints make every lost day expensive.

We stopped at the beginning of distribution: Omar receives the shipment notification, but the detailed warehouse allocation, routing, and last-mile delivery logic are not yet implemented.

What comes next

SupPlan is a foundation for testing optimisation algorithms designed by my startup LogiGreen, introduced in previous articles:

  • Production Scheduling with Wagner-Whitin for supply planning and manufacturing optimisation
Production Fixed Horizon Planning with Python
Implement the Wagner-Whitin algorithm to minimize the total costs of production given a set of constraints.
How Spreadsheets Quietly Cost Supply Chains Millions
  • Inventory Management Rules for store replenishment and safety stock optimisation
Inventory Management for Retail — Periodic Review Policy
Implement inventory management rules based on a periodic review policy to reduce the number of stores replenishments.
How Spreadsheets Quietly Cost Supply Chains Millions
  • Machine Learning for Sales Forecasting to replace the statistical baseline with adaptive models
Machine Learning for Retail Sales Forecasting - Features
Understand the impacts of additional features (stock-out, store closing date or cannibalisation) on an ML model for sales forecasting.
How Spreadsheets Quietly Cost Supply Chains Millions
  • Value Chain Mapping for business planning, including cost architecture and sales channel optimisation
Business Planning with Python — Revenue Optimization
How can you use data analytics to help small businesses maximize their revenue while maintaining or improving profitability?
How Spreadsheets Quietly Cost Supply Chains Millions

Each of these algorithms was designed in isolation. SupPlan is the environment where they come together and where their interactions become visible.

What I will improve

  • A complete distribution planning module with inbound flows (factory to warehouses) and outbound flows (warehouses to stores)
  • Detailed financial flows: manufacturing costs, logistics costs, COGS breakdown, revenue streams by sales channel, inventory valuation, and cash flow projections
How Spreadsheets Quietly Cost Supply Chains Millions
Product Roadmap - (Image by Samir Saci)

The platform is open-source and publicly available. You can replicate every scenario from this article, change a forecast, watch the cascade, and reset the data when you are done.

Try it now:

About Me

Let's connect on LinkedIn and Twitter. I am a Supply Chain Engineer who is using data analytics to improve logistics operations and reduce costs.

If you're looking for tailored consulting solutions to optimise your supply chain and meet sustainability goals, please contact me.

]]>
<![CDATA[How ElevenLabs Voice AI Is Replacing Screens in Warehouse and Manufacturing Operations]]>https://www.samirsaci.com/from-screens-to-voice-how-elevenlabs-can-change-the-way-we-run-operations/69c25e222cc03f0001fcdbd5Tue, 24 Mar 2026 15:18:03 GMT

A warehouse picking operation is the process of collecting items from storage locations to fulfil customer orders.

It is one of the most labour-intensive activities in logistics, accounting for up to 55% of total warehouse operating costs.

How ElevenLabs Voice AI Is Replacing Screens in Warehouse and Manufacturing Operations
Example of warehouse layout where opeartors need to pick in multiple locations - (Image by Samir Saci)ExpCreateCrecsssfdwf

For each order, an operator receives a list of items to collect from their storage locations.

They walk to each location, identify the product, pick the right quantity, and confirm the operation before moving to the next line.

In most warehouses, operators rely on RF scanners or handheld tablets to receive instructions and confirm each pick.

  • What happens when your operators need both hands to handle heavy items?
  • How do you onboard operators who don't read the local language fluently?

Voice picking solves this by replacing the screen with audio instructions: the system tells the operator where to go and what to pick, and the operator confirms verbally.

How ElevenLabs Voice AI Is Replacing Screens in Warehouse and Manufacturing Operations
Ilustration of an operator using voice picking - (Image by Samir Saci)

When I was designing supply chain solutions in logistics companies, vocalisation was the default choice, especially for price-sensitive projects.

Based on my experience, with vocalization operators' productivity can reach 250 boxes/hour for retail and FMCG operations.

The concept is not new. Hardware providers and software editors have offered voice-picking solutions since the early 2000s.

But these systems come with significant constraints:

  • Proprietary hardware at $2,000 to $5,000 per headset
  • Vendor-locked software with limited customisation
  • Long deployment cycles of 3 to 6 months per site
  • Rigid language support that requires retraining for each new language

For a 50-person warehouse, the total investment reaches $150K to $300K, excluding training costs.

What if you could achieve similar results using a smartphone, a browser, and modern AI voice technology?

In this article, I will show how I built a minimalist voice-picking module that integrates with Warehouse Management Systems, using ElevenLabs for text-to-speech and speech recognition.

How ElevenLabs Voice AI Is Replacing Screens in Warehouse and Manufacturing Operations
Example of screens of this app designed to be used on smartphone with vocal interface - (Image by Samir Saci)

This web application has been deployed in the distribution centre of a small supermarket chain.

The objective is not to design solutions that compete with market leaders, but rather to offer an alternative to operations that lack the capacity to invest in expensive equipment.

Problem Statement

Before we get into voice picking, let me introduce the operations this AI-powered web application will support.

How ElevenLabs Voice AI Is Replacing Screens in Warehouse and Manufacturing Operations
Layout of the distribution center - (Image by Samir Saci)

This is the central distribution centre of a small supermarket chain that delivers to 50 stores in Central Europe.

How ElevenLabs Voice AI Is Replacing Screens in Warehouse and Manufacturing Operations
Layout of the warehouse with 10 aisles and 12 pallet positions displayed on the app - (Image by Samir Saci)

The facility is organised in a grid layout with aisles (A through L) and positions along each aisle:

  • Each location stores a specific SKU with a known quantity of boxes.
  • Operators need to know where to go and what to expect when they arrive.

In the application, our operators can tap any location on the grid to see its contents: the SKU reference, the number of boxes currently stored, and any notes attached to that position.

How ElevenLabs Voice AI Is Replacing Screens in Warehouse and Manufacturing Operations
Operators can check their picking list but also detailed information per location - (Image by Samir Saci)

This visual layout, connected to the Warehouse Management System (WMS) database, also supports inventory cycle counting, but here we focus on its role as the spatial reference for picking operations.

Now let's see how operators use this visual interface to prepare orders.

How the Picking Flow Works

A picking batch is a group of customer orders consolidated into a single work assignment.

The system generates a batch with multiple order lines with instructions:

  • Where to go (the storage location)
  • What to pick (the SKU reference)
  • How many boxes to collect
How ElevenLabs Voice AI Is Replacing Screens in Warehouse and Manufacturing Operations
Picking list (left), layout (middle), details of location (right) - (Image by Samir Saci)

The operator processes each line sequentially.

Once they confirm a pick, the system advances to the next instruction.

This sequential flow is critical because it determines the walking path through the warehouse using a pathfinding algorithm to minimise the total distance.

How ElevenLabs Voice AI Is Replacing Screens in Warehouse and Manufacturing Operations
Example of the original pathfinding solution (bottom) and the optimized (top)

Thanks to our control here (this is a custom application), we can implement this optimisation without relying on an external editor.

Initially, the customer planned to purchase a commercial solution (for voice picking) and wanted me to integrate the pathfinding solution.

After investigation, they discovered that it would have been more expensive to integrate the app into the vendor solution than to build something from scratch.

What is the process without the AI-based voice feature?

Manual Mode: The Screen-Based Baseline

In manual mode, the operator reads each instruction on screen and confirms by tapping a button.

This is the simplest version of the picking flow, as it works on any device and requires no audio capability.

Two actions are available at each step:

  • Confirm Pick: operator collected the right quantity
  • Report Issue: the location is empty, the quantity doesn't match, or the product is damaged
How ElevenLabs Voice AI Is Replacing Screens in Warehouse and Manufacturing Operations
Our operator has to press the button to confirm the picking or report an issue - (Image by Samir Saci)

I built the manual mode as a reliable fallback in case we have issues with Elevenlabs.

But it keeps the operator's eyes and one hand tied to the device at every step.

We need to add vocal commands!

Voice Mode: Hands-Free with ElevenLabs

Now that you know why we want the voice mode to replace screen interaction, let me explain how I added two AI-powered components.

Text-to-Speech: ElevenLabs Reads the Instructions

When the operator starts a picking session in voice mode, each instruction is converted to speech using the ElevenLabs API.

Instead of reading "Location A-03-2, pick 4 boxes of SKU-1042" on a screen, the operator hears a natural voice say:

"Location Alpha Three Two. Pick four boxes."

ElevenLabs provides several advantages over basic browser-based TTS:

  • Natural intonation that is easier to understand in a noisy warehouse
  • 29+ languages available out of the box, with no retraining
  • Consistent voice quality across all instructions
  • Sub-second generation for short sentences like pick instructions

But what about speech recognition?

Speech-to-Text: The Operator Confirms Verbally

After hearing the instruction, the operator walks to the location, picks the items, and needs to confirm.

Here, I made a deliberate design choice relying on speech recognition and the reasoning capabilities of ElevenLabs.

Using a single endpoint, we capture the response and match it against expected commands:

  • "Confirm" or "Done" to validate the pick
  • "Problem" or "Issue" to flag a discrepancy
  • "Repeat" to hear the instruction again
How ElevenLabs Voice AI Is Replacing Screens in Warehouse and Manufacturing Operations
The complete process from left to right: Step 1 -> Step 2 -> Step 3 - (Image by Samir Saci)

For a multilingual warehouse, this is a significant benefit:

  • A Czech operator and a Filipino operator can both receive instructions in their native language from the same system, without any hardware change.
  • I don't have to consider all the languages possible in the design of the solution

For another product, the inventory cycle count tool presented in this article, I have used n8n with AI agent nodes to perform the same task.

How ElevenLabs Voice AI Is Replacing Screens in Warehouse and Manufacturing Operations
n8n workflow for the voice-powered inventory cycle count tools - (Image by Samir Saci)

This was working quite well, but it required a more complex setup

  • Two AI nodes: one for the audio transcription and one AI agent to format the output of the transcription
  • The system prompts were assuming that the operator was speaking English

I have replaced that with a single ElevenLabs endpoint with multi-lingual capabilities.

Putting both components together, a single pick cycle looks like this:

  1. The app calls ElevenLabs to generate the audio instruction
  2. The operator hears: "Location Alpha Three Two. Pick four boxes."
  3. The operator walks to the location (hands free, eyes free)
  4. The operator picks the items
  5. The operator presses the microphone button
  6. The operator says: "Confirm"
  7. The speech recognition endpoint processes the confirmation and moves to the next pick
How ElevenLabs Voice AI Is Replacing Screens in Warehouse and Manufacturing Operations
The Complete Voice Picking Cycle - (Image by Samir Saci)

The entire interaction takes a few seconds of system time.

What about the costs?

This is where the comparison with traditional systems becomes striking.

How ElevenLabs Voice AI Is Replacing Screens in Warehouse and Manufacturing Operations
Comparative study - (Image by Samir Saci)

For this mid-size warehouse with 35 operators, they estimated that the traditional approach costs roughly $60K to $150K in the first year.

The AI-powered approach costs a few API calls.

The trade-off is clear: traditional systems offer proven reliability and offline capability for high-volume operations.

But we have the manual solution as a rollback.
How ElevenLabs Voice AI Is Replacing Screens in Warehouse and Manufacturing Operations
Tehnical architecture of this application - (Image by Samir Saci)

This AI-powered approach offers accessibility and speed for organisations that cannot justify a six-figure investment.

What Does that Mean for Operations Leaders?

Voice picking is no longer a technology reserved for the largest 3PLs and retailers with deep pockets.

If your warehouse has WiFi and your operators have smartphones, you can prototype a voice-guided picking system in days and test it on a real batch to measure the impact before committing any significant budget.

Three scenarios where this approach makes particular sense:

  • Multilingual facilities where operators struggle with screen-based instructions in a language that is not their own
  • Multi-site operations where deploying proprietary hardware to every small warehouse is not economically viable
  • High-turnover environments where training time on complex scanning systems directly impacts productivity during peak periods

Good news, the same architecture extends beyond picking.

Voice-guided workflows can support any process where an operator needs instructions while keeping their hands free.

You can find a live demo of an inventory cycle counting tool in this video:

About Me

Let's connect on LinkedIn and Twitter. I am a Supply Chain Engineer who is using data analytics to improve logistics operations and reduce costs.

If you're looking for tailored consulting solutions to optimise your supply chain and meet sustainability goals, please contact me.

]]>
<![CDATA[The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%]]>https://www.samirsaci.com/the-hidden-cost-of-walking-how-smart-batching-cuts-warehouse-labour-costs-by-20/69b132682158250001d44cc4Wed, 11 Mar 2026 10:12:44 GMT

In a Distribution Center (DC), walking time from one location to another during the picking route can account for 60% to 70% of the operator's working time.

For a warehouse processing 5,000 order lines per day, that means your team spends the equivalent of 4 to 5 full-time operators just walking, not picking, not packing or adding value.

Reducing this walking time is the most effective way to increase your DC overall productivity.

The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Layout of the warehouse we are going to use for this experimentation

In this article, I will show you how two simple strategies

  • Order Wave Batching : grouping multiple orders in the same picking wave
  • Picking Location Clustering : grouping the orders by zone

This will reduce total walking distance by up to 35% without changing your warehouse layout, your WMS, or your team size.

The Business Problem

Consider a luxury fashion retailer with an E-Commerce type DC where items are stored on 4-level shelves.

These shelves are organised in multiple rows (Row#: 1 … n) and aisles (Aisle#: A1 … A_n).

The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Warehouse Picking Cart

Here are our assumptions:

  1. Items' Dimensions: Small and light dimensions of items
  2. Picking Cart: lightweight picking cart with a capacity of 10 orders
  3. Picking Route: Picking Route starts and ends at the same location

Every day, your distribution planners receive thousands of order lines from the OMS (Order Management System).

The question is: how do you group these orders and sequence the picks to minimise walking distance?

Understanding the Cost of Walking

To understand the impact of walking distance, we need to translate the warehouse layout into something we can measure.

Mapping Storage Locations to Coordinates

Based on the actual warehouse layout, storage locations are mapped with 2-D (x, y) coordinates that will be used to measure walking distance.

The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%

Every storage location is linked to a Reference using Master Data. (For instance, reference #I23129 is located in coordinate (x3, y8)).

You can then link every order line to a geographical location for picking.

Order Lines from your Warehouse Management System WMS

The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Dataset used to map our locations

Order lines can be extracted from your WMS Database.

This table should be joined with the Master Data table to link every order line to a storage location and its (x, y) coordinate in your warehouse.

Calculating Walking Distance Between Two Locations

Here is the key challenge: in a warehouse, walking distance is not the same as straight-line distance.

The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Two differents path from I (xi, yi) to J (xj, yj?

A picker cannot walk through shelves. They must walk around the aisles. This means the actual walking distance between two points depends on the warehouse layout, not just the coordinates.

This is critical. If you use Euclidean distance (straight line) to estimate walking time, you will underestimate the real cost.

For a detailed walkthrough of how to build the distance calculation functions and map your WMS data to warehouse coordinates, see my technical deep dive: Improve Warehouse Productivity using Order Batching with Python

Strategy 1: Order Wave Batching

The first intuitive way to optimise this process is to group orders that share common picking locations into the same wave.

What is Wave Picking?

Instead of picking one order at a time, your picker collects items for multiple orders on a single route.

The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Worst case scenario

In the worst scenario (Scenario 1), a single order is picked per wave. The picker walks the entire warehouse for just a few items.

This can be easily optimised because:

  • Locations: Orders #1 and #2 have common picking locations
  • Zones: orders have picking locations in a common zone
  • Single-line Orders: items_picked/walking_distance efficiency is very low
The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Best scenario: we combine orders

The first intuitive way to optimise this process is to combine these three orders in one picking route — this strategy is commonly called Wave Picking.

How Does Wave Picking Work?

For each wave, the picking route strategy follows the Next Closest Location logic:

The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Next Closest Location Applied in this example

This function will choose the next location among several candidates to continue your picking route.

Objective: return the closest location as the best candidate.

Testing the Impact of Wave Picking

We can now test our picking route strategy with picking order lines.

  • Orders Waves: orders are grouped by chronological order of receiving time from OMS (TimeStamp)
  • Picking Route: The picking route strategy follows the Next Closest Location logic

To estimate the impact of the wave picking strategy on your productivity, we will run several simulations with a gradual number of orders per wave.

The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Impact on total distance with the number of orders

Results for 5,000 order lines with a ratio from 1 to 8 orders per route:

The total walking distance decreases as you increase the number of orders per wave.

More orders per wave means more shared locations, which means shorter total routes.

I built a full simulation model to test these scenarios with Python. You can access the source code and reproduce the results with your own data: Improve Warehouse Productivity using Order Batching with Python

But This Solution Is Far from Optimal

While wave picking improves productivity, it has a fundamental limitation: it groups orders by time of arrival, not by location.

Orders that arrive together may have picking locations scattered across opposite ends of the warehouse.

Orders can be grouped by geographical clusters of Picking Locations to reduce pickers' walking distance.

Strategy 2: Picking Location Clustering

This is where the real gains come from.

The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Distances define the clusters of locations

The Idea

Instead of grouping orders by arrival time, we group them by where their items are located in the warehouse.

Single-line orders have the advantage of being located in a single storage location; grouping several single-line orders by cluster can ensure that our picker will stay in a delimited zone.

The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Two approaches of order allocation optimisation

Before looking at complex algorithms, we can find insights into optimising our algorithm with simple solutions.

Where Are Single-Line Orders Located?

The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Order Lines DataFrame — (Image by Author)
The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Distribution of single-line orders lines per storage location — 5,000 order lines (%)

Insights: for the example of the distribution above:

  • Scope: 5,000 order lines for 23 aisles
  • Single line orders: 48% of orders located in alleys A11, A10, and A09

This concentration is exactly what makes clustering powerful. Nearly half of all single-line orders are in just three aisles.

How Clustering Works

The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Order Lines Processing for Order Wave Picking using Clustering by Picking Location — (Image by Author)

Idea: Picking Locations Clusters

Group picking locations by clusters to reduce the walking distance for each picking route. (Example: the maximum walking distance between two locations is <15 m.)

Spatial clustering is the task of grouping together a set of points in a way that objects in the same cluster are more similar to each other than to objects in other clusters.

The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Example of three Picking Locations Clusters — (Image by Author)

Here, the similarity metric will be walking distance from one location to another.

For instance, I would like to group locations to ensure the maximum walking distance between two locations is 10 m.

Challenge: Euclidean Distance vs. Walking Distance

For our specific model, we cannot use conventional clustering methods using Euclidean Distance.

Indeed, walking distance (using our warehouse layout) is different from Euclidean Distance.

The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Euclidian vs. Custom Distance Example — (Image by Author)

For this specific example, Euclidean distances between I (x1, Y1) and the two points p (x_p, y_p) and j (x_j, y_j) are equal.

But if we compare picker Walking Distance, p(x_p, y_p) is closer.

For this model, Picker's Walking Distance is the specific metric that we want to reduce. Therefore, the clustering algorithm should use our custom-made distance_walking function for better performance.

The implementation of the custom walking distance function and the clustering algorithm using Scipy's ward and fcluster is detailed step by step in: Improve Warehouse Productivity using Spatial Clustering with Python

Clustering Applied: Comparing Three Methods

The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Left [Clustering using Walking Distance] / Right [Clustering using Euclidian Distance] — (Image by Author)

The left example using Walking Distance is grouping locations within the same aisle, reducing picking route distance; while the right example can group locations covering several aisles.

Handling Multi-Line Orders

Unlike single-line orders, multi-line orders can cover several picking locations. However, we can apply the same methodology applied to the centroids of storage locations.

The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Centroid of three Picking Locations — (Image by Author)

Example: Order with 3 lines covering 3 different picking locations.

For a set of orders, lines extract single lines (df) orders, clusters id and orders number; this function you map your Dataframe with cluster ID for wave creation.

Results: What Does This Actually Save?


Model Simulation

We have several steps before picking routes to create using wave processing.

At each step, we have a collection of parameters that can be tuned to improve performance:

The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Model Construction with Parameters — (Image by Author)

Comparing Three Methods of Wave Processing

The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Three Methods for Wave Processing — (Image by Author)

We'll first assess the impact of Order Wave processing by clusters of picking locations on total walking distance.

We'll be testing three different methods:

  • Method 1: We do not apply clustering (i.e. Initial Scenario)
  • Method 2: We apply clustering on single-line orders only
  • Method 3: We apply clustering to single-line orders and centroids of multiline orders

Scenario for Simulation:

  • Order lines: 20,000 Lines
  • Distance Threshold: Maximum distance between two picking locations (distance_threshold = 35 m)
  • Orders per Wave: orders_number in [1, 9]
The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Test 1: 20,000 Order Lines / 35 m distance Threshold — (Image by Author)

Results:

  • Best Performance: Method 3 for nine orders/Wave with 83% reduction of walking distance
  • Method 2 vs. Method 1: Clustering for mono-line orders reduces the walking distance by 34%
  • Method 3 vs. Method 2: Clustering for mono-line orders reduces the walking distance by 10%
You can reproduce these simulations with your own order data. The full model with source code and parameters is available in:
Improve Warehouse Productivity using Spatial Clustering with Python

Tuning the Distance Threshold

Now that we validated that Method 3 is the best for our particular scenario (20,000 order lines, 35 m Distance Threshold), let us look at the Distance Threshold's impact on total walking distance.

The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Different distance threshold for Picking Location Clustering — (Image by Author)

The trade-off between Walking Distance between two locations and Wave Size:

  • Low Distance: The walking distance between two locations is low, but you have fewer orders per wave (more waves)
  • High Distance: The walking distance between two locations is higher but you have more orders per wave (fewer waves)
The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Results for 5,000 lines grouped in Waves of 9 orders with Distance Threshold in [1, 95] (m) — (Image by Author)

We can find a local minimum for Distance_Threshold = 60 m, where the distance is reduced by 39% vs. Distance_Threshold = 1 m.

The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
Results for 20,000 lines grouped in Waves of 9 orders with Distance Threshold in [1, 95] (m) — (Image by Author)

We can find a local minimum for Distance_Threshold = 50 m, where the distance is reduced by 27% vs. Distance_Threshold = 1 m.

What This Means for Your Business

Let me translate these numbers into business impact.

If your warehouse processes 20,000 order lines per day with a team of 20 pickers:

  • 60-70% of their time is walking. That is the equivalent of 12-14 full-time pickers doing nothing but walking.
  • An 83% reduction in walking distance means you recover the equivalent of 10-11 FTEs of productive time.
  • Even the conservative 27-35% improvement from basic clustering means 3-4 FTEs of recovered capacity — without hiring anyone.

This is not a technology investment. This is an algorithm change in how you assign orders to waves and sequence picks. The warehouse layout stays the same. The team stays the same. The WMS stays the same.

The only thing that changes is the logic behind order batching.

Want to test this on your warehouse data? I have published the complete methodology with source code for both strategies:Order Batching with Python — wave picking simulation and distance calculationSpatial Clustering with Python — clustering algorithm and parameter tuning

Next Step

Based on this feedback, the next steps will be:

  • Picking Route Creation: For a list of Picking Locations, how can we find the best route minimising walking distance?

We will explore how pathfinding algorithms based on the Travelling Salesman Problem can be applied to design optimal picking routes within each cluster.

The Hidden Cost of Walking: How Smart Batching Cuts Warehouse Labour Costs by 20%
OR-Tool TSP Optimization Solution Route for 21 Locations (Distance: 384 m) — (Image by Author)

About Me

Let's connect on LinkedIn and Twitter. I am a Supply Chain Engineer that is using data analytics to improve logistics operations and reduce costs.

If you're looking for tailored consulting solutions to optimise your supply chain and meet sustainability goals, please contact me.

References

[1] Samir Saci, Improve Warehouse Productivity using Order Batching with Python

[2] Samir Saci, Improve Warehouse Productivity using Spatial Clustering with Python

]]>
<![CDATA[AI Apps for Operations]]>LogiGreen AI Apps is a suite of lightweight, mobile-first tools designed to solve everyday operational problems in logistics and supply chain management.

Made by continuous improvement engineers to support operational teams.

The idea is to fill the gaps where enterprise software falls short:

  • Digitalisation of manual processes: cycle count, order
]]>
https://www.samirsaci.com/ai-apps-for-operations/69a18cc3931e960001bafebfFri, 27 Feb 2026 13:59:01 GMT

LogiGreen AI Apps is a suite of lightweight, mobile-first tools designed to solve everyday operational problems in logistics and supply chain management.

Made by continuous improvement engineers to support operational teams.

The idea is to fill the gaps where enterprise software falls short:

  • Digitalisation of manual processes: cycle count, order preparation, repacking
  • Automate reporting for operators: Proof of Delivery, Damage Report

These tools leverage multimodal AI models with voice recognition, image analysis, and natural language processing in a single app designed for operators in warehouses, factories, and trucks.

Warehouse Damage Reports Generated with AI

In a warehouse, receiving damaged goods can quickly become a nightmare.

AI Apps for Operations

Because receiving can become a bottleneck for your distribution team, inbound operations teams are under significant pressure.

When they receive damaged goods, the whole machine has to stop to follow a specific process:

  1. Damages have to be reported with detailed information
  2. Operators need to attach pictures of the damaged goods

For operators that have high productivity targets (boxes received per hour), this administrative charge can quickly become unmanageable.

With the app, it can be done in less than 30 seconds:

  1. The operator starts by uploading the picture of the damaged pallet.
  2. The operator scans the bar code and clicks on Generate Report
  3. The app confirms the report generation
AI Apps for Operations
LogiGreen AI Apps - Warehouse Damage Report: Try it

The quality team receives a comprehensive description of the damages with key information related to the damaged goods.

Vocalisation of Inventory Cycle Count

I saw many teams conducting inventory cycle counts using spreadsheets.

AI Apps for Operations

They print them, and counters go to each location to compare the system quantity with the actual one.

We can replace these printed sheets with the inventory cycle count app.

AI Apps for Operations

The app guides the operators across the warehouse to check the right locations and records the information (Example: "Location K5, 12 units) using the voice recognition connected to the audio input.

AI Apps for Operations
The spreadsheet associated is automatically filled with the information collected

The operator does not need to print anything; the input is done by voice.

Try it now!

Here is a demo version: Demo

]]>
<![CDATA[AI Chinese Pronunciation Coach]]>No one learns a language by passively turning pages in a textbook.

That is why I created Yin, the AI-powered Language coach designed to help you improve your Mandarin.

Three types of exercices to improve your mandarin

It includes three features:

  • Pronunciation Exercises
  • Multiple Choice Questions (MCQ)
  • Flash Cards

The

]]>
https://www.samirsaci.com/ai-chinese-pronunciation-coach/699ed1dfba49820001c235ddFri, 27 Feb 2026 10:17:34 GMT

No one learns a language by passively turning pages in a textbook.

That is why I created Yin, the AI-powered Language coach designed to help you improve your Mandarin.

AI Chinese Pronunciation Coach
Three types of exercices to improve your mandarin

It includes three features:

  • Pronunciation Exercises
  • Multiple Choice Questions (MCQ)
  • Flash Cards

The idea is to learn vocabulary that you can read and use in conversations.

Pronunciation Exercises: AI will correct your tones

The focus here is on improving my pronunciation of logistics and supply chain terms (my field of expertise).

For each word, we have:

  • The word in Simplified Mandarin Characters: 合同
  • The sentence used to practise my pronunciation: 我们需要在发货前签署这份运输合同。
  • The English translation: We need to sign this transport contract before shipping the goods.

For beginners, we can even add phonetics (Mandarin pinyin) using the toggle.

How to practice pronunciation?

I just have to press the mic button at the bottom to record my sentence.

AI Chinese Pronunciation Coach
Analysis in progress for two examples - (Image by Samir Saci)

The recording is automatically sent to the backend for analysis that compares my pronunciation with the correct one.

A few seconds later, I received my feedback.

The feedback is quite detailed; it focuses on the words that you mispronounced.

AI Chinese Pronunciation Coach

It’s nearly like having a personal teacher correcting me in real time, except this one never gets tired.

Try it now!

Demo version: here

]]>
<![CDATA[Can AI Solve Failures in your Supply Chain?]]>https://www.samirsaci.com/can-ai-find-the-root-cuse-of-supply-chain-failures/6967a58b15621e0001890064Tue, 17 Feb 2026 08:43:38 GMT

A retail distribution chain is a goal-oriented network of processes and stock points that delivers finished goods to stores.

Consider a luxury fashion retailer with a central distribution chain that delivers to stores worldwide (the USA, Asia-Pacific, and EMEA) from a warehouse located in France.

Can AI Solve Failures in your Supply Chain?
All the steps

When the store 158 located at Nanjing West Road (Shanghai, China) needs 3 leather bags (reference AB-7478) by Friday, a distribution planner creates a replenishment order, which is sent to the warehouse for preparation.

If the shipment arrives after Friday, the store may miss sales due to insufficient inventory.

Can AI Solve Failures in your Supply Chain?
All the steps from a replenishment order creation to its delivery at the store

Between order creation and store delivery, our shipment will go through multiple steps involving IT, warehouse, and transportation teams.

Each step can be a source of delays.

Who is responsible if a shipment is delivered late?

If a shipment misses a cut-off time, it can be due to late order transmission, an excessively long preparation time, or a truck that left the warehouse too early.

Unfortunately, static dashboards are not always sufficient to find root causes.

Distribution planners must dig into the data to find the actual root causes of each scenario.

Therefore, I have seen distribution planning teams spend dozens of hours per week manually crunching data to answer these questions.

The most complicated task in Supply Chain Management is dealing with humans.

This is critical, as managers (transportation, warehouse, air freight) will try to shift responsibility among themselves to cover their own teams.

Can AI Solve Failures in your Supply Chain?
Challenges faced by the distribution planners to find the root causes - (Image by Samir Saci)

Because root cause analysis is the first step of continuous improvement, we must find a way to support planners.

You cannot solve an operational problem if you cannot find the root cause.

In this article, you will discover how an AI Agent can support distribution planning teams in performing these complex root cause analyses.

The idea is to use the reasoning capabilities of Claude models to identify failures in distribution chains and answer natural-language questions.

Can AI Solve Failures in your Supply Chain?
MCP Implementation using Claude Opus 4.6 - (Image by Samir Saci)

We want the tool to answer open questions with data-driven insights without hallucinations.

What is the responsability of warehouse teams in the overall performance?

These are actual interrogations that distribution planning managers must answer in day-to-day basis.

Can AI Solve Failures in your Supply Chain?
Example of analysis performed by Claude to answer the question: Should we blame road transportation teams for delays? - (Image by Samir Saci)

This agentic workflow uses the Claude Opus 4.6 model, connected via an MCP Server to a distribution-tracking database to answer our questions.

Can AI Solve Failures in your Supply Chain?
Example of performance assessment of the warehouse operational teams - (Image by Samir Saci)

I will use a real-world scenario to test the ability of the agent to support teams in conducting analyses beyond what static dashboards can provide:

  • Solve conflicts between teams (transportation vs. warehouse teams)
  • Understand the impact of cumulative delays
  • Assess the performance of each leg

Understand Logistics Performance Management

We are supporting a luxury fashion retail company with a central distribution warehouse in France, delivering to stores worldwide via road and air freight.

The International Distribution Chain of a Fashion Retailer

A team of supply planners manages store inventory and generates replenishment orders in the system.

Can AI Solve Failures in your Supply Chain?
Distribution chain: from order creation to store delivery - (Image by Samir Saci)

From this, a cascade of steps until store delivery

  • Replenishment orders are created in the ERP
  • Orders are transmitted to the Warehouse Management System (WMS)
  • Orders are prepared and packed by the warehouse team
  • Transportation teams organise everything from the pickup at the warehouse to the store delivery via road and air freight

In this chain, multiple teams are involved and interdependent.

Can AI Solve Failures in your Supply Chain?
Warehouse operational teams prepare the orders received in the WMS and load them in the trucks heading to the airport - (Image by Samir Saci)

Our warehouse team can start preparation only after orders are received in the system.

Their colleagues in the transportation team expect the shipments to be ready for loading when the truck arrives at the docks.

This creates a cascade of potential delays, especially considering cut-off times.

Can AI Solve Failures in your Supply Chain?
Key timestamps and cut-off times - (Image by Samir Saci)
  • Order Reception: if an order is received after 18:00:00, it cannot be prepared the day after (+24 hours in LT)
  • Truck leaving: if an order is not packed before 19:00:00, it cannot be loaded the same day (+24 hours in LT)
  • Arrival at Airport: if your shipment arrives after 00:30:00, it misses the flight (+24 hours LT)
  • Landing: if your flight lands after 20:00:00, you need to wait an extra day for customs clearance (+24 hours LT)
  • Store Delivery: if your trucks arrive after 16:30:00, your shipments cannot be received by store teams (+24 hours LT)

If a team experiences delays, they will affect the rest of the chain and, eventually, the lead time to deliver to the store.

Can AI Solve Failures in your Supply Chain?
Example on how delays at the airport can impact the rest of the distribution chain - (Image by Samir Saci)

Hopefully, we are tracking each step in the delivery process with timestamps from the ERP, WMS, and TMS.

Can AI Solve Failures in your Supply Chain?
Timestamps and leadtime monitoring shipments across the distribution chain - (Image by Samir Saci)

For each element of the distribution chain, we have:

  • The timestamp of the completion of the task
    Example: we record the timestamp when the order is received in the Warehouse Management System (WMS) and is ready for preparation.
  • A target timing for the task completion

For the step linked to a cut-off time, we generate a Boolean Flag to verify whether the associated cut-off has been met.

Problem Statement

Our distribution manager does not want to see his team manually crunching data to understand the root cause

This shipment has been prepared two hours late, so it was not packed on time and had to wait the next day to be shipped from the warehouse.

This is a common issue I encountered while responsible for logistics performance management at an FMCG company.

I struggled to explain to decision-makers that static dashboards alone cannot account for failures in your distribution chain.

In an experiment at my startup, LogiGreen, we used Claude Desktop, connected via an MCP server to our distribution planning tool, to support distribution planners in their root-cause analyses.

And the results are quite interesting!

How AI Agents Can Analyse Supply Chain Failures?

Let us now see what data our AI agent has on hand and how it can use it to answer our operational questions.

We put ourselves in the shoes of our distribution planning manager using the agent for the first time.

Distribution Planning

We took one month of distribution operations:

  • 11,365 orders created and delivered
  • From December 16th to January 16th

For the input data, we collected transactional data from the systems (ERP, WMS and TMS) to collect timestamps and create flags.

A quick Exploratory Data Analysis shows that some processes exceeded their maximum lead-time targets.

Can AI Solve Failures in your Supply Chain?
Impact of transmission and picking time on loading lead time - (Image by Samir Saci)

In this sample of 100 shipments, we missed the loading cutoff time for at least six orders.

This means the truck left the warehouse, en route to the airport, without these shipments.

These issues likely affected the rest of the distribution chain.

What does our agent have on hand?

In addition to the lead times, we have our boolean flags.

Can AI Solve Failures in your Supply Chain?
Example of boolean flags variability: blue means that the shipment is late for this specific distribution step - (Image by Samir Saci)

These booleans measure if the shipments passed the process on time:

  • Transmission: Did the order arrive at the WMS before the cut-off time?
  • Loading: Are the pallets in the docks when the truck arrived for the pick-up?
  • Airport: The truck arrived on time, so we wouldn't miss the flight.
  • Custom Clearance: Did the flight land before customs closed?
  • Delivery: We arrived at the store on time.
Can AI Solve Failures in your Supply Chain?
Overview of the delivery performance for this analysis - (Image by Samir Saci)

For slightly less than 40% of shipments, at least one boolean flag is set to False.

This indicates a distribution failure, which may be attributable to one or more teams.

Can our agent provide clear and concise explaination that can be used to implement action plans?

Let us test it with complex questions.

Test 1: A distribution planner asked Claude about the flags

To familiarise myself with the tool, I began the discussion by asking the agent what he understood from the data he had on hand.

Can AI Solve Failures in your Supply Chain?
Definition of the boolean flags according to Claude - (Image by Samir Saci)

This demonstrates that my MCP implementation, which uses docstrings to define tools, conforms to our expectations for the agent.

Test 2: Challenging its methodology

Then I asked the agent how we would use these flags to assess the distribution chain's performance.

Can AI Solve Failures in your Supply Chain?
Root Cause Analysis Methodology of the Agent - (Image by Samir Saci)

In this first interaction, we sense the capability of Claude Opus 4.8 to understand the complexity of this exercise with the minimal information provided in the MCP implementation.

Testing the agent with real-world operational scenarios

I am now confident enough to test the agent on real-world scenarios faced by our distribution planning team.

They are responsible for the end-to-end performance of the distribution chain, which includes actors with divergent interests and priorities.

Can AI Solve Failures in your Supply Chain?
Challenges faced by the distribution planners - (Image by Samir Saci)

Let us see whether our agent can use timestamps and boolean flags to identify the root causes and arbitrate potential conflicts.

Can AI Solve Failures in your Supply Chain?
Let me remind you of the overview of the delivery performance for this analysis - (Image by Samir Saci)

However, the real test is not whether the agent can read data.

The question is whether it can navigate the messy, political reality of distribution planning, where teams blame one another and dashboards may obscure the truth.

Let's start with a tricky situation!
Scenario 1: challenging the local last-mile transportation team

According to the data, we have 2,084 shipments that only missed the latest boolean flag Delivery OnTime.

The central team assumes this is due to the last-mile leg between the airport and the store, which is under the local team's responsibility.

For example, the central team in France is blaming local operations in China for late deliveries in Shanghai.

The local manager disagrees, pointing to delays at the airport and during customs clearance.

P.S.: This scenario is common in international supply chains with a central distribution platform (in France) and local teams overseas (in the Asia-Pacific, North America, and EMEA regions).

Let us ask Claude if it can find who is right.

Can AI Solve Failures in your Supply Chain?
Initial nuance of the agent based on what has been extracted from data - (Image by Samir Saci)

Claude Opus 4.6 here demonstrates exactly the behaviour that I expected from him.

The agent provides nuance by comparing the flag-based approach to static dashboards with an analysis of durations, thanks to the tools I equipped it.

Can AI Solve Failures in your Supply Chain?
Analysis of variance for the last leg (Airport -> Store) under the responsibility of the local team - (Image by Samir Saci)

This states two things:

  • Local team's performance (i.e. Airport -> Store) is not worse than the upstream legs managed by the central team
  • Shipments leave the airport on time

This indicates that the problem lies between takeoff and last-mile store delivery.

Can AI Solve Failures in your Supply Chain?
Reminder of the overall distribution chains - (Image by Samir Saci)

This is exactly what Claude demonstrates below:

Can AI Solve Failures in your Supply Chain?
Demonstration of Air Freight's partial responsability - (Image by Samir Saci)

The local team is not the only cause of late deliveries here.

However, they still account for a large share of late deliveries, as explained in Claude's conclusion.

Can AI Solve Failures in your Supply Chain?
Claude's conclusion - (Image by Samir Saci)

What did we learn here?

  • The local team responsible for the last mile still needs to improve its operations, but it is not the only party responsible for delays.
  • We need to talk to the Air Freight team about their lead time variabilty that affect the overall performance even when they don't miss cut-off times.

In Scenario 1, the agent navigated a disagreement between headquarters and a local team.

And it found that both sides had a point!

But what happens when a team's argument is based on a fundamental misunderstanding of how the KPIs work?

Scenario 2: a fight between the warehouse and the central transportation teams

We have 386 shipments delayed, where the only flag at False is Loading OnTime.

The warehouse teams argue that these delays are due to the late arrival of trucks; i.e., orders prepared and ready on time were waiting for the trucks to load.

Is that true? No, this claim is due to a misunderstanding of the definition of this flag.

Let us see if Claude can find the right words to explain that to our distribution planner.

Can AI Solve Failures in your Supply Chain?
Reminder of the overall distribution chains - (Image by Samir Saci)

Because we do not have a flag indicating whether the truck arrived on time (only a cutoff to determine whether it left on time), there can be some ambiguity.

Claude can help us to clarify that.

Can AI Solve Failures in your Supply Chain?
Initial Answer from Claude - (Image by Samir Saci)

For this question, Claude exactly did what I expected:

  • He used the tool to analyse the distribution of lead times per process (Transmission, Picking and Loading)
  • Explained the right significance of this flag to the distribution planner in the key insight paragraph

Now that the distribution planner knows that it's wrong, Claude will provide the right elements to respond to the warehouse team.

Can AI Solve Failures in your Supply Chain?
Correct the statement and data - (Image by Samir Saci)

Unlike in the first scenario, the remark (or question) arises from a misunderstanding of the KPIs and flags.

Claude did a great job providing an answer that is ready to share with the warehouse operations team.

In Scenario 1, both teams were partially right. In Scenario 2, one team was simply wrong.

In both cases, the answer was buried in the data, not visible on any static dashboard.

What can we learn from these two scenarios?

Static dashboards will never settle these debates.

They show what happened, not why, and not who's truly responsible.

Can AI Solve Failures in your Supply Chain?
Example of Static Visuals deployed in distribution planning report - (Image by Samir Saci)

Distribution planners know this. That's why they spend dozens of hours per week manually crunching data to answer questions their dashboards can't.

Instead of attempting to build a comprehensive dashboard that covers all scenarios, we can focus on a minimal set of boolean flags and calculated lead times to support custom analysis.

These analyses can then be outsourced to an agent, such as Claude Opus 4.6, which will use its knowledge of the data and reasoning skills to provide data-driven insights.

Can AI Solve Failures in your Supply Chain?
Visuals Generated by Claude for the top management - (Image by Samir Saci)

We can even use it to generate interactive visuals to convey a specific message.

In the visual above, the idea is to show that relying solely on Boolean flags may not fully reflect reality.

Flag-Based attribution was probably the source of a lot conflicts.

All of these visuals were generated by a non-technical user who communicated with the agent using natural language.

This is AI-powered analysis-as-a-service for supply chain performance management.

For more details and comments, you can find the video version of this article

Conclusion

Reflecting on this experiment, I anticipate that agentic workflows like this will replace an increasing number of reporting projects.

The advantage here is for the operational teams.

They do not have to rely on business intelligence teams to build dashboards and reports to answer their questions.

Can I export this PowerBI dashboard in Excel?

These are the common questions you may encounter when building reporting solutions for supply chain operational teams.

It is because static dashboards will never answer all the questions planners have.

Can AI Solve Failures in your Supply Chain?
Example of visuals built by Claude to answer one of the questions of our planners - (Image by Samir Saci)

With an agentic workflow like this, you empower them to build their own reporting tools.

The distribution planning use case focused on diagnosing past failures. But what about future decisions?

We applied the same agentic approach, using Claude connected via MCP to a FastAPI optimisation engine, to a very different problem: Sustainable Supply Chain Network Design.

Can AI Solve Failures in your Supply Chain?
Connect Claude to a module of Sustainable Supply Chain Network Design - (Image by Samir Saci)

The idea here was to support supply chain directors in their redesign of network in the context of sustainability roadmap.

Where should we produce to minimize the environmental impact of our supply chain?

Our AI agent is used to run multiple network design scenarios to estimate the impact of key decisions (e.g., factory openings or closures, international outsourcing) on production costs and environmental impacts.

Can AI Solve Failures in your Supply Chain?
Network Design Scenarios - (Image by Samir Saci)

The objective is to provide decision-makers with data-driven insights.

This was the first time I felt that I could be replaced by an AI.

Can AI Solve Failures in your Supply Chain?
Example of trad-off analysis generated by Claude - (Image by Samir Saci)

The quality of this analysis is comparable to that produced by a senior consultant after weeks of work.

Claude produced it in seconds.

More details in this tutorial,

Do you want to learn more about distribution planning?

Why Lead Time is Important?

Supply Planners use Inventory Management Rules to determine when to create replenishment orders.

Can AI Solve Failures in your Supply Chain?
Demand Variability that retail stores face

These rules account for demand variability and delivery lead time to determine the optimal reorder point that covers demand until goods are received.

Can AI Solve Failures in your Supply Chain?
Formula of the safety

This reorder point depends on the average demand over the lead time.

But we can adapt it based on the actual performance of the distribution chain.

For more details, see the complete tutorial.

About Me

Let’s connect on LinkedIn and Twitter; I am a Supply Chain Engineer using data analytics to improve logistics operations and reduce costs.

For consulting or advice on analytics and sustainable supply chain transformation, feel free to contact me via Logigreen Consulting.

]]>
<![CDATA[Learn AI & Analytics for Operational Efficiency & Productivity]]>https://www.samirsaci.com/improve-end-to-end-supply-chain-performance-with-data-analytics/62c98a6579ed37004df69906Tue, 17 Feb 2026 08:43:00 GMT

Welcome to my blog. I am Samir Saci.

If you want to use data and AI to optimise supply chain operations, automate manual tasks and improve business profitability, you are in the right place.

What can you find here?

You can access 100+ case studies, including

  • A statement of the problem to solve based on an actual project
  • An introduction to mathematical concepts used to solve the problem or the analytics solutions
  • The implementation using programming languages like Python, VBA, JavaScript or no-code tools like n8n

The focus here is on solving operational or business problems through data-driven diagnostics and prescriptions.

How can I help your Supply Chain?

Depending on your role or the projects you're currently working on, you will find inspiration in real-world operational case studies I've conducted.

Do you need to automate manual tasks?

AI & Workflow Automation

Way before the hype of generative AI models, we were sharing in this blog solutions to automate boring tasks using "conventional" coding.

Automate Graphic Design, Video Editing, PowerPoint Slides or Email Reporting ...
Learn AI & Analytics for Operational Efficiency & Productivity
Example of "old style" automations using Python

Even with the support of ChatGPT, Gemini, Claude, and Deepseek, it is still valuable to build these small automations using open-source libraries.

Learn AI & Analytics for Operational Efficiency & Productivity
Example of AI Workflows designed with n8n, LangChain or MCP Servers

And of course, I have experimented with these AI models via:

  • No-code platforms like n8n (30+ templates and tutorials available)
  • Frameworks like LangChain, LangGraph and MCP using Python

You can find the detailed case studies with source code in this section

AI Workflow Automation & Reporting - Samir Saci
Use generative and advanced analytics (Python, VBA, JavaScript) to automate tasks, optimise workflows and provide data-driven insights.
Learn AI & Analytics for Operational Efficiency & Productivity
Are you looking for evolution in your career?

Career Tips

In this section, I bring tips after working in 6+ companies across APAC and Europe, and now running my startup LogiGreen.

Learn AI & Analytics for Operational Efficiency & Productivity
Examples of carreer-focused articles available in the carrer tips section

This is not a perfect recipe for finding a job, but it is my vision for how to advertise your skills and convince decision-makers that you can impact their operations.

Supply Science on YouTube

To complete the content I share in this blog, I have started a YouTube channel.

Find content in multiple formats, including Shorts, long, end-to-end coding tutorials, real-world case studies, and solution demos.

As a beginner, you can learn the basics of Supply Chain and Logistics processes with these 5-min explainers videos.

These explainers can be found on the playlist linked below.

Learn AI & Analytics for Operational Efficiency & Productivity
40+ explainer videos covering the basics of supply chain processes and continuous improvement

You can then explore more advanced case studies using analytics to address operational issues or improve manufacturing and distribution efficiency.

Learn AI & Analytics for Operational Efficiency & Productivity
25+ tutorials covering Supply Chain Optimisation, Descriptive Analytics and Automation
What is a BOM? It's a Bill of Materials

You heard some Supply Chain Terms, and you don't know their definitions?

There is a complete playlist of short videos covering the most common terms and concepts in Supply Chain Management.

Learn AI & Analytics for Operational Efficiency & Productivity
60+ shorts to learn supply chain definitions in less than 60 seconds

Do not hesitate to use the comment sections to ask questions.

💡
If you have any question, feel free to ask it here: Ask a Question

Let's connect!

If you have additional questions, need consulting services or want to cooperate, you can contact me via LinkedIn or Twitter in English, Français or 中文.

For consulting or advice on analytics and sustainable supply chain transformation, feel free to contact me via Logigreen Consulting.


]]>
<![CDATA[The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies]]>https://www.samirsaci.com/the-hidden-opportunity-in-ai-workflow-automation-with-n8n-for-low-tech-companies/6969f1f6a198470001df6923Sat, 17 Jan 2026 12:00:46 GMT

Every day on professional social media, someone claims their “AI agent” will run your entire business while you sleep.

It is as if they can deploy AGI across factories, finance teams, and customer service using their "secret" n8n template.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
n8n is a low-code automation platform that lets you connect APIs and AI models using visual workflows - (Image by Samir Saci)

My reality check is that many companies are still struggling to collect and harmonise data to follow basic performance metrics.

Logistics Director: “I don’t even know how many orders have been delivered late, what do you think your AI agent can do?”

And these advertised AI workflows, which are often not ready for production, can unfortunately do nothing to help with that.

Therefore, I adopt a more pragmatic approach for our supply chain projects.

Instead of promising an AGI that will run your entire logistics operations, let us start with local issues hurting a specific process.

Logistics Director: "I want our operators to get rid of papers and pens for order preparation and inventory cycle count."

Most of the time, it involves data extraction, repetitive data entry, and heavy admin work using manual processes that are inefficient and lack traceability.

For example, a customer was using paper-based processes to organise inventory cycle counts in its warehouse.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Example of a Warehouse with hundreds of picking locations to manage - (Image by Samir Saci)

Imagine an inventory controller who prints an Excel file listing the locations to check.

Then he walks through the alleys and manually records the number of boxes at each location on a form like the one below.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Actual Example of the Inventory Cycle Count List used by the operators - (Image by Samir Saci)

At each location, the operator must pause to record the actual quantity and confirm that the area has been checked.

We can (and must) digitalize this process easily!

This is what we did with a Telegram Bot using n8n, connected to a GPT-powered agent, enabling voice commands.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Example of "digitalisation" of inventory cycle count using a Telegram bot - (Image by Samir Saci)

Our operator now only needs to follow the bot's instructions and use audio messages to report the number of boxes counted at each location.

This local digitalisation becomes the first concrete step in the digital transformation of this low-data-maturity company.

We even added logging to improve the traceability of the process and report productivities.

In this article, I will use two real-world operational examples to show how n8n can support SMEs' supply chain digital transformations.

The idea is to use this automation platform to implement simple AI workflows that have a real impact on operations.

For each example, I will provide a link to a complete tutorial (with a GitHub repository containing a template) that explains in detail how to deploy the solution on your instance.

Vocalisation of Processes

In logistics and supply chain operations, it is always about productivity and efficiency.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Example of two packing stations in a fashion retail warehouse - (Image by Samir Saci)

Supply Chain Solution Designers analyse processes to estimate the optimal productivity by analysing each step of a task.

A breakthrough was the implementation of voice-picking, also called vocalisation.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Example of an operator receiving instructions via vocalisation - (Image generated with Gemini by Samir Saci)

The idea is to have the operators communicate with the system by voice to receive instructions and provide feedback with interactions like this one:

  1. Voice Picking: "Please go to location A, pick five boxes."
  2. Operator: "Location A, five boxes picked."
  3. Voice Picking: "Please go to location D, pick six boxes."
  4. Operator: "Location D, six boxes picked."

This boosts operators' productivity, as they now need only focus on picking the correct quantities at the proper locations.

But these solutions, typically provided by Warehouse Management System vendors, may be too expensive for small operations.

This is where we can use n8n to build a lightweight solution powered by multimodal generative AI.

Vocalisation of Inventory Cycle Count

I want to come back to the initial example to show you how I used Text-To-Speech (TTS) to digitalise a paper-based process.

We support the stock management team at a medium-sized fashion retail warehouse.

Regularly, they conduct what we call inventory cycle counts:

  1. They randomly select storage locations in the warehouse
  2. They extract from the system the inventory level in boxes
  3. They check at the location the actual quantity

For that, they use a spreadsheet like this one.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Inventory Cycle Count Spreadsheet - (Image by Samir Saci)

Their current process is highly inefficient because the stock counter must manually enter the actual quantity.

We can replace printed sheets with smartphones using Telegram bots orchestrated by n8n.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Step 1: Initialisation of the process - (Image by Samir Saci)

The operator starts by connecting to the bot and initiating the process with the /start command.

Our bot will take the first unchecked location and instruct the operator to go there.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Step 2: The operator uses the vocal command to inform the number of units - (Image by Samir Saci)

The operator arrives at the location, counts the number of boxes, and issues a vocal command to report the quantity.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Step 3: Results Recorded - (Image by Samir Saci)

The quantity is recorded, and the location is marked as checked.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Step 4: Next Location - (Image by Samir Saci)

The bot will then automatically ask the operator to move to the next unchecked location.

If the operator's vocal feedback contains an error, the bot asks for a correction.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Our bot asks for a correction - (Image by Samir Saci)

The process continues until the final location is reached.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Final Location - (Image by Samir Saci)

The cycle count is completed without using any paper!

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Cycle Count Completed - (Image by Author)

This lightweight solution has been implemented for 10 operators with cycle counts orchestrated using a simple spreadsheet.

How did we achieve that?
The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
A light version of the workflow is available on my GitHub - (Image by Samir Saci)

Let us have a look at the workflow in detail.

Vocalise Logistics Processes with n8n

A majority of the nodes are used for the orchestration of the different steps of the cycle count.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
All the nodes in red are only for the orchestration - (Image by Samir Saci)

First, we have the nodes to generate the instructions:

  • (1) is triggering the workflow when an operator sends a message or an audio
  • (6) guides the operator if he asks for help or uses the wrong command
  • (7) and (8) are looking at the spreadsheet to find the next location to check

For that, we don't need to store state variables as the logic is handled by the spreadsheet with "X" and "V" in the checked column.

The key part in this workflow is in the green sticker

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Section using Generative AI - (Image by Samir Saci)

The vocalisation is handled here as we collect the audio file in the Collect Audio node.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
The audio file is sent to OpenAI Audio Transcription API using this node - (Image by Samir Saci)

This file is sent to OpenAI's Audio Transcription Node in n8n, which provides a written transcription of our operator's vocal command.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
The transcription here is "Location A14, 10 Boxes" - (Image by Samir Saci)

As we cannot guarantee that all operators will follow the message format, we use this OpenAI Agent Node to extract the location and quantity from the transcription.

[SYSTEM PROMPT]
Extract the storage location code and the counted quantity from 
this short warehouse transcript (EN/FR).

Return ONLY this JSON:
{"location_id": "...", "quantity": "0"}

- location_id: string or null (location code, e.g. "A-01-03", "B2")
- quantity: string or null (convert words to numbers, e.g. "twenty seven" → 27)

If a value is missing or unclear, set it to null. 
No extra text, no explanations.
[
  {
    "output": {
      "location_id": "A14",
      "quantity": "10"
    }
  }
]

Thanks to the Structured Output Parser, we get a valid JSON with the required information.

This output is then used by the blocks (4) and 5)

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
n8n workflow section for output processing - (Image by Samir Saci)
  • (4) will ask the operator to repeat if there is an error in the transcription
  • (5) is updating the spreadsheet with the quantity informed by the operator if locations and quantities are valid

We have now covered all potential scenarios with a robust AI-powered solution.

Vocalisation of processes using TTS

With this simple workflow, we improved stock counters' productivity, reduced errors, and added logging capabilities.

We are not selling AGI with this solution.

We solve a simple problem with an approach that leverages the Text-To-Speech capabilities of generative AI models.

For more details about this solution (and how you can implement it), you can have a look at this tutorial (+ workflow)

https://youtu.be/_EOJ3M7APsQ

What about image processing?

In the following example, we will explore how to use LLMs' image-processing capabilities to support receiving processes.

Automate Warehouse Damage Reporting

In a warehouse, receiving damaged goods can quickly become a nightmare.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Example of a receiving area with a workstation for quality check - (Image by Samir Saci)

Because receiving can become a bottleneck for your distribution team, inbound operations teams are under significant pressure.

They need to receive as many boxes as possible so the inventory is updated in the system and stores can place orders.

When they receive damaged goods, the whole machine has to stop to follow a specific process:

  1. Damages have to be reported with detailed information
  2. Operators need to attach pictures of the damaged goods

For operators that have high productivity targets (boxes received per hour), this administrative charge can quickly become unmanageable.

Hopefully, we can use the computer vision capabilities of generative AI models to facilitate the process.

Inbound Damage Report Process

Let us imagine you are an operator on the inbound team at the same fashion retail company.

You received this damaged pallet.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Picture of a damaged pallet generated with Gemini by Samir Saci

You are supposed to prepare a report that you send by email, with:

  • Damage Summary: a one-sentence summary of the issues to report
  • Observed Damage: details of the damage with location and description
  • Severity (Superficial, Moderate, Severe)
  • Recommended actions: return the goods or quick fixes
  • Pallet Information: SKU or Bar Code number

Fortunately, your team gave you access to a newly deployed Telegram Bot.

You initiate the conversation with a /start command.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Initiate the process with the bot - (Image by Samir Saci)

You follow the instructions and start by uploading the picture of the damaged pallet.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Step 2: uploading the barcode - (Image by Samir Saci)

The bot then asks you to upload the barcode.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Step 3: uploading the bar code - (Image by Samir Saci)

A few seconds later, you receive this notification.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies

You can now transfer the pallet to the staging area.

What happened?

The automated workflow generated this email that was sent to you and the quality team.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Damage Report Generated by the automated workflow - (Image by Samir Saci)

The report includes:

  • Pallet ID
  • Damage Summary, Observed damages and severity assessment
  • Recommended actions

This was automatically generated just after you uploaded the photo and the barcode.

How does it work?

Behind this Telegram bot, we also have an n8n workflow.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
n8n workflow to automate damage reporting - (Image by Samir Saci)

Damage Analysis with Computer Vision using n8n

Like in the previous workflow, most nodes (in red sticky notes) are used for orchestration and information collection.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
AI sections are in green - (Image by Samir Saci)

The workflow is also triggered by messages received from the operator:

  • (1) and (2) ensure that we send the instruction message to the operator if the message does not contain an image
  • (3) is using state variables to know if we expect to have a picture of damaged goods or a barcode

The output is sent to AI-powered blocks.

If we expect a barcode, the file is sent to section (4); otherwise, it is sent to section (5).

For both, we are using OpenAI's Analyze Image nodes of n8n.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Nodes to extract the bar code - (Image by Samir Saci)

The downloaded image is sent to the image analysis node with a straightforward prompt.

Read the barcode, just output the value, nothing else.

Here, I chose to use a generative AI model because we cannot guarantee that operators will always provide clear bar code images.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
(5) Analyse Damage Goods and Generate the report - (Image by Samir Saci)

For (5), the system prompt is slightly more advanced to ensure the report is complete.

You are an AI assistant specialized in warehouse operations 
and damaged-goods reporting.
Analyze the image provided and output a clean, structured damage report.
Stay factual and describe only what you can see.

Your output MUST follow this exact structure:

Damage Summary:
- [1–2 sentence high-level description]

Observed Damage:
- Packaging condition: [...]
- Pallet condition: [...]
- Product condition: [...]
- Stability: [...]

Severity: [Minor / Moderate / Severe]

Recommended Actions:
- [...]
- [...]

Guidelines:
- Do NOT hallucinate information not visible in the image.
- If something is unclear, write: "Not visible".
- Severity must be one of: Minor, Moderate, Severe.

This system prompt was written in consultation with the quality team, who shared their expectations for the report.

This report is stored in a state variable that will be used by (6) and (7) to generate the email.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
State variables are collected to generate a report using the JS node Generate Report - (Image by Samir Saci)

The report includes JavaScript code and an HTML template that are populated with the report data and the barcode.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Final report - (Image by Samir Saci)

The final result is a concise report ready to be sent to our quality team.

If you want to test this workflow on your instance, you can follow the detailed tutorial (+ template shared) in this video.

All these solutions can be directly implemented in your n8n instance.

But what if you have never used n8n?

Start Learning Automation with n8n

For the beginners, I have prepared a complete end-to-end tutorial in which I show you how to:

  • Set your n8n instance
  • Set up the credentials to connect to Google Sheets, Gmail and Telegram
  • Perform basic data processing and create your first AI Agent Node

At the end of this tutorial, you will be able to run any of these workflows presented above.

A great way to practice is to adapt them to your own operations.

How to improve this workflow?

I challenge you to improve this initial version using the Text-To-Speech capabilities of generative AI models.

We can, for instance, ask the operator to provide additional context via audio and have an AI Agent node incorporate it into the report.

Conclusion

This is not my first project using n8n to automate workflows and create AI-powered automations.

However, these workflows were always linked to complex analytics products performing optimisation like budget allocation, production planning or forecasting.

The Hidden Opportunity in AI Workflow Automation with n8n for Low-Tech Companies
Other examples of workflow automation using n8n - (Image by Samir Saci)

These advanced prescriptive analytics capabilities addressed the challenges faced by large companies.

To support less mature SMEs, I had to take a more pragmatic approach and focus on solving "local issues".

This is what I tried to demonstrate here.

I hope this was convincing enough. Do not hesitate to try the workflows yourself using my tutorials.

In the next article, we will explore using an MCP server to enhance these workflows.

About Me

Let’s connect on LinkedIn and Twitter; I am a Supply Chain Engineer using data analytics to improve logistics operations and reduce costs.

For consulting or advice on analytics and sustainable supply chain transformation, feel free to contact me via Logigreen Consulting.

]]>
<![CDATA[How AI Can Become Your Personal Language Tutor]]>https://www.samirsaci.com/how-ai-can-become-your-personal-language-tutor/69615e6a96450500016cf84cSat, 10 Jan 2026 07:20:22 GMT

No one learns a language by passively turning pages in a textbook.

You really progress when the language talks back to you.

How AI Can Become Your Personal Language Tutor
Example of grammar exercises I did to prepare for HSK5 in China - (Image by Samir Saci)

When you see images, hear real sentences, try to speak, and get feedback, everything finally clicks in your head.

In the past, you needed a teacher by your side at all times to get that kind of feedback.

Today, generative AI can play that role on your phone or computer, like an AI language tutor you can use any time.

How AI Can Become Your Personal Language Tutor
Example of pronunciation exercise I do with my AI Chinese Tutor on Telegram - (Image by Samir Saci)

When I started learning Mandarin ten years ago, I saw many foreigners struggling to be understood by locals in everyday conversations because of poor pronunciation.

It convinced me that without good pronunciation, a rich vocabulary is useless.

How AI Can Become Your Personal Language Tutor
The second word means cheap goods, but has other meanings too - (Image by Samir Saci)

I still remember sitting in my apartment in Shanghai, repeating the same sentence again and again, without anyone to correct me.

Years later, when I discovered generative AI, I remembered the engineer in China who was struggling with grammar books and tones.

How AI Can Become Your Personal Language Tutor
Recent Publications on how I use Generative AI Solutions for Supply Chain and Tech - (Image by Samir Saci)

I wanted to build tools that would have helped me in the past.

As a startup founder, I do not have much free time, so I needed a way to build and test new tools quickly.

That is why I turned to n8n to build assistants that would have made my Chinese practice much easier.

How AI Can Become Your Personal Language Tutor
n8n workflow of my AI Chinese Pronunciation Coach – (Image by Samir Saci)

In this article, I will show how I use n8n and multimodal AI to build a “study partners” for language learning that:

  • Correct my pronunciation using Text-to-speech capabilities
  • Create exercises to study vocabulary lists
  • Generate images to illustrate words or contexts for flash-card style practice

Together, they show how AI and low-code platforms like n8n can support anyone learning a complex language.

Even with daily usage, all of these together cost less than 1 euro per month.

AI For Pronunciation And Oral Comprehension

My name is Samir, a supply chain professional who struggled with Mandarin during his six-year stay in China.

Let me introduce you to Yin, the AI-powered Language coach I developed last week.

How AI Can Become Your Personal Language Tutor
UI of the application I designed to improve my Chinese proficiency - (Image by Samir Saci)

This is a web application I designed to support my Chinese learning journey after more than five years without practising.

It includes three features:

  • Pronunciation Exercises
  • Multiple Choice Questions (MCQ)
  • Flash Cards

I will use each feature to demonstrate how I use multimodal AI to improve my reading comprehension, listening, and pronunciation in Mandarin.

Why is pronunciation in Mandarin so Important?

Let me share a real story from China to highlight the importance of using the correct tone in Mandarin.

One day, I was invited to a job interview at the largest Chinese express company, valued at billions.

The entire conversation was in Chinese.

I had carefully prepared my sentences, highlighting how I used data science to improve warehouse operations.

How AI Can Become Your Personal Language Tutor
An example of a sentence I prepared for the interview - (Image by Samir Saci)

At one point, I wanted to say: “I use data science to improve picking productivity in the warehouse.”

The verb "picking” means taking goods from shelves or racks in a warehouse.

How AI Can Become Your Personal Language Tutor
Imagine an operator taking this pallet jack and going in the alleys to take boxes from the racks - (Image by Samir Saci)

In Chinese, my colleagues used the verb 拣货 (jiǎn huò) to describe this process.

But instead of saying jiǎn huò, I said jiàn huò.

How AI Can Become Your Personal Language Tutor
Two uses of jian huo with different tones - (Image by Samir Saci)

Which is a totally different word that you definitely don’t want to use in a job interview.

To keep it polite here, let’s say jiàn huò is a rude word.

The manager burst out laughing.

I didn’t understand why until I debriefed with the headhunter later and repeated the sentence for her.

That moment taught me that pronunciation in Chinese isn’t just about sounding natural.

You can know thousands of words, but if your tone is wrong, people won’t understand you.

This is why the first feature of my app is an AI pronunciation coach.

Using Speech-to-Text Recognition to Practise

Using speech-to-text and reasoning, the app listens to what I say, compares it with the target sentence, and gives feedback on which tones or syllables were off.

How AI Can Become Your Personal Language Tutor
User interface of the App - (Image by Samir Saci)

The focus here is on improving my pronunciation of logistics and supply chain terms (my field of expertise).

For each word, we have:

  • The word in Simplified Mandarin Characters: 合同
  • The sentence used to practise my pronunciation: 我们需要在发货前签署这份运输合同。
  • The English translation: We need to sign this transport contract before shipping the goods.

For beginners, we can even add phonetics (Mandarin pinyin) using the toggle.

How to practice pronunciation?

I just have to press the mic button at the bottom to record my sentence.

How AI Can Become Your Personal Language Tutor
Analysis in progress for two examples - (Image by Samir Saci)

The recording is automatically sent to the backend for analysis that compares my pronunciation with the correct one.

A few seconds later, I received my feedback.

The feedback is quite detailed; it focuses on the words that you mispronounced.

How AI Can Become Your Personal Language Tutor
Pronunciation Analysis - (Image by Samir Saci)

It’s nearly like having a personal teacher correcting me in real time, except this one never gets tired.

Of course, this won't replace a great teacher in a one-on-one lesson, but it can help you to practise after classes.

When I started learning Mandarin, I used to spend evenings (after work) alone, repeating simple sentences to familiarise myself with the nuances of tones.

I did not have a feedback loop at the time; this tool would have been very helpful.

How does it work?

Text-to-speech and reasoning capabilities of GenAI

The backend is a simple n8n workflow connected to the frontend via a webhook.

How AI Can Become Your Personal Language Tutor
Backend of the app - (Image by Samir Saci)

The text-to-speech capabilities are used to transcribe the audio file sent by the front end into phonetics (pinyin).

How AI Can Become Your Personal Language Tutor
Transcription of my audio - (Image by Samir Saci)

The output of this Gemini audio transcription node includes the phonetics:

[
  {
    "content": {
      "parts": [
        {
          "text": "zuò pǐn huò zǒnggòng fàng zài èrshí ge tuōpán shàng.\n"
        }
      ],
      "role": "model"
    },
    "finishReason": "STOP",
    "avgLogprobs": -0.16858814502584524
  }
]

This pinyin is then sent to the AI node Pronounciation Analysis along with the target pronunciation.

How AI Can Become Your Personal Language Tutor
Input of the AI Pronunciation Analysis Agent - (Image by Samir Saci)

In this example, I mispronounced the penultimate word.

How AI Can Become Your Personal Language Tutor
Complete flow from question to analysis - (Image by Samir Saci)

This is precisely what the agent mentioned in his feedback.

This shows how we can use text-to-speech capabilities, combined with the reasoning of generative AI models, to improve our pronunciation.

This can be adapted to any language.

What about image generation and speetch-to-text?

Generative AI for Content Generation

If you observe the user interface of the application, you notice that each word has:

  • An illustrative Image
  • A sentence for the context
  • Audio transcription available via the microphone icons
How AI Can Become Your Personal Language Tutor
AI-generated content to help me learn the vocabulary - (Image by Samir Saci)

This content is generated using AI models to provide a variety of teaching materials for the second feature: flashcards.

Text-to-Speech Solutions

A great way to practise pronunciation is to listen and repeat.

Therefore, before recording my sentence, I can learn how to pronounce the word using this first speech-to-text feature.

How AI Can Become Your Personal Language Tutor
Text-to-speech button - (Image by Samir Saci)

For this, I use Google's Text-to-Speech API as it is pretty convenient and free.

from gtts import gTTS

def generate_speech(text: str, lang: str):
   filename = f"{uuid4().hex}.mp3"
   filepath = f"./data/gtts/{filename}"

   tts = gTTS(text=text, lang=lang)
   tts.save(filepath)

With a couple of lines of code, you can generate the text-to-speech of any word using the proper language code.

This is exactly what I used in the tool to generate flashcards that I presented on this blog three years ago.

How AI Can Become Your Personal Language Tutor
Example of Flash Cards using Text-to-speech - (Image by Samir Saci)

The idea at the time was to improve my listening comprehension by adding audio to the flashcard answers.

What about long sentences?

The problem with Google Text-to-Speech is the robotic voice.

Fortunately, we have eleven labs.

How AI Can Become Your Personal Language Tutor
Option for long sentence audio version / Workflow generating the sentence and the audio - (Image by Samir Saci)

The workflow above is connected to the app via webhook.

The Eleven labs node that takes the output of the AI Agent Generate Example to generate the audio version of the sentence.

The user can now listen to the sentence pronounced "like" a native speaker.

What is remaining? Questions and illustrations ...

Teaching material generation

As explained in the previous section, the sentences are also generated using AI.

The AI Agent node, powered by Gemini, takes the word to study as input and uses the system prompt below to generate a sentence.

You are a Chinese language tutor for professionals.

Given a Chinese word, you MUST return a JSON object with EXACTLY these keys:
- "sentence": a short Chinese sentence using the word in a business or 
   daily-life context
- "pinyin": the pinyin of the full sentence
- "english": the English translation of the sentence

Return ONLY valid JSON. No explanations, no backticks, no extra text.

Example:
{
  "sentence": "我去仓库检查货物。",
  "pinyin": "Wǒ qù cāngkù jiǎnchá huòwù.",
  "english": "I go to the warehouse to inspect the goods."
}

That ensures a nearly infinite variety of exercises.

And the cherry on the cake is the image generated with Gemini's Nano Banana to help us connect a word to its context.

How AI Can Become Your Personal Language Tutor
Images used to illustrate the word - (Image by Samir Saci)

After learning thousands of Chinese characters, I noticed that images help with memorising new words.

This is precisely what I use in the flashcards feature.

How AI Can Become Your Personal Language Tutor
Example of a flash card to learn the word 合同 that means contract in Chinese - (Image by Samir Saci)

The n8n backend provides to the front-end:

  • The word in Chinese that you want to learn with pinyin and English translation
  • An example sentence and its translation generated by GPT
  • An illustrative image generated by Gemini

The front end then manages the card-flipping mechanism.

If you want to recreate this solution tailored for your needs, I have shared a similar workflow on my GitHub.

Do you like multiple-choices questions? Gen AI can help!

Generate Exercises from a vocabulary list

For the last feature, we generate multiple-choice questions to learn the same vocabulary list.

How AI Can Become Your Personal Language Tutor
Multiple-choice questions feature - (Image by Samir Saci)

We ask Gemini to generate questions from the vocabulary list, using multiple-choice options with only one correct answer.

[
  {
    "output": {
      "question": "Which of the following is the correct Chinese translation for 'Variable Pricing'? Please answer with A, B, C, or D.",
      "options": {
        "A": "仓库",
        "B": "可变定价",
        "C": "卡车司机",
        "D": "投标"
      },
      "correct": "B",
      "right_feedback": "Great job! 可变定价 (kě biàn dìng jià) means Variable Pricing.",
      "wrong_feedback": "Oops! The correct answer is B: 可变定价 (kě biàn dìng jià), which means Variable Pricing."
    }
  }
]

The front-end uses this output to provide the questions with adapted feedback.

How AI Can Become Your Personal Language Tutor
Example with positive and negative feedback - (Image by Samir Saci)

The backend of this feature is based on an n8n workflow that I also shared on my GitHub: AI-Powered Language Teacher using GPT.

Conclusion

I developed this app to experiment with how AI could enhance my learning capabilities.

After nearly five years without speaking Chinese, this multimodal AI assistant has proven to be a great help.

As I do not have time to commit to in-person Chinese classes, I can have an assistant who will adapt to my schedule.

Can we do better?

On the "roadmap" of this small side project, I have:

  • Adding complex grammar exercises that could be done orally (combining reading comprehension, grammar and pronunciation)
  • Implementing a writing module that would correct my calligraphy using image processing

Depending on my availability, I will aim to ship it by Q1 2026.

About Me

Let’s connect on LinkedIn and Twitter; I am a Supply Chain Engineer using data analytics to improve logistics operations and reduce costs.

For consulting or advice on analytics and sustainable supply chain, feel free to contact me.

]]>
<![CDATA[Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)]]>https://www.samirsaci.com/why-supply-chain-is-the-best-domain-for-data-scientists-in-2026/6957716d0c9ff70001ae4c3eMon, 05 Jan 2026 11:15:30 GMT

As we step into 2026, my LinkedIn inbox is full of data scientists reaching out.

Same questions. Same concerns. Is supply chain data science the right move?

After 10 years in supply chain data science, including five years writing on this blog, I have developed strong views on this question.

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
My first articles published in this blog more than 5 years ago - (Image by Samir Saci)

Supply chain is an exceptional playground for data scientists.

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
Four types of Supply Chain Analytics - (Image by Samir Saci)

Rich problems, beautiful mathematics and tangible impacts.

But I'm not here to tell you what's best for your career.

In this article, I want to give an honest view of the opportunities that excite me and the challenges that frustrate me.

More importantly, I will show how to explore this domain yourself using the tutorials and case studies shared across this blog.

You can then test yourself to see whether supply chain analytics resonates with you.

Why do we need Supply Chain Analytics?

What is a Supply Chain?

A Supply Chain is usually defined as several parties exchanging flows of material, information or monetary resources with the ultimate goal of fulfilling a customer request.

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
Representation of a value chain with factories, warehouses and stores - (Image by Samir Saci)

Factories, warehouses and planning teams use systems to communicate and exchange information.

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
Systems exchanging data across the value chain - (Image by Samir Saci)

These systems store a large amount of transactional data in databases that reflects the activity of your entire supply chain.

  • Warehouse Management Systems (WMS) store all the inbound (flows coming to the warehouse) and outbound (flows leaving the warehouse) transactions.
  • Enterprise Resource Planning (ERP) systems can store all the purchase orders (to suppliers) and invoices (to customers)
  • Transportation Management Systems (TMS) will record all the shipments leaving the warehouse and notify you when they are delivered.

As it is impossible to track each shipment across the supply chain, these data remain the only way to monitor your operations.

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
Example of transactional data - (Image by Samir Saci)

Therefore, Supply Chain Analytics has emerged as a methodology that organisations use to gain insights from data associated with all processes within the value chain.

We need to exploit this data, but for what?

Descriptive Analytics: Bring Visibility to Operational Teams

Yes, this isn't machine learning or advanced optimisation yet.

But it's where most supply chain analytics journeys begin, and where you can deliver immediate value!

I discovered in my first years as a Supply Chain Solution Designer that operational teams were drowning in data but unable to see patterns.

They know something went wrong, but they can't explain why.

Operations manager: we don't manage to increase our capacity of orders prepared per day and we don't why!

In a warehouse storing products for a cosmetics retailer, I was asked to support the reengineering of operations to increase e-commerce capacity.

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
Illustration of the warehouse with receiving, storage and outbound area - (Image by Samir Saci)

Around November 11th, you have a huge e-commerce festival in China during which volumes are multiplied by ten.

Operations manager: we recruit more operators but it does not impact the capacity.

To find the root cause, I decided to go on-site and observe a shift during peak hours.

And I quickly observed that many operators were packed in some alleys of the warehouse waiting for their turn to pick products.

I assumed that was probably the root cause, but I needed a way to prove that and communicate it to the operations manager.

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
Warehouse Heatmap - (Image by Samir Saci)

With this heatmap, showing the percentage of orders per storage location, we unlocked the situations by quickly understanding the root cause.

They knew that some areas contained high rotation SKUs, but not to this extent.

Operations Manager: we must spread the high rotations across the warehouse to avoid congestion.

This simple visualisation, which I learned from EDAs in Kaggle, was the beginning of a more complex optimisation study that I documented in this series of articles.

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
Series of three articles showing how to use Python to optimise Picking Processes (with source code) - (Image by Samir Saci)

Even if this isn't deep learning or complex optimisation, never underestimate the value of the proper visualisation solving the right operational problem.

The reengineering study that started from this simple visual helped us to renew the contract with this customer and earn several million euros.

What if you want more technical challenge?

Diagnostic Analytics: Data supporting Root Cause Analysis

We can now step up the technical complexity.

Let me introduce a methodology that became my favourite playground for supply chain data science: Lean Six Sigma.

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
Three articles in my blog with case studies using Lean Six Sigma - (Image by Samir Saci)

Lean Six Sigma is a step-by-step approach to process improvement that uses statistical tools to validate assumptions.

Why Lean Six Sigma? Because it forces rigour through statistically backed assumptions.

Operations teams make assumptions daily that are most often based on their experience, but rarely on data, as they're too deep in the day-to-day management.

We can support them with statistics using the Lean Six Sigma approach.

I first used this approach for a project supporting the transportation team of a factory in North America.

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
Illustration of the case study - (Image by Samir Saci)

The  Inbound Transportation Manager received products from two different routes.

  • Route 1: with difficult road conditions and heavy traffic
  • Route 2: with no traffic and a beautiful modern road

An external service provider allocates the shipment to a pool of drivers (D1, D2, D3).

What's the problem?

When an order is allocated to the northern regional hub, the lead time for the request to be accepted is 35% higher than at the southern hub.

Transportation Manager: We assume that drivers avoid as much as possible to be allocated to the north route.

Before jumping to conclusions (and starting a conflict with drivers), we decided to analyse the past shipment confirmations.

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
Analysis of the past shipments - (Image by Samir Saci)

We used cross-validation and the Chi-Squared test to show that there is no significant proof that the driver’s allocation is linked to the Hub.

This helped the team to investigate other potential root causes to solve the problem.

For more details about the approach (and examples with source code), you can have a look at these videos:

With these descriptive and diagnostic tools at hand, you can find the root cause of most operational issues in warehouses, factories, and planning teams.

  • Why do we have a drop in productivity with this shift of operators?
  • Why are there +20% picking errors in this area?
  • Why do we have an additional day of lead time in this specific freight road?

Answering these questions with statistically backed methodologies can help teams implement action plans.

Can we support these action plans with data-backed prescriptions?

If we summarise what we've seen so far, in the continuous improvement journey, you can

  • Help to identify the problem with a carefully chosen visualisation
  • Use statistical methods to find the root cause

It is time now to provide solution-oriented insights to support operational improvements.

Prescriptive Analytics: Optimisation for Decision Making

The idea here is to solve an optimisation problem.

We want to maximise or minimise a specific objective function (e.g., procurement cost, number of operators hired, space used, production costs) while respecting particular constraints.

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
Examples in my Towards Data Science blog - (Image by Samir Saci)

In this blog, you can find dozens of examples using linear and non-linear programming to optimise a specific process.

I will use the Supply Chain Network Design problem to illustrate the challenges you may face when conducting this kind of study.

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
Supply Chain Network Design Problem - (Image by Samir Saci)

A multinational company with markets and factories in different countries would like to redesign its supply chain network to reduce costs and environmental footprint.

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
Data you have on hand - (Image by Samir Saci)

Their supply chain director expects you to tell them where to open factories to minimise the overall production cost.

These are the decision variables in your optimisation model that you can build using the Python library PuLP.

I faced many issues collecting input data and fixing the objective functions.

What are the challenges?

Indeed, most of the time, the problem is never stated fully and comprehensively.

For instance, in a project for a fashion retailer, it took us weeks to finalise the objective function.

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
Initial Scenario - Cost of Goods Sold by Market - (Image by Samir Saci)

Indeed, after presenting the initial results, we noticed that the objective of reducing the overall production cost (across all countries combined) can affect markets through the Cost of Goods Sold (COGS).

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
Scenario where COGS are the highest in the low purchase power markets - (Image by Samir Saci)

You cannot have scenarios in which it's more expensive to produce in India than in the USA.

This is where I had the opportunity to support the customer in adjusting their business and operational assumptions, drawing on my understanding of the model.

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
My presentation of the consensus effort needed across the teams - (Image by Samir Saci)

These kinds of strategic projects can help you shine with your skills as you directly deal with decision-makers on projects that impact profitability.

Our value-added here is not lines of code, but bridging the gap between business aspects and optimisation levers.

For more details, I explain in this video how I use AI with Claude connected to an MCP server to solve this issue:

To achieve this, you need a basic understanding of the operations coupled with your data science skills.

I have some content for that.

What do you need to start?

The biggest issue I saw when managing analysts and data scientists on analytics projects was their limited understanding of operations.

This creates a trust deficit.

Operations teams may see data scientists as people who've never set foot in a warehouse.

You need operational knowledge to succeed in supply chain analytics.

Not to become an expert. But enough understanding to communicate effectively, frame problems accurately, and design solutions that actually work in practice.

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
Example of basic supply chain terms explained in short on Supply Science - (Image by Samir Saci)

This means learning the basics: how warehouses and factories operate, how transportation networks function, how inventory flows through a supply chain.

Here's where to start.

Learn Supply Chain Processes with 5-min Explainer Videos.

In this playlist of 40+ short explainer videos, I share a condensed version of my 10 years of experience as a solution design manager and as a logistics performance manager.

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
Example of playlist to learn the basics of Supply Chain & Logistics - (Image by Samir Saci)

It starts with the basics of warehousing and transportation operations.

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
Short explainer videos covering basics of logistics operations - (Image by Samir Saci)

These videos will give the basics to understand:

  • Warehouse processes: receiving goods (inbound), storage of goods (inventory) and shipping of goods (outbound)
  • Transportation Management: Full Truck Load vs. Less Than a Truck Load, performance indicators and cost structures

The focus is operational and financial, as this remains a key concern in logistics operations and is my primary expertise as a Supply Chain Solution Manager.

These videos will give you the basic knowledge to understand most of the logistics-related case studies presented in this blog.

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
Purely Warehousing-Related Analytics Case Studies that you can find in here - (Image by Samir Saci)

In each of these articles, you can find the solution's source code linked to a GitHub repository and an explainer video summarising the case study.

What can you do with that?

I usually advise playing with the input data, parameters, and scenarios to adapt the solution to your company's problem.

You can be imaginative or ask LLM to generate new scenarios and play around with them.

Do not forget that the objective is to develop your technical skills as well as your operational understanding.

Productise your solutions for better adoption.

In this blog, we want to build solutions that impact operations.

We need to ensure their adoption with a user-friendly deployment.

Therefore, I dedicated multiple tutorials and articles to the productisation of algorithms and visualisations.

Why Supply Chain is the Best Domain for Data Scientists in 2026 (And How to Learn It)
Example of web application that you can deploy following this tutorial - (Image by Samir Saci)

In my last article, I showed you step by step how to deploy an inventory simulation application using Python's Streamlit library.

This approach can be used for any of the 50+ analytics solutions shared in this blog.

I hope that you are now convinced that you have everything on hand to become a supply chain data scientist whose skills are valued for their impact on operations.

As someone who recently started my own company providing analytics products, I can confirm there is a need for these skills.

And we can have fun working on these kinds of projects!

About Me

Let’s connect on LinkedIn and Twitter. I am a Supply Chain Engineer who uses data analytics to improve logistics operations and reduce costs.

For consulting or advice on analytics and sustainable supply chain transformation, feel free to contact me via Logigreen Consulting.

If you are interested in Data Analytics and Supply Chain, look at my website.

Samir Saci | Data Science & Productivity

]]>
<![CDATA[Build and Deploy Your First Supply Chain App in 20 Minutes]]>https://www.samirsaci.com/build-and-deploy-your-first-supply-chain-app-in-20-minutes/6958ec19f2b2e300010ee550Thu, 04 Dec 2025 10:49:00 GMT

In Supply Chain Management, it is easy to make an impact with your data science and analytics skills.

Even if data quality remains an issue most of the time, you can find opportunities to solve problems by providing insights to operational teams.

Operations Manager: "How many temporary workers should I recruit next to meet our workforce demand at the lowest cost?

When I was a Supply Chain Solution Manager in a logistics company, I learned data science by applying mathematical principles to solve operational problems in our warehouses.

Build and Deploy Your First Supply Chain App in 20 Minutes
Example of analytics solutions presented in previous articles of this blog - (Image by Samir Saci)

It was very archaic.

I was running Python scripts or Jupyter notebooks on my machine and sharing the results with my colleagues.

Until I discovered Streamlit, which let me effortlessly package my models into web applications that I could easily deploy.

Build and Deploy Your First Supply Chain App in 20 Minutes
Inventory Web Application that you will build in this tutorial - (Image by Samir Saci)

This is crucial for any supply chain process engineer or data scientist to learn how to productise analytics tools.

How to transform Python code into actionable insights?

In this article, I will show you how to transform a simulation model built in Jupyter Notebook into a fully functioning web application.

This exercise was part of a tutorial series on my YouTube Channel, in which we use Python to learn Inventory Management in Supply Chain.

You will learn how I took a core module written in Python scripts to build an interactive application with which you can:

  • Simulate multiple inventory management rules
  • Test several scenarios with different delivery lead times (LD in days), demand variability (sigma in pieces) and cycle time (T in days)

If you are not familiar with these concepts, you can still follow this tutorial, as I will briefly introduce them in the first section.

Or you can directly jump into the second section that focuses only on the creation and deployment of the app.

Note: This is an introductory tutorial to help you build and deploy your first app. If you need more challenging exercises, have a look at the case studies shared in the conclusion.

Inventory Management Simulation with Python

What is inventory management?

Most retailers I’ve worked with in Asia and Europe manage store orders with rule-based methods built into their ERPs.

When do you need to replenish your stores to avoid stock-outs?

These rules are usually implemented in an Enterprise Resource Planning (ERP) software that sends orders to a Warehouse Management System (WMS).

Build and Deploy Your First Supply Chain App in 20 Minutes
Store replenishment process in most of the large retail companies - (Image by Samir Saci)

The goal is to develop a policy that minimises ordering, holding and shortage costs.

  • Ordering Costs: fixed cost to place an order
  • Holding Costs: variable costs required to keep your inventory (storage and capital costs)
  • Shortage Costs: the costs of not having enough inventory to meet the customer demand (Lost Sales, Penalty)

We will act as data scientists in a retail company and assess the efficiency of the inventory team’s rules.

Logistics Director: "Samir, we need your support to understand why some stores face stockouts while other have too much inventory."

For that, we need a tool to simulate multiple scenarios and visualise the impact of key parameters on costs and stock availability.

Build and Deploy Your First Supply Chain App in 20 Minutes
Visual of the Inventory Policy (Red: Store Demand, Blue: Orders, Green: Inventory On Hand) - (Image by Samir Saci)

In the chart above, you have an example of a rule with:

  • A uniform demand distribution (i.e., σ = 0)
    Every day, your store will sell the same number of items.
  • A periodic review policy with T = 10 days
    You replenish the stores every 10 days.
  • A delivery lead time of LD = 1 day.
    If you order today, you will receive the goods tomorrow.

As you can see in the green chart, your inventory on-hand (IOH) is always positive (i.e. you don't experience stock-outs).

  1. What if you have a 3-day lead time?
  2. What would be the impact of variability in the demand (σ > 0)?
  3. Can we reduce the average inventory on hand?

To answer these questions, I developed a simulation model using Jupyter Notebook to generate visuals in a complete tutorial.

Build and Deploy Your First Supply Chain App in 20 Minutes
Complete an end-to-end tutorial during which I explain how I built this model - (Image by Samir Saci)

In this article, I will briefly introduce the core functions I built in this tutorial and show how we will reuse them in our Streamlit app.

Note: I will keep explanations high-level to focus on the Streamlit app. For details, you can watch the full video later.

Your Inventory Simulation Tool in a Jupyter Notebook

The results of this tutorial will serve as the core foundation of our Inventory Simulation Streamlit App.

The project structure is basic with two Python files (.py) and a Jupyter Notebook.

tuto_inventory /
├─ Inventory Management.ipynb
└─ inventory/
├─ init.py
├─ inventory_analysis.py
└─ inventory_models.py

In inventory_models.py, you can find a Pydantic class that contains all the input parameters for our simulation.

from typing import Optional, Literal
from pydantic import BaseModel, Field


class InventoryParams(BaseModel):
    """Base economic & demand parameters (deterministic daily demand)."""
    D: float = Field(2000, gt=0, description="Annual demand (units/year)")
    T_total: int = Field(365, ge=1, description="Days in horizon (usually 365)")
    LD: int = Field(0, ge=0, description="Lead time (days)")
    T: int = Field(10, ge=1, description="Cycle time (days)")
    Q: float = Field(0, ge=0, description="Order quantity (units)")
    initial_ioh: float = Field(0, description="Initial inventory on hand")
    sigma: float = Field(0, ge=0, description="Standard deviation of daily demand (units/day)")

These operational parameters cover

  • Demand Distribution: the total demand D (pcs), our simulation horizon T_total (pcs) and the variability σ (pcs)
  • Logistics Operations: with the delivery lead time LD (in days)
  • Inventory rule parameters: including the cycle time T, order quantity Q and the initial inventory on hand initial_ioh

Based on these parameters, we want to simulate the impact on our distribution chain:

  • Demand distribution: how many units were sold?
  • Inventory On-Hand in green: how many units do we have in the store?
  • Replenishment orders in blue: when and how much have we ordered?
Build and Deploy Your First Supply Chain App in 20 Minutes
Inventory Simulation Visual: Demand (Red) / Orders (Blue) and Inventory On Hand (Green) - (Image by Samir Saci)

In the example above, you see a simulation of a periodic review policy with a 10-day cycle time.

How did I generate these visuals?

These functions are simulated using the class InventorySimulation created in inventory_analysis.py.

class InventorySimulation:
    def __init__(self, 
                 params: InventoryParams):
        self.type = type
        self.D = params.D
        self.T_total = params.T_total
        self.LD = params.LD
        self.T = params.T
        self.Q = params.Q
        self.initial_ioh = params.initial_ioh
        self.sigma = params.sigma
        
        # # Demand per day (unit/day)
        self.D_day = self.D / self.T_total
        
        # Simulation dataframe
        self.sim = pd.DataFrame({'time': np.array(range(1, self.T_total+1))})

We start by initialising the input parameters for the functions:

  • order() which represents a periodic ordering policy (you order Q units every T days)
  • simulation_1() that calculates the impact of the demand (sales) and the ordering policy on the inventory on hand each day
class InventorySimulation:
    ''' [Beginning of the class] ''' 
    def order(self, t, T, Q, start_day=1):
        """Order Q starting at `start_day`, then every T days."""
        return Q if (t > start_day and ((t-start_day) % T) == 0) else 0
    def simulation_1(self):
        """Fixed-cycle ordering; lead time NOT compensated."""
        sim_1 = self.sim.copy()
        sim_1['demand'] = np.random.normal(self.D_day, self.sigma, self.T_total)
        T = int(self.T)
        Q = float(self.Q)
        sim_1['order'] = sim_1['time'].apply(lambda t: self.order(t, T, Q))
        LD = int(self.LD)
        sim_1['receipt'] = sim_1['order'].shift(LD, fill_value=0.0)
        # Inventory: iterative update to respect lead time
        ioh = [self.initial_ioh]
        for t in range(1, len(sim_1)):
            new_ioh = ioh[-1] - sim_1.loc[t, 'demand']
            new_ioh += sim_1.loc[t, 'receipt']
            ioh.append(new_ioh)
        sim_1['ioh'] = ioh
        for col in ['order', 'ioh', 'receipt']:
            sim_1[col] = np.rint(sim_1[col]).astype(int)
        return sim_1 

The function simulation_1() includes a mechanism that updates inventory on-hand based on store demand (sales) and supply (replenishment orders).

My goal for this tutorial was to start with two basic rules to explain what happens when you introduce a lead time, as shown below.

Build and Deploy Your First Supply Chain App in 20 Minutes
Basic rules with a lead time of LD = 3 days - (Image by Samir Saci)

Stores experience stock-outs, as shown in the green chart.

Their on-hand inventory becomes negative due to late deliveries.

What can we do? Maybe increasing the order quantity Q?

This is what I tried in the tutorial; we discovered that this solution does not work.

Build and Deploy Your First Supply Chain App in 20 Minutes
This is what happens when you want to increase Q to compensate for the additional leadtime - (Image by Samir Saci)

These two scenarios highlighted the need for an improved ordering policy that compensates for lead times.

That is what we built in the second part of the tutorial with these two additional functions.

class InventorySimulation:
    ''' [Beginning of the class] ''' 

    def order_leadtime(self, t, T, Q, LD, start_day=1):
        return Q if (t > start_day and ((t-start_day + (LD-1)) % T) == 0) else 0

    def simulation_2(self, method: Optional[str] = "order_leadtime"):
        """Fixed-cycle ordering; lead time NOT compensated."""
        sim_1 = self.sim.copy()
        LD = int(self.LD)
        sim_1['demand'] = np.maximum(np.random.normal(self.D_day, self.sigma, self.T_total), 0)
        T = int(self.T)
        Q = float(self.Q)
        if method == "order_leadtime":
            sim_1['order'] = sim_1['time'].apply(lambda t: self.order_leadtime(t, T, Q, LD))
        else:
            sim_1['order'] = sim_1['time'].apply(lambda t: self.order(t, T, Q))
        sim_1['receipt'] = sim_1['order'].shift(LD, fill_value=0.0)
        # Inventory: iterative update to respect lead time
        ioh = [self.initial_ioh]
        for t in range(1, len(sim_1)):
            new_ioh = ioh[-1] - sim_1.loc[t, 'demand']
            new_ioh += sim_1.loc[t, 'receipt']
            ioh.append(new_ioh)
        sim_1['ioh'] = ioh
        for col in ['order', 'ioh', 'receipt']:
            sim_1[col] = np.rint(sim_1[col]).astype(int)
        return sim_1   

The idea is quite simple.

In practice, that means inventory planners must create replenishment orders at day = T - LD to compensate for the lead time.

Build and Deploy Your First Supply Chain App in 20 Minutes
4 days leadtime with the new ordering policy - (Image by Samir Saci)

This ensures stores receive their goods on day = T as shown in the chart above.

At the end of this tutorial, we had a complete simulation tool that lets you test any scenario to become familiar with inventory management rules.

If you need more clarification, you can find detailed explanations in this step-by-step YouTube tutorial:

However, I was not satisfied with the result.

Why do we need to package this in a web application?

Productising This Simulation Tool

As you can see in the video, I manually changed the parameters in the Jupyter notebook to test different scenarios.

Build and Deploy Your First Supply Chain App in 20 Minutes
Examples of scenarios we tested together in the tutorial - (Image by Samir Saci)

This is somewhat normal for data scientists like us.

But, would you imagine our Logistics Director opening a Jupyter Notebook in VS Code to test the different scenarios?

We need to productise this tool so anyone can access it without requiring programming or data science skills.

Good news, 70% of the job is done as we have the core modules.

In the next section, I will explain how we can package this in a user-friendly analytics product.

Create your Inventory Simulation App using Streamlit

In this section, we will create a single-page Streamlit App based on the core module from the first tutorial.

You can start by cloning this repository that contains the core simulation, including inventory_models.py and inventory_analysis.py.

Build and Deploy Your First Supply Chain App in 20 Minutes
Github Repository Streamlit App Starter - (Image by Samir Saci)

With this repository on your local machine, you can follow the tutorial and end up with a deployed app like this one:

Build and Deploy Your First Supply Chain App in 20 Minutes
Inventory Web Application that you will build: Access it here - (Image by Samir Saci)

Let's start!

Project Setup

The first step is to create a local Python environment for the project.

For that, I advise you to use the package manager uv:

# Create a virtual environment and activate it
uv init
uv venv
source .venv/bin/activate

# Install
uv pip install -r requirements.txt

It will install the libraries listed in the requirements file:

streamlit>=1.37
pandas>=2.0
numpy>=1.24
matplotlib>=3.7
pydantic>=2.0

We include Streamlit, Pydantic, and libraries for data manipulation (numpy, pandas) and for generating visuals (matplotlib).

Now you are ready to build your app.

Create your Streamlit Page

Create a Python file that you call: app.py

import numpy as np
import matplotlib.pyplot as plt
import streamlit as st
from inventory.inventory_models import InventoryParams
from inventory.inventory_analysis import InventorySimulation
seed = 1991
np.random.seed(seed)

st.set_page_config(page_title="Inventory Simulation – Streamlit", layout="wide")

In this file, we start by:

  • Importing the libraries installed and the analysis module with its Pydantic class for the input parameters
  • Defining a seed for random distribution generation that will be used to generate a variable demand

Then we start to create the page with st.set_page_config(), in which we include as parameters:

  • page_title: the title of the web page of your app
  • layout: an option to set the layout of the page
Build and Deploy Your First Supply Chain App in 20 Minutes
Your App with different layouts (Wide on the right) - (Image by Samir Saci)

By setting the parameter layout to "wide", we ensure the page is wide by default.

You can run your app now,

streamlit run app.py

After running this command, your app can be opened using the local URL shared in your terminal:

Build and Deploy Your First Supply Chain App in 20 Minutes
Local URL to reach your app

After loading, what you have is this blank page:

Build and Deploy Your First Supply Chain App in 20 Minutes
Initial Blank Page - (Image by Samir Saci)

Congratulations, you have run your app!

If you face any issues at this stage, please check that:

  • The local Python environment is set up properly
  • You have installed all the libraries inside the requirements file

Now we can start building our Inventory Management App.

A Sidebar with Inventory Management Parameters

Do you remember the Pydantic class we have defined in inventory_models.py?

They will serve as our input parameters for the app, and we will display them in a Streamlit sidebar.

with st.sidebar:
    st.markdown("**Inventory Parameters**")
    D = st.number_input("Annual demand D (units/year)", min_value=1, value=2000, step=50)
    T_total = st.number_input("Horizon T_total (days)", min_value=1, value=365, step=1)
    LD = st.number_input("Lead time LD (days)", min_value=0, value=0, step=1)
    T = st.number_input("Cycle time T (days)", min_value=1, value=10, step=1)
    Q = st.number_input("Order quantity Q (units)", min_value=0.0, value=55.0, step=10.0, format="%.2f")
    initial_ioh = st.number_input("Initial inventory on hand", min_value=0.0, value=55.0, step=1.0, format="%.2f")
    sigma = st.number_input("Daily demand std. dev. σ (units/day)", min_value=0.0, value=0.0, step=0.5, format="%.2f")
    method = st.radio(
        "Ordering method",
        options=["Simple Ordering", "Lead-time Ordering"],
        index=0
    )
    method_key = "order_leadtime" if method.startswith("Lead-time") else "order"
    
    run = st.button("Run simulation", type="primary")
    if run:
        st.session_state.has_run = True

In this sidebar, we include:

  • A title using st.markdown()
  • Number Input fields for all the parameters with their minimum, default, and incremental step values
  • A radio button to select the ordering method (considering or not lead time)
  • A button to start the first simulation
Build and Deploy Your First Supply Chain App in 20 Minutes
Examples of Number Input Field (left) / Radio Button (Middle) and Streamlit Button (Right) - Image by Samir Saci)

Before this block, we should add a session state variable:

if "has_run" not in st.session_state:
    st.session_state.has_run = False

This boolean indicates whether the user has already clicked the simulation button.

If that's the case, the app will automatically rerun all calculations whenever the user changes a parameter.

Great, now you app.py should look like this:

import numpy as np
import matplotlib.pyplot as plt
import streamlit as st
from inventory.inventory_models import InventoryParams
from inventory.inventory_analysis import InventorySimulation
seed = 1991
np.random.seed(seed)

st.set_page_config(page_title="Inventory Simulation – Streamlit", layout="wide")

if "has_run" not in st.session_state:
    st.session_state.has_run = False

with st.sidebar:

    st.markdown("**Inventory Parameters**")
    D = st.number_input("Annual demand D (units/year)", min_value=1, value=2000, step=50)
    T_total = st.number_input("Horizon T_total (days)", min_value=1, value=365, step=1)
    LD = st.number_input("Lead time LD (days)", min_value=0, value=0, step=1)
    T = st.number_input("Cycle time T (days)", min_value=1, value=10, step=1)
    Q = st.number_input("Order quantity Q (units)", min_value=0.0, value=55.0, step=10.0, format="%.2f")
    initial_ioh = st.number_input("Initial inventory on hand", min_value=0.0, value=55.0, step=1.0, format="%.2f")
    sigma = st.number_input("Daily demand std. dev. σ (units/day)", min_value=0.0, value=0.0, step=0.5, format="%.2f")
    method = st.radio(
        "Ordering method",
        options=["Simple Ordering", "Lead-time Ordering"],
        index=0
    )
    method_key = "order_leadtime" if method.startswith("Lead-time") else "order"
    
    run = st.button("Run simulation", type="primary")
    if run:
        st.session_state.has_run = True

You can have a look at your app, normally the window should look like this after a refresh:

Build and Deploy Your First Supply Chain App in 20 Minutes
Your app is starting to look like something we can use - (Image by Samir Saci)

On the left, you have your sidebar that we just created.

Build and Deploy Your First Supply Chain App in 20 Minutes
Title of the page with six cards reminding the parameters selected - (Image by Samir Saci)

Then, for aesthetics and user experience, I want to add a title and a reminder of the parameters used.

Why do I want to remind the parameters used?

On the top-left side of the window, you have a button to hide the side panel, as shown below.

Build and Deploy Your First Supply Chain App in 20 Minutes
Our streamlit app with the side panel hidden - (Image by Samir Saci)

This helps users to have more space to show the visual.

However, the input parameters will be hidden.

Therefore, we need to add a reminder at the top.

st.title("Inventory Simulation Web Application")
# Selected Input Parameters
D_day = D / T_total
st.markdown("""
<style>
.quick-card{padding:.9rem 1rem;border:1px solid #eaeaea;border-radius:12px;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.03)}
.quick-card .label{font-size:.85rem;color:#5f6b7a;margin:0}
.quick-card .value{font-size:1.25rem;font-weight:700;margin:.15rem 0 0 0;color:#111}
.quick-card .unit{font-size:.8rem;color:#8a95a3;margin:0}
</style>
""", unsafe_allow_html=True)

def quick_card(label, value, unit=""):
    unit_html = f'<p class="unit">{unit}</p>' if unit else ""
    st.markdown(f'<div class="quick-card"><p class="label">{label}</p><p class="value">{value}</p>{unit_html}</div>', unsafe_allow_html=True)

In the piece of code above, I have introduced :

  • CSS styling embedded in Streamlit to create cards
  • The function quick_card will create a card for each parameter using its label, value and units
Build and Deploy Your First Supply Chain App in 20 Minutes
Here are the cards with the labels, values and units - (Image by Samir Saci)

Then we can generate these cards in the same row using the streamlit object st.columns().

c1, c2, c3, c4, c5, c6 = st.columns(6)
with c1:
    quick_card("Average daily demand", f"{D_day:,.2f}", "units/day")
with c2:
    quick_card("Lead time", f"{LD}", "days")
with c3:
    quick_card("Cycle time", f"{T}", "days")
with c4:
    quick_card("Order quantity Q", f"{Q:,.0f}", "units")
with c5:
    quick_card("Initial IOH", f"{initial_ioh:,.0f}", "units")
with c6:
    quick_card("Demand σ", f"{sigma:.2f}", "units/day")

The first line defines the six columns in which we place the cards using the quick_card function.

Build and Deploy Your First Supply Chain App in 20 Minutes
Your app should look like this now - (Image by Samir Saci)

We can move on to the interesting part: integrating the simulation tool into the app.

Any question or blocking at this step? You can use the comment section of the video, I'll try my best to answer promptly.

Integrating the inventory simulation module in the Streamlit App

We can now start working on the main page.

Let us imagine that our Logistics Director arrives on the page, selects the different parameters and clicks on "Run Simulation".

This should trigger the simulation module:

if st.session_state.has_run:
    params = InventoryParams(
        D=float(D),
        T_total=int(T_total),
        LD=int(LD),
        T=int(T),
        Q=float(Q),
        initial_ioh=float(initial_ioh),
        sigma=float(sigma)
    )

    sim_engine = InventorySimulation(params)

In this short piece of code, we do many things:

  • We build the input parameter object using the Pydantic class from inventory_models.py
    This ensures every value (demand, lead time, review period, sigma…) has the correct data type before running the simulation.
  • We create the simulation engine InventorySimulation class from inventory_analysis.py
    This class contains all the inventory logic I developed in the first tutorial.

Nothing will change on the user interface.

We can now start to define the computation part.

if st.session_state.has_run:
    ''' [Previous block introduced above]'''
    if method_key == "order_leadtime":
        df = sim_engine.simulation_2(method="order_leadtime")
    elif method_key == "order":
        df = sim_engine.simulation_2(method="order")
    else:
        df = sim_engine.simulation_1()

    # Calculate key parameters that will be shown below the visual
    stockouts = (df["ioh"] < 0).sum()
    min_ioh = df["ioh"].min()
    avg_ioh = df["ioh"].mean()

First, we select the correct ordering method.

Depending on the ordering rule chosen in the radio button of the sidebar, we call the appropriate simulation method:

  • method="order": is the initial method that I showed you, which failed to keep a stable inventory when I added a lead time
  • method="order_leadtime": is the improved method that orders at day = T - LD
Build and Deploy Your First Supply Chain App in 20 Minutes
Inventory On Hand with negative values on top (Simple Ordering) vs. Lead-time ordering - (Image by Samir Saci)

The results, stored in the pandas dataframe, df are used to compute key indicators such as the number of stockouts and the minimum and maximum inventory levels.

Now that we have simulation results available, let's create our visuals.

Create Inventory Simulation Visuals on Streamlit

If you followed the video version of this tutorial, you probably noticed that I copied and pasted the code from the notebook created in the first tutorial.

if st.session_state.has_run:
    '''[Previous Blocks introduced above]'''
    # Plot
    fig, axes = plt.subplots(3, 1, figsize=(9, 4), sharex=True)  # ↓ from (12, 8) to (9, 5)
    # Demand
    df.plot(x='time', y='demand', ax=axes[0], color='r', legend=False, grid=True)
    axes[0].set_ylabel("Demand", fontsize=8)
    # Orders
    df.plot.scatter(x='time', y='order', ax=axes[1], color='b')
    axes[1].set_ylabel("Orders", fontsize=8); axes[1].grid(True)
    # IOH
    df.plot(x='time', y='ioh', ax=axes[2], color='g', legend=False, grid=True)
    axes[2].set_ylabel("IOH", fontsize=8); axes[2].set_xlabel("Time (day)", fontsize=8)
    # Common x formatting
    axes[2].set_xlim(0, int(df["time"].max()))
    for ax in axes:
        ax.tick_params(axis='x', rotation=90, labelsize=6)
        ax.tick_params(axis='y', labelsize=6)
    plt.tight_layout()

Indeed, the same visual code that you use to prototype in your Notebooks will work in your app.

The only difference is that instead of using plt.show(), you conclude the section with:

st.pyplot(fig, clear_figure=True, use_container_width=True)  

Streamlit needs to explicitly control of the rendering using

  • fig the Matplotlib figure you created earlier.
  • clear_figure=True This parameter clears the figure from memory after rendering to prevent duplicate plots when parameters are updated.
  • use_container_width=True to make the chart automatically resize to the width of the Streamlit page

At this stage, normally, you have this on your app:

Build and Deploy Your First Supply Chain App in 20 Minutes
Screen of your app with the visual generated - (Image by Samir Saci)

If you try to change any parameter, for example, change the ordering method, you will see the visual automatically updated.

What is remaining?

As a bonus, I added a section to help you discover additional functionalities of streamlit.

if st.session_state.has_run:
    '''[Previous Blocks introduced above]'''
    # Key parameters presented below the visual
    kpi_cols = st.columns(3)
    kpi_cols[0].metric("Stockout days", f"{stockouts}")
    kpi_cols[1].metric("Min IOH (units)", f"{min_ioh:,.0f}")
    kpi_cols[2].metric("Avg IOH (units)", f"{avg_ioh:,.0f}")

    # Message of information
    st.success("Simulation completed.")

In addition to the columns that we already defined in the previous section, we have:

  • metric() that generates a clean and built-in Streamlit card
    Unlike my custom card, you don't need CSS here.
  • st.success() to display a green success banner to notify the user that the results have been updated.
Build and Deploy Your First Supply Chain App in 20 Minutes
Metric cards and the success message - (Image by Samir Saci)

This is the cherry on the cake that we needed to conclude this app.

You now have a complete app that automatically generates visuals and easily tests scenarios, working on your machine.

What about our Logistics Director? How he can use it?

Let me show you how to deploy it for free on Streamlit Community Cloud easily.

Deploy your App on Streamlit Community

First, you need to push your code to GitHub, as I did here: GitHub Repository.

Then you go to the top right of your app, and you click on Deploy.

Build and Deploy Your First Supply Chain App in 20 Minutes
Deploy your app window - (Image by Samir Saci)

Then click Deploy now and follow the steps to grant Streamlit access to your GitHub account (Streamlit will automatically detect that you have pushed your code to GitHub).

Build and Deploy Your First Supply Chain App in 20 Minutes
Provide the App URL - (Image by Samir Saci)

You can create a custom URL: mine is supplyscience.

After clicking Deploy, Streamlit will redirect you to the deployed app.

Congratulations, you have deployed your first Supply Chain Analytics Streamlit App!

Feel free to check the complete tutorial.

Feel free to use the comment to ask your questions or share what you deployed on Streamlit.

Conclusion

💡
If you have any question, feel free to ask it here: Ask a Question

I designed this tutorial for the version of myself from 2018.

At the time, I knew enough Python and analytics to build optimisation and simulation tools for my colleagues, but I did not yet know how to turn them into real products.

This tutorial is the first step in your journey toward industrialising analytics solutions.

What you built here is probably not production-ready, but it is a functional app that you can share with our Logistics Director.

Do you need inspiration for other applications?

How to Complete this App?

Now that you have the playbook for deploying Supply Chain Analytics applications, you likely want to improve the application by adding more models.

I have a suggestion for you.

You can follow this step-by-step tutorial to implement Product Segmentation with Pareto Analysis and ABC Chart.

You will learn how to deploy strategic visuals, such as the ABC XYZ, to help retail companies manage their inventory.

Build and Deploy Your First Supply Chain App in 20 Minutes
ABC Chart with Analysis of the Demand Variability - (Image by Samir Saci)

This can be easily implemented on the second page of the app that you just deployed.

If needed, I can work on another article focusing on this solution!

Tired of inventory management?

You can find 80+ case studies of AI & analytics products to support Supply Chain Optimisation, Business Profitability and Process Automation in this cheat sheet.

Build and Deploy Your First Supply Chain App in 20 Minutes
Supply Chain Analytics Cheat Sheet - (Image by Samir Saci)

For most of the case studies, published in Towards Data Science, you can find the source code that can be implemented in a Streamlit app.

About Me

Let’s connect on LinkedIn and Twitter. I am a Supply Chain Engineer who uses data analytics to improve logistics operations and reduce costs.

For consulting or advice on analytics and sustainable supply chain transformation, feel free to contact me via Logigreen Consulting.

If you are interested in Data Analytics and Supply Chain, look at my website.

Samir Saci | Data Science & Productivity

]]>
<![CDATA[How I Use AI to Convince Companies to Adopt Sustainability]]>https://www.samirsaci.com/how-i-use-ai-to-convince-companies-to-adopt-sustainability/69303f8a2d7d9b0001c68a58Wed, 03 Dec 2025 13:52:32 GMT

Nothing is harder than convincing someone of a truth they cannot see in their own data.

Data science and sustainability experts face the same problem: our concepts may be too abstract and theoretical, making them difficult for decision-makers to relate to.

When I published a case study on Green Inventory Management in 2024, I thought the logic was solid and convincing, but the impact was limited.

I learned this the hard way while developping my startup!

How I Use AI to Convince Companies to Adopt Sustainability
Green Inventory Management = Optimising Store Replenishment Strategies to Reduce CO2 Emissions (Image by Samir Saci)

The article explained the mathematical theory behind it and used an actual case study to demonstrate the sustainability benefits.

Yet it didn’t convert sceptics.

Customer: "I am sure it won't work with our operations!"

Why? Because it wasn’t connected to their data and constraints.

So I decided to change the approach.

I packaged the simulation tool in a FastAPI microservice and gave my customers the ability to test the model themselves using an MCP Server connected to Claude Desktop.

How I Use AI to Convince Companies to Adopt Sustainability
Simple setup of local MCP server connected to the analytics product - (Image by Samir Saci)

The objective was to have them ask the LLM to run their own scenarios, adjust their parameters, and see how CO₂ emissions dropped in response to different inventory policies.

In this article, I will share the approach I used for this experiment and the feedback I received from a prospect, the Supply Chain Director of a retail group based in the Asia Pacific region.

What is Green Inventory Management?

In this section, I want to briefly explain the concept of Green Inventory Management so you have the context to understand the tool's added value.

Context: Inventory Management for a Retail Company

Let us put ourselves in our Supply Chain Director's shoes.

His teams (inventory teams, warehouse and transportation operations) are responsible for replenishing stores from a central distribution centre.

How I Use AI to Convince Companies to Adopt Sustainability
Store Replenishment Process of our retail company - (Image by Samir Saci)

When they need specific products, stores automatically send replenishment orders via their ERP to the Warehouse Management System.

How I Use AI to Convince Companies to Adopt Sustainability
Inventory Management Rules — Periodic Review Policy (Image by Samir Saci)

These automated orders follow rules implemented by the inventory team, known as the periodic review “Order-Up-To-Level (R, S)” policy.

  1. The ERP is reviewing stores' inventory levels, also called inventory on hand (IOH), every R days
  2. A Replenishment Order is created and transmitted to the warehouse with the quantity: Q = S — IOH

The delta between the target inventory S and the inventory level is calculated: Δ = S— IOH

After transmission, the order is prepared at the warehouse and delivered to your store within a specific lead time (LD) in days.

How I Use AI to Convince Companies to Adopt Sustainability
Example of Periodic Review Policy - (Image by Samir Saci)

To be more concrete, I share the example above:

  • R = 25 days: we review the inventory every 25 days as you can see in the blue scatter plot
  • S = 1,995 units: we ordered to reach this level, as shown in the latest graph.

The inventory teams in the systems usually set these parameters, and the replenishment orders are automatically triggered.

What if we optimise these parameters?

Impacts on Logistics Operations

Based on my experience, these parameters are, most of the time, not set optimally..

The problem is that they significantly impact the efficiency of your warehouse and transportation operations.

This increases carton and plastic consumption and reduces productivity.

How I Use AI to Convince Companies to Adopt Sustainability
Impact on Carton Usage - (Image by Author)

In the example above, items are stored in cartons containing units that can be picked individually.

If the order quantity is five, the operator will:

  • Open a box of 20 units and take five units.
  • Take a new box and put these items in it.
  • Palletise the boxes using plastic film.

The other impact is on truck filling rate and CO2 emissions.

How I Use AI to Convince Companies to Adopt Sustainability
Green Inventory Management = Optimising Store Replenishment Strategies to Reduce CO2 Emissions (Image by Samir Saci)

With a high delivery frequency, you reduce the volume per shipment.

This leads to the use of smaller trucks that may not be full.

What can we do?

Objectives of Green Inventory Management

We can test multiple scenarios, with different operational parameters, to find the optimal setup.

For that, I have loaded customer data into the simulation model
to test the tool with real scenarios.

How I Use AI to Convince Companies to Adopt Sustainability
Simulation Parameters- (Image by Samir Saci)

Users can adjust some of these parameters to simulate different scenarios.

class LaunchParamsGrinv(BaseModel):
    n_day: int = 30           # Number of days in the simulation
    n_ref: int = 20           # Number of SKUs in the simulation
    pcs_carton: int = 15      # Number of pieces per full carton
    cartons_pal: int = 25     # Number of cartons per pallet
    pallet_truck: int = 10    # Number of pallets per truck
    k: float = 3              # Safety factor for safety stock
    CSL: float = 0.95         # Cycle service level target
    LD: float = 1             # Lead time for delivery (days)
    R: float = 2              # Review period (days)
    carton_weight: float = 0.3    # Carton material weight (kg)
    plastic_weight: float = 0.173 # Plastic film weight per pallet (kg)

These parameters include:

  • n_day and n_ref : define the scope of simulation
  • pcs_carton, cartons_pal, LD and pallet_truck: parameters linked to warehousing and transportation operations
  • carton_weight, plastic_weight: sustainability parameters
  • R, k and CSL: parameters set by the inventory team

I want our Supply Chain Director to sit with his teams (inventory, warehouse, transportation and sustainability) to challenge the status quo.

If they need to reach a specific target, our director can:

  • Challenge his inventory teams to find better review periods (R), or cycle service level (CSL) targets
  • Ask the sustainability team to find lighter carton materials
  • Redesign his warehouse operations to reduce the lead time (LD)
How I Use AI to Convince Companies to Adopt Sustainability
Approach of the tool (Image by Samir Saci)

For that, we need to provide them with a tool to simulate the impact of specific changes.

How I Use AI to Convince Companies to Adopt Sustainability
Example of Analysis - CO2 emissions for different scenario of delivery frequency - (Image by Samir Saci)
This is what we're going to do with the support of an MCP Server connected to Claude AI.

Demo of the Green Inventory Management AI Assistant

Now that we know how this simulation tool can add value to my customers, let me show you examples of analyses they have performed.

These tests were performed using customer data over a simulation horizon of up to 90 days.

I have replicated the questions and interactions using anonymised dummy data to avoid sharing confidential information here.

Onboarding of users

I have connected the MCP server to the Claude environment used by the Supply Chain managers to have them "play with the tool".

The majority did not take the time to review the initial case study and directly asked Claude about the tool.

How I Use AI to Convince Companies to Adopt Sustainability
Initial Interaction - (Image by Samir Saci)

Hopefully, I have documented the MCP tools to provide context to the agent, like in the toot launch_greeninv shared below.

@mcp.tool()
def launch_greeninv(params: LaunchParamsGrinv):
    """
    Launch a complete Green Inventory Management simulation.

    This tool sends the input parameters to the FastAPI microservice
    (via POST /grinv/launch_grinv) and returns detailed sustainability
    and operational KPIs for the selected replenishment rule (Review Period R).

    -------------------------------------------------------------------------
    🌱 WHAT THIS TOOL DOES
    -------------------------------------------------------------------------
    It runs the full simulation described in the "Green Inventory Management"
    case study, reproducing the behavior of a real retail replenishment system
    using a (R, S) Periodic Review Policy.

    The simulation estimates:
      - Replenishment quantities and order frequency
      - Stock levels and stockouts
      - Number of full and mixed cartons
      - Number of pallets and truck deliveries
      - CO₂ emissions for each store and globally
      - Carton material and plastic usage
      - Operator productivity (orderlines and pieces per line)
    
    [REMAINDER OF DOC-STRING OMITTED FOR CONCISION]
    """
    logging.info(f"[GreenInv] Running simulation with params: {params.dict()}")

    try:
        with httpx.Client(timeout=120) as client:
            response = client.post(LAUNCH, json=params.dict())
            response.raise_for_status()

        result = response.json()
        last_run = result

        return {
            "status": "success",
            "message": "Simulation completed",
            "results": result
        }

    except Exception as e:
        logging.error(f"[GreenInv] Error during API call: {e}")                                                                                
        return {
            "status": "error",
            "message": str(e)
        }

I was quite satisfied with Claude's introduction to the tool.

It starts with the introduction of the core capabilities of the tools from an operational point of view.

How I Use AI to Convince Companies to Adopt Sustainability
Introduction of the tool by Claude - (Image by Samir Saci)

Quickly, our director started to send me long emails with questions on how to use the tool:

  • How to set up the parameters?
  • Who should I involve in this exercise?

My initial reflex was to answer: "Why don't you ask Claude?".

This is what they did, and the results are excellent. Claude proposed a framework of analysis.

How I Use AI to Convince Companies to Adopt Sustainability
Framework of collaborative work for green inventory optimisation - (Image by Samir Saci)

This framework is nearly perfect; I would just have put the lead time (LD) also in the scope of the Warehouse Manager.

However, I need to admit that I would never have been able to generate such a concise and well-formatted framework on my own.

Then, Claude proposed a plan for this study with multiple phases.

How I Use AI to Convince Companies to Adopt Sustainability
Sample of the analysis plan proposed by Claude - (Image by Samir Saci)

Let me take you through the different phases from the user's perspective.

Phase 1: Baseline Assessment

I advised the team to continually ask Claude for a nice dashboard with a concise executive summary.

That is what they did for Phase 1.

How I Use AI to Convince Companies to Adopt Sustainability
User asks for a run of the baseline - (Image by Samir Saci)

As you can see in the screenshot above, Claude used the MCP Server tool launch_greeninv to run an analysis with the default parameters defined in the Pydantic model.

With the outputs, it generated the Executive Summary for our director.

How I Use AI to Convince Companies to Adopt Sustainability
Executive Summary of the initial run - (Image by Samir Saci)

The summary is concise and straight to the point.

It compares the outputs (key performance indicators) to the targets shared in the MCP docstring and the master prompt.

What about the managers?

Then it generated team-specific outputs, including tables and comments that clearly highlighted the most significant issues, as shown in the example below.

How I Use AI to Convince Companies to Adopt Sustainability
Example of the Warehouse Manager View - (Image by Samir Saci)

What is interesting here is that our warehouse manager only mentioned the target pieces per line in a previous message.

That means we can have the tool learn not only from the MCP's tools docstrings, master prompt, and Pydantic models, but also from user interactions.

How I Use AI to Convince Companies to Adopt Sustainability
Example of Sustainability Team view - (Image by Samir Saci)

Finally, the tool demonstrated its ability to have a strategic approach, providing mid-term projections and alerting on the key indicators.

How I Use AI to Convince Companies to Adopt Sustainability
Next Steps proposed to the Director - (Image by Samir Saci)

However, nothing is perfect.

When you have weak prompting, Claude never loses the opportunity to hallucinate and propose decisions outside the scope of the study.

Let us continue the exercise, following Anthropic's model, and proceed to Phase 2.

Phase 2: Scenario Planning

After brainstorming with its team, our director collected multiple scenarios from each manager.

How I Use AI to Convince Companies to Adopt Sustainability
Scenarios collected from the four managers - (Image by Samir Saci)

What we can see here is that each manager wanted to challenge the parameters focused on their scope of responsibility.

This thought process is then transcribed into actions.

How I Use AI to Convince Companies to Adopt Sustainability

Claude decided to run the six scenarios listed above.

The challenge here is to compile all the results into a synthetic, insight-driven summary.

How I Use AI to Convince Companies to Adopt Sustainability
Example from the previous case study with a focus only on carton usage - (Image by Samir Saci)

In the case study published in 2024, I focused only on the first three scenarios, examining each performance indicator individually.

What about Claude?

Claude was smarter.

How I Use AI to Convince Companies to Adopt Sustainability
Scenario Comparison Matrix - (Image by Samir Saci)

Although we had the same type of data on hand, it produced something more "cross-functional" and decision-driven.

  • We have business-friendly names for each scenario that are understandable across functions.
  • Each scenario is linked to the team that pushed for it.

Finally, it provided an optimal scenario that is a consensus between the teams.

How I Use AI to Convince Companies to Adopt Sustainability
Explanation and score card of the consensus scenario - (Image by Samir Saci)

We are even provided with a scorecard that explains to each team why the scenario is best for everybody.

For a more detailed breakdown of the agent's outputs, feel free to have a look at this tutorial:

Conclusion

💡
If you have any question, feel free to ask it here: Ask a Question

A new hope for the concept of Green Inventory Management

After a couple of weeks of experimentation, the Supply Chain Director is convinced of the need to implement Green Inventory Management.

The only bottleneck here is on their side now.

With Claude's support, our four managers involved in the study understood the impact of their roles on the distribution chain's overall efficiency.

How I Use AI to Convince Companies to Adopt Sustainability
Matrix of Parameters Control by Team - (Image by Samir Saci)

This helps us at LogiGreen onboard Supply Chain departments for complex optimisation exercises like this one.

In my opinion, it is easier to conduct a green transformation when all teams have ownership and sponsorship.

And the only way to get that is to make sure everybody understands what we are doing.

Based on the initial results of this modest experiment, I think we have found an excellent tool for that.

Do you want other case studies using MCP Server for Supply Chain Optimisation?

AI Agent for Supply Chain Network Optimisation

In another article published on Towards Data Science, I share a similar experiment focused on the Supply Chain Network Design exercise.

How I Use AI to Convince Companies to Adopt Sustainability
Example of Network Design - (Image by Samir Saci)

The objective here is more macro-level.

We want to determine where goods are produced to serve markets at the lowest cost in an environmentally friendly way.

How I Use AI to Convince Companies to Adopt Sustainability
Exemple of scenarios - (Image by Samir Saci)

While the algorithm differs, the approach remains the same.

We try multiple scenarios with parameters that favour different teams (finance, sustainability, logistics, manufacturing) to reach a consensus.

How I Use AI to Convince Companies to Adopt Sustainability
Example of outputs - (Image by Samir Saci)

Like here, Claude does a great job in synthesising the results and providing data-driven recommendations.

For more details, you can watch this video.

]]>
<![CDATA[Build an AI Agent for Strategic Budget Planning with LangGraph and n8n]]>https://www.samirsaci.com/build-an-ai-agent-for-strategic-budget-planning-with-langgraph-and-n8n/69108e37ce084b00015411a1Fri, 26 Sep 2025 12:51:00 GMTIf I could just send ‘Run 2026 budget with XXX caps and Y% on Sustainability’ and get a decision back, that would change our budget review.Build an AI Agent for Strategic Budget Planning with LangGraph and n8n

That is how the VP Supply Chain of an international retailer framed the problem when we discussed automating budget planning for their annual CAPEX approval cycle.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Example of CAPEX Application — (Image by Samir Saci)

Because companies must invest in expensive equipment, directors receive budget applications from operational teams for short and long-term plans.

This is a complex exercise, as decision makers need to balance return on investment (ROI) with long-term strategy.

As a data scientist, how can you help large companies “partially automate” this decision-making process.

We can use linear programming to help decide which projects to fund to maximise ROI while respecting multi-year budget constraints.

In this article, I will introduce an AI Agent for Budget Planning that turns email requests into an optimised Capital Expenditure (CAPEX) portfolio.

This AI-powered workflow is built using LangGraph coupled with n8n (for orchestration) to create a reasoning agent connected to a FastAPI microservice that executes a linear programming model.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Objective of the Workflow — (Image by Samir Saci)

I will first introduce the problem with an actual example of a budget planning review.

We will then review the architecture and explore the results using a real request for budget optimisation with a constraint of a minimum 20% allocation for sustainability projects.

Budget Planning Optimisation with Python

Problem Statement: Operational Budget Planning

For this exercise, we are helping a regional director of an international logistics company based in the Asia Pacific.

This company provides warehousing and transportation services to other companies across four different countries.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Scope of the example — (Image by Samir Saci)

These operations support 48 customers across more than eight market verticals (Luxury, Cosmetics,…).

Within their scope, for instance, they manage a 30,000 sqm distribution centre for a large luxury fashion retailer in Guangzhou, which delivers to 50 stores in South China.

Guangzhou Site Manager: We need 150k euros for a new conveyor belt that will increase our receiving productivity by 20%.

Every year, in December, he receives an Excel file titled "CAPEX Applications."

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Examples of CAPEX Application — (Image by Samir Saci)

This file contains a list of all the projects that require capital expenditure (CAPEX) from 17 warehouse managers across the APAC region.

For each project, the application includes a brief project description, a three-year cost profile, and the projected Return On Investment.

These projects can also bring additional benefits:

  • Business Development: unlock new revenue (e.g., capacity for a new customer or product line)
  • Sustainability (CO₂ Reduction): lower emissions via energy-efficient equipment or layout changes
  • Digital Transformation: improve data visibility, automate repetitive tasks, and enable AI-driven decisions
  • Operational Excellence: increase throughput, reduce defects and rework, shorten changeovers, and stabilise processes.
  • HSE (Health, Safety & Environment): reduce incident risk and insurance exposure with safer equipment
  • CSR (Corporate Social Responsibility): strengthen community and workforce initiatives (e.g., training, accessibility)

A warehouse automation project can reduce the usage of packaging material (sustainability), decrease operator fatigue (CSR), and accelerate digital transformation.

These benefits are linked to the top management guidelines that our director needs to follow.

APAC Director: “How should I allocate my budget of XX M€ to maximise the ROI while respecting my top management guidelines?

As the director receives over 50 projects each session, we proposed to build a linear programming module to determine the optimal selection, taking into account external constraints.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Objective of the solution — (Image by Samir Saci)

As inputs, we get the available budget and the management objectives, along with the spreadsheet of CAPEX applications.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Example of CAPEX Application Spreadsheet — (Image by Samir Saci)

This will be part of the inputs of our solution.

FastAPI Microservice: 0–1 Mixed-Integer Optimiser for CAPEX Budget Planning

I designed this module using the PuLP library of Python.

The solution is packaged in a FastAPI microservice deployed on the cloud.

Decision Variables

For each project i, we define a binary value to inform if we allocate a budget or not:

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Decision Variables — (Image by Samir Saci)

Objective Function

The objective is to maximise the total return on investment of the portfolio of projects we selected:

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Objective Function — (Image by Samir Saci)

Constraints

As we cannot spend more than what we have allocated per year, we must consider the budget constraints for the next three years.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Constraints — (Image by Samir Saci)
APAC Director: “The CEO want us to invest 20% of our budget on projects supporting our sustainability roadmap.”

Moreover, we may also have constraints on the minimum budget for specific management objectives.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Example of Constraint for Sustainability — (Image by Samir Saci)

In the example above, we ensure that the total investment for sustainability projects is equal to or greater than S_min.

Now that we have defined our model, we can package it as a FastAPI microservice using the code shared in this article.

This overall workflow will accept a specific Pydantic schema for validation and defaults.

LaunchParamsBudget captures the optimisation inputs:

  • The three annual budget caps (budget_year1/2/3 in euros)
  • The optional minimum-allocation rule toggled by set_min_budget with its target management objective min_budget_objective and the required share min_budget_perc in %.

We need to ensure that the Agent respects this schema; if not, it will be unable to query the API.

What can we expect as outputs?

The agent will receive the details of the allocated budget, including the annual split, along with information on the selected projects.

With these results and a proper system prompt, our agent can provide a concise summary of the budget allocation to the VP of Logistics.

Building an Agentic Workflow with LangGraph and n8n

End-to-End Workflow Description

Let us assume that our Asia Pacific Director received a spreadsheet with all the CAPEX applications.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Example of CAPEX Application Spreadsheet — (Image by Samir Saci)

The idea is to receive the hypotheses regarding the budget amount and constraints in plain English via email, along with the spreadsheet attached.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Email request with 20% on sustainability — (Image by Samir Saci)

Based on this email, the workflow should automatically select projects for optimal budget allocation.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Project Selected or Not (✅/❌)— (Image by Samir Saci)

The director also expects a concise explanation of the choices made to build this optimal investment portfolio.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Example of Summary Generated by the Agent — (Image by Samir Saci)

We can build an automated workflow using LangGraph and n8n for orchestration to perform these tasks.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Objective of the workflow — (Image by Samir Saci)

This will be a workflow in 4 steps:

  • Step 1: Using the n8n Gmail node, we send the email body and the spreadsheet attached to the FastAPI Backend
  • Step 2: An AI Agent Parser will collect the parameters from the email and call the other API for Budget Planning
  • Step 3: The outputs will be sent to an AI Agent Summarizer that will use them to generate the summary
  • Step 4: The user receives a reply by email with the summary via a Gmail node in n8n

The core LangGraph agentic workflow will be implemented within a FastAPI microservice, which will be wrapped in an n8n workflow for orchestration.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
n8n orchestration workflow — (Image by Samir Saci)

The first two nodes on the top will extract the content of the spreadsheet and upload it to the API.

Then, we extract the email content in the Extract Email Body node and send it to the agent endpoint using the node Query AI Agent.

The outputs of the API include:

  • A detailed explanation of the optimal budget allocation is sent by email using the Reply node
  • A JSON with the allocation by project used by the node Update Allocation to add the ✅ and ❌ in the spreadsheet

Ultimately, our director receives a comprehensive analysis of the optimal portfolio, which includes three distinct sections.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Budget Summary — (Image by Samir Saci)

A Budget Summary provides details on the allocated budget and the return on investment.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Portfolio Composition — (Image by Samir Saci)

The Portfolio Composition details the number of projects awarded per management objective.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Recommendation — (Image by Samir Saci)

Finally, the agent concludes with a Recommendation based on its understanding of the objective.

Let us see how we built the core LangGraph Budget Agent, which parses an email to return a complete analysis.

Budget Planning AI Agent with LangGraph

The code shared in this section has been greatly simplified for concision.

Before creating the graph, let us build the different blocks:

  • EmailParser is used to parse the email body received from the n8n HTTP node to extract the parameters of the Budget API
  • BudgetPlanInterpreter will call the API, retrieve the results and generate the summary

For your information, I have used this approach with standalone blocks because we reuse them in other workflows that combine multiple agents.

Block 1: AI Agent Parser

Let us build the block for this agent that we will call AI Agent Parser:

We include the parameters that will be used for the Graph State variables.

This block EmailParser turns a plain-text email body into typed, schema-valid parameters for our Budget Planning API using an LLM.

  1. On initialisation, we load the chat model from the config and build a LangChain chat model.
  2. The function parse() takes the raw email content sent by n8n HTTP node and the system prompt to invoke the model with structured outputs defined with the LaunchParamsBudget Pydantic schema.

The EmailParser system_prompt stored in the YAML config file (minimal version for concision):

It includes a list of fields to parse, along with concise explanations and strict format rules.

The output looks like this:

This will be sent to the second agent for call tooling (our other FastAPI Microservice) and results interpretation.

Block 2: Block for Tool Calling and Interpretation

Two blocks will be used to call the Budget Planning API and to process the API’s output.

As I will be using this Budget Planning API for multiple agents, I created a standalone function to call it.

We can now call this function in the block BudgetPlanInterpreter defined below.

It runs the budget optimiser and turns its JSON into an “executive summary” in HTML format.

  • We use run_plan() to call the FastAPI microservice utilising the function run_budget_api(s) to retrieve the results
  • The function interpret() generates the analysis based on the API's outputs, following the instructions of a system prompt.

We now have our three foundation blocks that can be used to build a graph with nodes and conditional edges.

LangGraph Builder with nodes and conditional edges

Now that we have the three blocks, we can build our graph.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
LangGraph — (Image by Samir Saci)

This is a small experimental LangGraph state machine that includes the three steps (parsing, running, interpretation) with error handling at every step.

This block is fundamental as it defines the shared state passed between LangGraph nodes

  • session_id: included in the API call
  • email_text: raw email body received from the n8n node
  • params: structured inputs parsed from the email by EmailParser
  • budget_results: JSON output of the FastAPI microservice
  • html_summary: the analysis (in HTML format) generated by interpret() based on the output budget_results
  • error: storing an error message if needed

We should now define the functions of each node that will receive the current AgentState and return a partial update.

Function : handle_error(state)

  • Returns an error message in HTML format, which will be sent to the Gmail node in n8n to notify the user
Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Example of error message — (Image by Samir Saci)

In this case, for the support team, it is more practical as the user just has to forward the email.

Note: In the production version, we have added a run_id to help track the issues in the logs.

Function 2: parse_email(state)

  • Uses EmailParser to transform the email body received into parameters for Budget Planning in JSON format
  • On success: returns {"params": …} used to call the FastAPI Microservice

Function 3: run_budget(state)

  • Uses BudgetPlanInterpreter to call the function run_plan that will execute the budget optimisation via the FastAPI microservice
  • On success: returns the output of the optimiser in JSON format as budget_results

This output can be used to generate a summary of the budget allocation.

Function 4: summarize(state)

  • Reuses interpreter from state (or creates one), then calls interpret()
  • On success: returns a concise and professional summary of the budget allocation in HTML format, ready to be sent by email {"html_summary": …}

This output html_summary is then returned by the API to the Gmail node on n8n to reply to the sender.

Now that we have all the functions, we can create the nodes and “wire” the Graph using the function build_budagent_graph() defined below:

These four nodes are connected using Routers:

  • route_after_parse will direct the flow based on the output of the email parsing: if error in state → go to "error"; else → "run".
  • route_after_run will direct the flow based on the output of the FastAPI Microservice calling: if error in state → go to "error"; else → "summarize".

We are nearly done!

We need to package this in a FastAPI endpoint:

It will be queried by the Query Agent API node of our n8n workflow to return input parameters in params, Budget Optimiser results in budget_results and the summary generated by the Agent Interpreter in html_summary.

A fully functional AI Workflow for Budget Planning

We can now activate the workflow on n8n and test the tool with different scenarios.

What if we don’t have a minimum budget for any management objectives?

I will try to adapt the email to have set_min_budget at False.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Example of email — (Image by Samir Saci)

The email has been well parsed with now set_min_budget at the value False.

And we can see the results in the summary:

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Results of the new run - Image by Samir Saci

As we could expect, the performance is better:

  • Total ROI: €1,050,976 (vs. €1,024,051)
  • ROI/€: €0.26 (vs. €0.24)

Conclusion

💡
If you have any question, feel free to ask here: Ask Your Question

This workflow has been presented to the regional team, who started to “play with it”.

We learned that they use it to prepare slides with different scenarios of portfolio allocation for the board meetings.

This remains a “strategic tool” that is used only a couple of times per year.

However, we plan to reuse the same architecture for more “tactical” tools that supply chain departments can use for ABC Analysis, Stock Management, or Supply Chain Optimisation, as well as human resources for Workforce Planning or business controlling teams.

Can we go beyond this simple workflow?

I am still not satisfied with the contribution of the Agentic part of the workflow.

Indeed, it’s nice to have a tool that can be triggered by an email and provide a concise summary.

However, I would like to explore the idea of having multiple agents proposing different scenarios that would compete against each other.

What would be the impact on the ROI if we increase the minimum budget of sustainability by 15%?

For instance, we can ask agents to run multiple scenarios and provide a comparative study.

We are still experimenting with various types of orchestration to determine the most efficient approach.

For instance, we tested the MCP Servers in the example below.

This will be the topic of the following articles.

Other examples of Agentic Workflows?

This is not the first time I have tried to link an optimisation tool (packaged as a FastAPI Microservice) to an Agentic Workflow.

My initial attempt was to create a Production Planning Optimisation Agent.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Production Planning Agent — (Image by Samir Saci)

Like here, I packaged an optimisation algorithm in a FastAPI Microservice that I wanted to connect to an email workflow.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Production Planning FastAPI Microservices — (Image by Samir Saci)

Unlike here, the Agentic part of the workflow was handled in n8n with two Agent nodes.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Workflow — (Image by Samir Saci)

The results were quite satisfying, as shown in the short video linked below.

The user experience was very smooth.

However, maintenance proved challenging for the team.

This is why we wanted to explore using Python and TypeScript frameworks for the agentic workflow, as shown here.

What’s next? Agentic Approach of Business Planning

At our startup, LogiGreen, we are attempting (through experiments like this one) to extend beyond supply chain optimisation and encompass business decision-making.

On my roadmap, I have a tool that I have developed to help small and medium-sized company optimise their cash flow.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n

In another article published in Towards Data Science, I have introduced how I used Python to simulate the financial flows of a company selling renewable paper cups to coffee shops.

“We have to refuse orders as we don’t have enough cash to pay suppliers for stock replenishment.”

A close friend, who owns a small business, was complaining about cash flow issues limiting the development of his company.

I started by tackling the problem of inventory management with an optimised built-in solution using Python.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Inventory Management Rule — (Image by Samir Saci)

Then I enriched the model considering sales channel strategy, payment terms and many other strategic business parameters to help him find the optimal business plan to maximise profitability.

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
Example of scenarios generated — (Image by Samir Saci)

This solution is the next candidate in our experimentation with using agentic workflows to support business and operational decision-making.

For more information, you can view this brief presentation of the tool.

Currently, it is packaged in a FastAPI microservice connected to a React frontend (and streamlit for the public demo).

Build an AI Agent for Strategic Budget Planning with LangGraph and n8n
UI of the tool available in LogiGreen Apps — (Image by Samir Saci)

I would like to implement an AI workflow that would

  1. Take multiple scenarios (like the ones presented in the video)
  2. Call the API for each scenario
  3. Collect and process the results
  4. Provide a comparative analysis to recommend the best decision

Basically, I would like to outsource to a single (or multiple agents) the complete study presented in the article and the video.

For that, we are exploring multiple approaches to agent orchestration.

We will share our findings in a future article. Stay tuned!

About Me

Let’s connect on LinkedIn and Twitter. I am a Supply Chain Engineer who uses data analytics to improve logistics operations and reduce costs.

For consulting or advice on analytics and sustainable supply chain transformation, feel free to contact me via Logigreen Consulting.

]]>
<![CDATA[How I Deployed an AI Agent for Sustainable Supply Chain Optimisation]]>https://www.samirsaci.com/how-i-deployed-an-ai-agent-for-sustainable-supply-chain-optimisation/69109556ce084b00015411e1Mon, 22 Sep 2025 13:21:00 GMT

Could you imagine an AI agent replacing an army of consultants to help a company redesign its entire supply chain for more cost-efficient and sustainable operations?

Spoiler Alert: We are not yet here!

But for the first time since I discovered LLMs, I have been amazed (and worried at the same time) by the capacity of an AI agent that I deployed.

Supply Chain Network Optimisation determines where goods are produced to serve markets at the lowest cost in an environmentally friendly way.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Examples of network design with different objectives — (Image by Samir Saci)

For this difficult exercise, we must consider real-world constraints (capacity, demand) to find the optimal set of factories that will minimise the objective function.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Example of environmental constraints of maximum impact per unit produced — (Image by Samir Saci)

As a Supply Chain Solution Manager and founder of the startup Logigreen, I have led multiple network design studies that typically took 10–12 weeks.

The final deliverable was usually a deck of slides presenting multiple scenarios, allowing supply chain directors to weigh the trade-offs.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Example of Network Designs with different constraints — (Image by Samir Saci)

But decision-makers were often frustrated during the presentations of the study results:

Supply Chain Director: “What if we increase the factory capacity by 25%?”

They wanted to challenge assumptions and re-run scenarios live, while all we had were the slides we had taken hours to prepare.

My co-founder asked me: “What if we could improve this user experience using conversational agents?”

In this article, I will share with you an initial experiment I conducted a few days after the MCP servers were available for Claude Desktop.

I will demonstrate how to connect an MCP server to a FastAPI microservice utilising a Supply Chain Network Optimisation algorithm.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Example of a request to Claude Desktop connected to an MCP Server calling our FastAPI microservice — Image by Samir Saci

The result is a conversational agent that can run one or multiple scenarios and provide a detailed analysis with smart visuals.

We will even ask this agent to advise us on the best decision to take, considering our goals and the constraints.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Example of strategic recommendations provided by the agent — (Image by Samir Saci)

For this experiment, I used:

  • Claude Desktop as the conversational interface
  • MCP Server to expose typed tools to the agent
  • FastAPI microservice with the network optimisation endpoint

In the first section, I will introduce the problem of Supply Chain Network design with a concrete example.

You can skip it if you are not interested in the topic.

Then, I will show multiple deep analyses performed by the conversational agent to support strategic decision-making.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Example of advanced visuals generated by the agent to answer an open question — (Image by Samir Saci)

For the first time, I have been impressed by AI when the agent selected the correct visuals to answer an open question without any guidance!

My objective is to inspire you to experiment with the connection between MCP servers and advanced analytics products.

I am genuinely excited by the capabilities of this technology.

Supply Chain Network Optimisation with Python

Problem Statement: Supply Chain Network Design

For the context, let us put ourselves in the shoes of a Supply Chain solution manager.

We are supporting the Supply Chain Director of an international manufacturing company that aims to redefine its network as part of a long-term transformation plan.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Supply Chain Network Design Problem — (Image by Samir Saci)

This multinational company has operations in 5 different markets: Brazil, the USA, Germany, India and Japan.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Example of demand per market — (Image by Samir Saci)

To meet this demand, we can open low or high-capacity factories in each of the markets.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Capacities per factory type and location — (Image by Samir Saci)

If you open a facility, you must consider the fixed costs (associated with electricity, Real Estate, and CAPEX) and the variable costs per unit produced.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Example of fixed and variable costs per production country — (Image by Samir Saci)

In this example, high-capacity plants in India have lower fixed costs than those in the USA with lower capacity.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Example of freight costs per container — (Image by Samir Saci)

Additionally, there are the costs associated with shipping a container from Country XXX to Country YYY.

Everything summed up will define the total cost of producing and delivering products from a manufacturing site to the different markets.

What about sustainability?

In addition to these parameters, we consider the amount of resources consumed per unit produced.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Example of energy and water usage per unit produced in each country — (Image by Samir Saci)

For instance, we consume 780 MJ/Unit of energy and 3,500 litres of water to produce a single unit in Indian factories.

You start to understand the complexity of the exercise.

For the environmental impacts, we also consider the pollution resulting from CO2 emissions and waste generation.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Environmental impact per unit produced for each country — (Image by Samir Saci)

In the example above, Japan is the cleanest production country.

Where should we produce to minimize water usage?

The idea is to select a metric to minimise, which could be costs, water usage, CO2 emissions or energy usage.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Example of the output in the LogiGreen App — (Image by Samir Saci)

The model will indicate where to locate factories and outline the flows from these factories to the various markets.

This solution has been packaged as a web application (FastAPI backend, Streamlit front-end) used as a demo to showcase the capabilities of our startup LogiGreen.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
User interface of the LogiGreen App (Sustainability Module) — Image by Samir Saci

The idea of today’s experiment is to connect the backend with Claude Desktop using a local MCP server built with Python.

FastAPI Microservice: 0–1 Mixed-Integer Optimiser for Supply Chain Network Design

This tool is an optimisation model packaged in a FastAPI microservice.

What are the input data for this problem?

As inputs, we should provide the objective function (mandatory) and constraints of maximum environmental impact per unit produced (optional).

The default values for the thresholds are stored in a config file.

We send these parameters to a specific endpoint launch_network that will run the optimisation algorithm.

The API returns the JSON outputs in two parts.

In the section input_params, you can find

  • The objective function selected
  • All the maximum limits per environmental impact

I also added information to bring context to the agent:

  • plant_name is a list of all the potential manufacturing locations we can open by location and type
  • prod_name is the list of all the potential production flows we can have (production, market)
  • total_demand of all the markets

We don’t return the demand per market as it is loaded on the backend side.

And you have the results of the analysis.

They include:

  • plant_opening: a list of boolean values set to 1 if a site is open
    Three sites open for this scenario: 1 low-capacity plant in India and three high-capacity plants in India, Japan, and Brazil.
  • flow_volumes: mapping of the flow between countries
    Brazil will produce 12,500 units for the USA
  • Overall volumes with local_prod, export_prod and the total_prod
  • A cost breakdown with total_fixedcosts, total_varcosts and total_costs along with an analysis of the COGS
  • Environmental impacts per unit delivered with resource usage (Energy, Water) and pollution (CO2, waste).

This network design can be visually represented with this Sankey chart.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Sankey Chart generated by the LogiGreen App for the scenario ‘Production Cost’ — (Image by Samir Saci)

Let us see what our conversational agent can do with that!

For a detailed demo, you can have a look at the YouTube version:

Building a local MCP Server to connect Claude Desktop to a FastAPI Microservice

This follows a series of articles in which I experimented with connecting FastAPI microservices to AI agents for a Production Planning tool and a Budget Optimiser.

For this time, I wanted to replicate the experiment with Anthropic’s Claude Desktop.

Set up a local MCP Server in WSL

I will run everything inside WSL (Ubuntu) and let the Claude Desktop (Windows) communicate with my MCP server via a small JSON configuration.

The first step was to install uv package manager:

uv (Python package manager) inside WSL

We can now use it to initiate a project with a local environment:

This will be used by our `network.py` file that will contain our server setup:

This will ensure that the agent sends the correct queries to the FastAPI microservice.

Before starting to build the functionalities of our MCP Server, we need to ensure that the Claude Desktop (Windows) can find network.py.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Add functions among others that we are going to build together — (Image by Samir Saci)

As I am using WSL, I could only do it manually using the Claude Desktop config JSON file:

  1. Open Claude Desktop → Settings → Developer → Edit Config (or open the config file directly).
  2. Add an entry that starts your MCP server in WSL

With this config file, we instruct Claude Desktop to run WSL in the folder mcp_tuto and use uv to run mpc[cli] launching budget.py.

If you are in this special case of building your MCP server in a Windows machine using WSL, you can follow this approach.

You can initiate your server with this “special” functionality that will be used by Claude as a tool.

We inform Claude (in the docstring) that this addition is intended for Supply Chain Professionals only.

If you restart Claude Desktop, you should be able to see this functionality under Network.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Tab with tools available — (Image by Samir Saci)

You can find our “special addition”, called Add, which is now waiting for us to be used!

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Add functions among others that we are going to build together — (Image by Samir Saci)

Let’s test now with a simple question.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Example of request expecting an output using the special function — (Image by Samir Saci)

We can see that the conversational agent is calling the correct function based on the context provided in the question.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Comment of the output — (Image by Samir Saci)

It even provides a nice comment interrogating the validity of the results.

What if we complexify a bit the exercise?

I will create a hypothetical scenario to determine if the conversational agent can associate a context with the use of a tool.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Context with two characters / Samir is a Supply Chain Professional — (Image by Samir Saci)

Let us see what happens when we ask a question requiring the use of addition.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Example of a tool calling based on a “complex” context — (Image by Samir Saci)

Even if it was reluctantly, the agent had the reflex of using the special add tool for Samir, as he is a supply chain professional.

Now that we are familiar with our new MCP server, we can start adding tools for Supply Chain Network Optimisation.

Build a Supply Chain Optimisation MCP Server connected to a FastAPI Microservice

We can get rid of the special add tool and start introducing key parameters to connect to the FastAPI microservice.

The variable last_run will be used to store the results of the last run.

We need to create a tool that can connect to the FastAPI microservice.

For that, we introduced the function below.

This function takes parameters following the Pydantic model LaunchParamsNetwork, sending a clean JSON payload with None fields dropped.

It calls the FastAPI endpoint asynchronously and collects the results that are cached in last_run.

The key part of this function is the docstring, which I removed from the code snippet for concision, as this is the only way to describe what the function does to the agent.

Section 1: Context

The first section is only to introduce the context in which the tool is used.

Section 2: Describe Input Data

This brief description is crucial if we want to be sure that the agent adheres to the Pydantic schema of input parameters imposed by our FastAPI microservice.

Section 3: Description of output results

This part describes to the agent the outputs it will receive.

I did not want to only count on “self-explicit” naming of variables in the JSON.

I want to ensure that it understands the data it has on hand and can provide summaries in accordance with the guidelines listed below.

I share a list of potential scenarios and explanations of the type of analysis I expect using an actual example.

This is far from being concise, but my objective here is to ensure that the agent is equipped to use the tool at its highest potential.

Experiment with the tool: from simple to complex instructions

To test the workflow, I ask the agent to run the simulation with default parameters.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Sample of analysis provided by the conversation agent — (Image by Samir Saci)

As expected, the agent calls the FastAPI microservice, collects the results, and concisely summarises them.

This is cool, but I already had that with my Production Planning Optimisation Agent built with LangGraph and FastAPI.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Example of output analysis of the Production Planning Optimisation Agent — (Image by Samir Saci)

I wanted to explore MCP Servers with Claude Desktop for a more advanced usage.

Supply Chain Director: “I want to have a comparative study of multiple scenario.”

If we come back to the original plan, the idea was to equip our decision-makers (customers who pay us) with a conversational agent that would assist them in their decision-making process.

Let us try a more advanced question:

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Here we provide more open questions that reflect the needs of our customers — (Image by Samir Saci)

We explicitly request a comparative study while allowing Claude Sonnet 4 to be creative in terms of visual rendering.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Claude Agent sharing its plan — (Image by Samir Saci)

To be honest, I was impressed by the dashboard that was generated by Claude, which you can access via this link.

At the top, you can find an executive summary listing what can be considered the most important indicators of this problem.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Executive Summary generated by Claude — (Image by Samir Saci)

The model understood, without being explicitly asked in the prompt, that these four indicators were key to the decision-making process resulting from this study.

At this stage, in my opinion, we already get the added value of incorporating an LLM into the loop.

The following outputs are more conventional and could have been generated with deterministic code.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Financial and Environmental Metrics Summary Table — (Image by Samir Saci)

However, I admit that the creativity of Claude outperformed my own web application with this smart visual showing the plant openings per scenario.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Plant open per scenario — (Image by Samir Saci)

While I was starting to worry about getting replaced by AI, I had a look at the strategic analysis generated by the agent.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Example of trade-off analysis — (Image by Samir Saci)

The approach of comparing each scenario vs a baseline of cost optimisation has never been explicitly requested.

The agent took the initiative to bring up this angle when presenting results.

This demonstrated the ability to select the appropriate indicators to convey a message effectively using data.

Can we ask open questions?

Let me explore that in the next section.

A Conversation Agent capable of decision-making?

To further explore the capabilities of our new tool and test its potential, I will pose open-ended questions.

Question 1: Trade-off between cost and sustainability

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Question 1 — (Image by Samir Saci)

This is the type of question I got when I was in charge of network studies.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Executive Summary — Image by Samir Saci

This appeared to be a recommendation to adopt the Water-optimised strategy to find the perfect balance.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Visuals — (Image by Samir Saci)

It used compelling visuals to support its idea.

I really like the cost vs. environmental impact scatter plot!

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Implementation Plan — (Image by Samir Saci)

Unlike some strategy consulting firms, it did not forget the implementation part.

For more details, you can access the complete dashboard at this link.

Let’s try another tricky question.

Question 2: Best CO2 Emissions Performance

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
What is the best performance for indicator XXX under budget limits — (Image by Samir Saci)

This is a challenging question that required seven runs to answer.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
7 runs to answer the question — (Image by Samir Saci)

This was enough to provide the question with the correct solution.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Optimal Solution — (Image by Samir Saci)

What I appreciate the most is the quality of the visuals used to support its reasoning.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Example of visual used — (Image by Samir Saci)

In the visual above, we can see the different scenarios simulated by the tool.

Although we could question the wrong orientation of the (x-axis), the visual remains self-explicit.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Strategic Recommendation — (Image by Samir Saci)

Where I feel beaten by the LLM is when we look at the quality and concision of the strategic recommendations.

Considering that these recommendations serve as the primary point of contact with decision-makers, who often lack the time to delve into details, this remains a strong argument in favour of using this agent.

Conclusion

💡
If you have any question, feel free to ask it here: Ask a Question

This experiment is a success!

There is no doubt about the added value of MCP Servers compared to the simple AI workflows introduced in the previous articles.

When you have an optimisation module with multiple scenarios (depending on objective functions and constraints), you can leverage MCP servers to enable agents to make decisions based on data.

I would apply this solution to algorithms like

These are opportunities to equip your entire supply chain with conversation agents (connected to optimisation tools) that can support decision-making.

Can we go beyond operational topics?

The reasoning capacity that Claude showcased in this experiment also inspired me to explore business topics.

A solution presented in one of my YouTube tutorials could be a good candidate for our next MCP integration.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Value chain of the example used in the video — (Image by Samir Saci)

The goal was to support a friend who runs a business in the food and beverage industry.

They sell renewable cups produced in China to coffee shops and bars in Paris.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Value Chain of this business — (Image by Samir Saci)

I wanted to use Python to simulate its entire value chain to identify optimisation levers to maximise its profitability.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Business Planning with Python — Inventory and Cash Flow Management (Image by Samir Saci)

This algorithm, also packaged in a FastAPI microservice, can become your next data-driven business strategy consultant.

How I Deployed an AI Agent for Sustainable Supply Chain Optimisation
Simulation of scenarios to find the optimal setup to maximise profitability — (Image by Samir Saci)

Part of the job involves simulating multiple scenarios to determine the optimal trade-off between several metrics.

I clearly see a conversational agent powered by an MCP server doing the job perfectly.

For more information, have a look at the video linked below

I will share this new experiment in a future article.

Stay tuned!

About Me

Let’s connect on Linkedin and Twitter. I am a Supply Chain Engineer who uses data analytics to improve logistics operations and reduce costs.

For consulting or advice on analytics and sustainable supply chain transformation, feel free to contact me via Logigreen Consulting.

If you are interested in Data Analytics and Supply Chain, look at my website.

]]>