A retailer loses up to 20% of revenue due to stockout and 10% due to excess inventory. Inventory optimization is a key task for an AI system. Out-of-the-box ERP modules struggle with non-linear demand, seasonality, and promotions. A McKinsey study notes that AI in retail reduces operational costs by 20–30%. We build custom AI systems that cut forecast error to 15% and increase margin by 3–5%.
Why retail needs its own AI system
Standard SAP or Oracle do not account for assortment specifics, local holidays, or behavioral patterns. An AI system for a store adapts to your business: from hierarchical forecasting to real-time ranking of recommendations. The result: fewer write-offs, higher customer loyalty. Forecast accuracy reaches 85%, and stockout drops by 30%.
What is better: custom ML system or SaaS solutions?
SaaS (Relex, Blue Yonder) offer boxed solutions, but they lack flexibility. Custom development pays off in 6–12 months due to 20–30% higher forecast accuracy (custom system achieves 85% vs. 60–70% for typical ERP) and the ability to quickly change models for new tasks. That's 1.5 times more accurate. You get full control over features and integration with any data sources. Additionally, we implement dynamic pricing (price optimization) and customer segmentation.
How we forecast demand
We use hierarchical forecasting based on LightGBM — the approach that won the Walmart M5 Competition. For each SKU × store, we build time series with lags, rolling statistics, and causal features (promotions, holidays, weather). Example model:
import lightgbm as lgb
from sklearn.model_selection import TimeSeriesSplit
# M5-style features
features = [
'lag_7', 'lag_14', 'lag_28', # Lags
'rolling_mean_7', 'rolling_std_7', # Rolling statistics
'rolling_mean_28', 'rolling_std_28',
'month', 'day_of_week', 'is_weekend', # Temporal features
'holiday_flag', 'is_promo', # Causal features
'store_id', 'dept_id', 'category_id', # Hierarchical features
'price', 'price_change_ratio', # Price features
'snap_flag', # Government subsidies (USA)
]
We output not only a point forecast but also uncertainty intervals — this allows calculating safety stock without overfitting. Models are retrained weekly with new data, and drift is monitored via MLflow. Inference latency does not exceed 50 ms (p99).
How to personalize recommendations?
We build a two-level system: retrieval (Candidate Generation) via a Two-Tower neural network and ranking with LightGBM. Metrics: CTR, Conversion Rate, Revenue per visit. This yields a 15–25% sales lift compared to collaborative filtering. Additionally, we implement visual product search for image-based search.
Development stages of an AI system for retail
- Analytics: data audit, priority use cases (demand forecasting, pricing, recommendations).
- Design: ML pipeline architecture for retail, Feature Store, serving layer.
- Development: model training and validation, A/B testing.
- Deployment: containerization, monitoring, CI/CD for models.
- Support: data drift monitoring, model retraining.
What is included in the result?
- Trained models with documentation (model card, fairness metrics).
- Feature Store for reusable features.
- Inference endpoint with p99 latency < 50 ms.
- Integration with POS, ERP, CRM.
- Training of your team.
Comparison of custom AI system vs. SaaS solutions
| Parameter | Custom AI System | SaaS Solution (Relex, Blue Yonder) |
|---|---|---|
| Forecast accuracy | 85% and above | 60–70% |
| Flexibility | Full customization to business logic | Limited configurations |
| Payback period | 6–12 months | 12–24 months |
| Integration with legacy | Deep customization | Via standard APIs |
| Data ownership | Full | Partial |
Technical stack
| Component | Technologies |
|---|---|
| Data Warehouse | Snowflake / BigQuery |
| Feature Store | Feast |
| ML Platform | MLflow + Kubeflow Pipelines |
| Serving | SageMaker / KServe |
| A/B Testing | Optimizely / in-house |
| Real-time | Kafka → Flink → Redis |
Common mistakes in retail AI implementation
- Using only historical data without external factors (weather, macroeconomics).
- Ignoring data drift: model degrades without retriever monitoring.
- Overly complex models that fail in production due to latency.
- No Feature Store: engineers spend 70% of time on data preparation.
Timeline and cost
Timelines start from 6 months for the first production release. We estimate the project individually — contact us to select the optimal implementation scope. Average logistics cost savings after implementation are 15%, and revenue growth from personalization reaches up to 10%.
Our experience: over 5 years in ML for retail, certified architects of leading clouds. Book a consultation to discuss your task. Get a consultation — we will choose the optimal ML architecture for your business.







