The forecasting problem in e-commerce
Most e-commerce businesses at growth stage are managing inventory with a combination of spreadsheets, intuition, and last year's data. With hundreds or thousands of SKUs across multiple warehouses, the margin of error is large and the consequences are real: dead stock ties up working capital; stockouts on hero products drive customer churn.
Off-the-shelf demand planning tools are built for large enterprises with dedicated supply chain teams. They are expensive, take months to implement, and rarely integrate cleanly with modern e-commerce platforms. The alternative — building something purpose-fit — is exactly where custom engineering earns its cost.
Key pain points
- ✕Manual reorder calculations that cannot keep pace with SKU count growth
- ✕No ability to account for marketing campaign spikes or influencer-driven demand
- ✕Dead stock and emergency restocking inflating 3PL costs
- ✕No visibility into forecast accuracy or model drift over time
- ✕Spreadsheet-based workflows collapsing under operational complexity
A purpose-built forecasting engine, not a generic tool
The reference architecture uses a Prophet + XGBoost ensemble for core demand forecasting. Prophet handles seasonality and trend well; XGBoost captures non-linear relationships across promotion data, pricing changes, and product attributes. An ensemble of both reduces mean absolute percentage error (MAPE) significantly over either model alone — in our validation testing, from approximately 18% to approximately 9% on held-out data.
A lightweight LLM layer sits outside the core forecasting loop and serves a single purpose: translating statistical anomalies into plain-English explanations for operations teams. The critical forecasting path stays fully deterministic; the LLM is used only for communication, not prediction. This distinction matters — it keeps the system auditable and prevents confabulation from affecting reorder decisions.
The pipeline integrates with Shopify's Orders and Inventory APIs for sales signal ingestion, and connects to 3PL APIs for warehouse stock levels. The forecasting dashboard is built in Next.js and delivers weekly reorder recommendations with confidence intervals, lead-time buffers, and written rationale for each adjustment.
Technology stack
ML / AI
Infrastructure
Integrations
Frontend
Key engineering decisions
Ensemble over single model
We tested Prophet alone, XGBoost alone, and an ensemble. The ensemble reduced MAPE from approximately 18% to approximately 9% on held-out test data — worth the added complexity.
LLM for anomaly narration, not prediction
LLMs are deliberately kept out of the core forecasting loop. Their role is to translate statistical anomalies into plain English for non-technical operations staff. This keeps the critical path deterministic and the system fully auditable.
Incremental rollout alongside existing process
For organisations replacing manual processes, we recommend running AI recommendations alongside existing workflows for 4–6 weeks with no mandate to act on them. This builds trust with the operations team before full adoption.
Why this architecture
This architecture is our validated starting point for demand forecasting engagements. The tech stack and model choices are well-tested; what varies per project is data quality, SKU complexity, and integration surface area. If you're evaluating whether to build this, we offer a two-week discovery sprint that assesses your data readiness and produces a concrete build vs. buy recommendation.
A note on our approach
Demand forecasting is one of the clearest AI ROI stories in e-commerce — the problem is well-defined, the data is usually already there, and the cost of getting it wrong is measurable. This architecture is our reference design, not a sold project. We are actively looking for our first client in this space.
Interested in building this?
Every engagement starts with a two-week discovery sprint. We assess your requirements, existing stack, and data readiness — then give you a concrete build plan and cost estimate.
Book a discovery callMore engineering work

