Demand Forecasting Agent
An autonomous supply chain planner that predicts future product demand and automatically generates purchase orders to prevent stockouts — without tying up capital in excess inventory.
The Challenge
Inventory planning is a constant balancing act with asymmetric penalties on both sides. Over-order and you tie up working capital in slow-moving stock — the average retailer holds 20–30% excess inventory at any given time. Under-order and you lose sales: a stockout on a bestseller during peak season can cost a business its entire margin for the quarter. Manual spreadsheet planning fails here because it can't model seasonality, growth trends, and supplier lead times simultaneously — and it can't react to new sales data fast enough to matter.
The Solution
This agent combines a trained time-series ML model with an autonomous supply chain planner skill. The forecasting model ingests historical daily sales data and projects demand for the next 30 days, accounting for seasonality and growth trajectory. That forecast feeds directly into the planner: when projected demand minus current stock minus safety buffer goes negative, the agent drafts a purchase order with the exact reorder quantity — ready for a buyer to approve with one click.
Key Capabilities
-
📈 30-Day ML
Forecast
HistGradientBoostingRegressor(R² ~0.98) predicts daily unit sales for each SKU — capturing weekly seasonality, long-term growth trends, and promotional spikes in the training data. - 📦 Dynamic Safety Stock Automatically calculates the required buffer inventory for each SKU based on supplier lead time and the volatility of predicted demand — so high-variance products carry proportionally larger buffers.
- 🛒 Autonomous Purchase Orders When inventory crosses the reorder threshold, the Purchasing Agent skill drafts a complete PO with supplier details, SKU quantities, and expected delivery dates — no manual calculation required.
- 📊 Forecast Visualization Interactive time-series charts show historical sales alongside the 30-day projected demand curve — with confidence bands so buyers can see forecast uncertainty before approving orders.
- ⚠️ Stockout Risk Alerts Products projected to stock out within the supplier lead time are flagged at the top of the dashboard with days-to-stockout countdown — prioritizing the most urgent reorders automatically.
Tech Stack
- Scikit-Learn (Gradient Boosting)
- Pandas Time-Series
- Streamlit
- Anthropic Claude API
- Docker / Cloud Run
Patterns Used:
Business Value
A single stockout on a high-velocity SKU during peak season can cost more than an entire month of inventory carrying costs. Better forecasting reduces both stockout frequency and excess inventory simultaneously — freeing working capital while protecting revenue.
Who this is built for
Any business with physical inventory and more than a handful of SKUs — where a surprise stockout or an overstuffed warehouse has real dollar consequences.
Try it live
Select a product SKU from the sidebar to see the 30-day demand forecast. If inventory is running low, click "Generate Purchase Order" to watch the agent draft a complete PO. No login required.
Launch Live Demo →Never run out of your bestseller again
The demo above is the real tool. If you want this connected to your actual inventory data and supplier list — with automatic reorder alerts — let's build it for your business.