Stock levels do not drop below the critical threshold without a response
What it does
The AI agent continuously reads inventory data from the data warehouse, compares the current level against the target, and notifies the responsible parties before a shortage occurs. Unlike a manual Excel export once a week, the system runs continuously: each critical SKU is checked on a schedule, and the alert arrives at the moment when there is still time to react. The specific set of steps is configured to match the company's processes — below is a typical scenario for manufacturing and retail.
What automation does
- Pulls inventory data from the data warehouse or BI layer at a set frequency — from 15 minutes to once per day depending on SKU criticality.
- Normalizes SKUs, warehouses, and units of measurement — brings data into a unified reference structure so that metrics are comparable across locations.
- Calculates a consumption forecast for the planning horizon for each item, taking into account historical demand, seasonality, and open orders in the system.
- Compares the current inventory level against the minimum acceptable level (safety stock) and the projected depletion point.
- Identifies which items require action: currently below the critical level or projected to breach it within the planning horizon.
- Sends structured alerts to Slack, Telegram, or email with the SKU, warehouse, current inventory level, forecast, and responsible person.
- Logs events — for audit, incident review, and retrospective analysis of forecast accuracy.
- Generates a periodic inventory digest for the department manager — without the need to manually compile a report.
What automation does NOT do
- Does not place orders with suppliers automatically. The procurement trigger remains with the buyer or manager — the system prepares the decision, not makes it.
- Does not replace ERP and does not track movements. Operates on top of existing accounting systems as an analytical layer, not as a source of truth.
- Does not guarantee forecast accuracy with unstable data. If the sales history contains gaps, duplicates, or unlabeled promotions, the AI agent will make errors — and this is an honest limit of the method.
How it works
The automation is built as a custom-code solution on top of the company's existing data warehouse or BI layer. The AI agent acts as an orchestrator: reads sources, runs the forecasting module, applies business rules, and passes the result to the notification channel. Everything related to movement accounting stays in the ERP — the system does not duplicate its functions.
Data flow
- Data warehouse connector: the AI agent accesses the inventory and sales history data mart via SQL connection or BI API.
- Normalization layer: reconciles SKU, warehouse, and unit-of-measure reference tables. If the company has multiple accounting systems, this layer brings them to a unified format.
- Forecasting module: calculates expected consumption per SKU over the planning horizon. The method depends on demand stability — from a moving average to an ML model with seasonal components.
- Control rules: business rules are applied at the forecast output — minimum safety stock, supplier replenishment lead time, SKU priority.
- Notification engine: generated alerts are sent to Slack or Telegram (the Communications channel) with routing rules — which SKU group goes to which responsible party.
- Logging layer: every event, every alert, every forecast change is written to a separate storage for post-factum review.
How the implementation is structured
- Audit data sources: where inventory is stored, where sales history is, with what delay they are updated, and what the quality of the reference tables is.
- Collect business rules on safety stock and SKU priorities — with the procurement specialist and operations manager.
- Select the forecasting method by SKU group: a moving average is sufficient for stable demand, seasonal items require a separate model.
- Implement the data warehouse connector and normalization layer, verify the reproducibility of calculations on historical data.
- Set up the notification engine with a test channel and validate the alert format with end recipients — text, frequency, grouping.
- Run a parallel launch (shadow run) for 2-4 weeks: the system generates alerts, but the response remains manual — this provides material for calibration.
- Switch to live mode, introduce an SLA on response time, and start collecting metrics on forecast accuracy and missed stockouts.
Solution components
Layer | Purpose | Foundation |
|---|---|---|
Data source | Inventory, sales, open orders | Data warehouse, BI layer |
AI agent | Orchestration, forecasting, business rules | Custom-code |
Notification channel | Alert and digest delivery | Slack, Telegram, email |
Logging | Audit and retrospective | Separate event storage |
The custom-code approach is not a coincidence: standard low-code platforms handle non-standard accounting logic poorly — multi-level warehouses, internal transfers, consignment. For companies with a straightforward structure, a lighter assembly is possible; for manufacturers and retailers with multiple accounting sources, custom-code pays off.
Prerequisites
Automation requires a stable data source and a manageable warehouse hierarchy. Below is what must be ready on the company's side before the implementation begins.
Data and Access
- A data warehouse or BI layer with a stock data mart by SKU and warehouse, updated at least once per day.
- Sales or consumption history of at least 6-12 months — without this, the forecasting module will not be able to calibrate.
- A unified SKU reference or defined mapping rules between record-keeping systems, if there are multiple.
- Read-only access to sources via SQL, BI API, or scheduled export.
- A notifications channel on the Communications side — a ready Slack or Telegram workspace with bot permissions.
Team Readiness
- An operations owner — a procurement manager or department head who defines safety stock and SKU priorities.
- A data engineer or analyst with access to the data warehouse — at least during the implementation phase.
- A procurement process owner who approves the SLA for alert response.
Implementation Timeline
For a standard project with one data warehouse and one notification channel, the timeline from start to production launch is 6-10 weeks. Of these, 1-2 weeks go to data audit, 2-4 weeks to connector implementation, the forecasting module and rules, and 2-4 weeks to shadow run and calibration. Companies with multiple heterogeneous record-keeping systems or complex warehouse structures exceed these timelines — in such cases, the implementation is discussed separately.
Pain points
- Poor Forecasting (cashflow/sales/stock)
- Errors in Manual Operations
FAQ
How long does implementation take?
A typical project for a company with one data warehouse and one alerting channel fits within 6–10 weeks. The first 1–2 weeks cover an audit of data sources and business rules. The next 2–4 weeks cover connector implementation, the forecasting module, and the notification engine. The remaining 2–4 weeks are a shadow run in parallel with the current process to calibrate thresholds and alert formats before go-live.
What if we don't have a data warehouse?
The AI agent does not require a full data warehouse — a stable source with stock levels and sales history is sufficient. This can be an ERP export into a separate database, a BI tool with an API, or a regular SQL snapshot. If no data source exists at all, building a data mart becomes the first implementation step — this adds 2–4 weeks to the timeline.
What are the risks of this solution?
There are two main risks. The first is poor historical data quality: gaps, duplicates, and unaccounted promotions make the forecast unreliable, and the solution takes longer to calibrate. The second is alert fatigue: if there are too many thresholds or they are too sensitive, the team stops responding to notifications. Both risks are mitigated by a shadow run and rule tuning based on real data.
Is this suitable for our industry?
The solution is designed for Manufacturing and E-commerce / Retail — where SKU tracking, warehouse hierarchy, and measurable demand are present. For manufacturing, raw materials and components with long lead times are critical; for retail, fast-moving items with seasonality. In industries without discrete SKU tracking (for example, services), the approach does not apply directly — a different resource control model is needed.
Why is a custom-code approach better than a ready-made inventory platform?
Custom code wins where the company's warehouse and product logic does not fit a vendor template: multiple accounting systems, internal transfers, consignment, specific safety stock rules. A ready-made platform starts faster but forces processes to adapt to it. For companies with straightforward accounting, it makes more sense to start with a ready-made solution and bring in custom code when hitting its limitations.
How accurate is the forecast?
Accuracy depends on demand stability and historical data quality. For items with steady demand and clean history, simple methods (moving average, exponential smoothing) produce acceptable results. Seasonal and promotional items require a separate model. The practical KPI is not absolute accuracy but the number of missed stockouts and excess alerts compared to the current manual process.
Want this in your business?
Book a free audit — we'll show how this automation will work for you.