How to Analyze Inventory Using AI
Review ABC classes, compare period-end stock with historical COGS, and inspect turnover and days of supply using the metrics modeled in Cube.
- Set the value basis and class cutoffs
- Compare stock and COGS by class
- Check turnover and days of supply
What is ABC inventory analysis with AI?
ABC inventory analysis ranks stock keeping units (SKUs) by a chosen value measure over a fixed period, then groups them by cumulative share. The measure and cutoffs are business rules; this example uses 12-month COGS and illustrative 80/15/5 boundaries.
Cube is the semantic layer for AI. It gives people and AI agents permission-aware access to modeled COGS and inventory measures, so each calculation follows definitions your team controls. This workflow reviews historical values; it does not forecast demand, set replenishment policy, or explain why stock moved.
Define the inventory window and value basis
Set one period, valuation, and SKU grain before classifying inventory. These examples use month-end stock snapshots and a 365-day year; use the definitions in your Cube model for a live review.
| Metric | Illustrative example |
|---|---|
| SKU grain and scope | 30 fictional SKUs; one SKU-location row per snapshot, with warehouse filters stated. |
| ABC value basis and cutoffs | 12-month COGS totals $1,000,000; A through 80%, B through 95%, C for the remaining 5%. |
| Average inventory value | Mean of 12 month-end inventory-value snapshots: $175,000 total. |
| Ending inventory value | Sep 30, 2026 stock value: $180,000 total. |
| Inventory turnover | $1,000,000 COGS ÷ $175,000 average inventory = 5.7× overall. |
| Value-based days of supply | $180,000 ending stock ÷ ($1,000,000 ÷ 365) = 66 days overall. |
Copy. Paste. Run your inventory review.
Connect to Cube via MCP or our CLI, then run the prompt below in your preferred agent.
Start with a Cube deployment connected to your data and a model containing the metrics you want to analyze.
Connect over MCP
Connect your agent to your existing Cube deployment and sign in through OAuth.
https://cubecloud.dev/mcp
Complete OAuth in your agent to connect your Cube account.
Use your default deployment or select another one available to your account.
Connect with CLI
Install the Cube CLI and sign in from a terminal-capable agent.
curl -fsSL https://raw.githubusercontent.com/cube-js/cube/master/install-cli.sh | sh
cube login --url https://TENANT.cubecloud.dev
cube spec --json
02Run this prompt in your agent
Choose your agent and copy the prompt below.
Use the Cube MCP server connected in Codex and select the intended deployment. Run read-only analytics queries. Run a read-only inventory review using my connected Cube deployment.Keep credentials and product or supplier identifiers private. Do not write to tables, models, or deployments. DEFINITIONSInspect the model and report the approved SKU and SKU-location grain,currency and units, reporting time zone, stock snapshot cadence, datecoverage, and definitions for COGS, average inventory, ending inventory,the ABC value basis and thresholds, inventory turnover, and days of supply.Use governed metrics and access rules. If a definition, date, unit conversion,or required input is missing or conflicts, identify the gap and do not inventa measure, class, or result. ANALYSIS1. Use the latest 12 complete calendar months. State the inclusive start and end dates and exclude any incomplete current month.2. Classify SKUs using the approved value basis and cutoffs. Rank by the approved value measure. For each eligible SKU, calculate contribution share as its value divided by the total value for all eligible SKUs, then calculate the running cumulative share in descending order. Apply the documented boundary and tie rule, and report class counts, value totals, and share of total. Exclude or separately flag missing and duplicate SKU keys.3. For each class and overall, show 12-month COGS, average inventory value, and turnover. Use the governed turnover measure; otherwise compute 12-month COGS divided by average inventory over the same window. State how average inventory was calculated. Do not average class turnover ratios to create the overall rate.4. At the end of the same window, report ending inventory value and days of supply by class and overall. Use the governed definition. If the agreed measure is value-based, calculate ending inventory value divided by (period COGS divided by calendar days in the window). If it is unit-based, report the matching unit measure and never mix units and currency.5. Compare by warehouse or product category only where the model supports it. Include the SKU count and value denominator for each segment; flag small or incomplete segments and reconcile segment totals to the overall result. Do not fill missing stock snapshots with zero or carry a prior value forward unless the model defines that rule; report affected date coverage and leave unsupported rates unresolved. OUTPUTReturn the definitions, exact date window, query context, class and segmenttables, and a short interpretation. Separate observed differences fromhypotheses about causes. List follow-up checks such as stock aging orsupplier lead time; do not turn historical ratios into a demand forecast,reorder point, or causal claim.
How it works
Confirm the value basis
Check the approved ABC measure, thresholds, tie handling, SKU-location grain, currency, and reporting window. If the model does not define one of these, resolve it before comparing classes.
Compare stock and turnover
Review COGS, average inventory, period-end stock, turnover, and days of supply by class. Reconcile the class totals to the overall values and keep the same period and valuation in each ratio.
Investigate the exceptions
Use SKU and warehouse detail to find where stock position differs. Check stock age, demand history, and supplier lead time before proposing a change; the historical ratios alone do not explain the cause or set an order quantity.
What an ABC inventory review can surface
Compare the COGS share used to form each class with average inventory, ending stock, turnover, and days of supply. The image uses fictional values for Oct 1, 2025–Sep 30, 2026; the worked example below follows the same calculations.
| ABC class | SKUs | 12-month COGS | COGS share | Average inventory | Sep 30 stock | Turnover | Value days of supply |
|---|---|---|---|---|---|---|---|
| A | 6 | $800,000 | 80% | $100,000 | $90,000 | 8.0× | 41 days |
| B | 9 | $150,000 | 15% | $50,000 | $60,000 | 3.0× | 146 days |
| C | 15 | $50,000 | 5% | $25,000 | $30,000 | 2.0× | 219 days |
| Total | 30 | $1,000,000 | 100% | $175,000 | $180,000 | 5.7× | 66 days |
- Class A contains 6 of 30 SKUs and contributes $800,000 of the $1,000,000 in 12-month COGS. Classes B and C contribute the remaining $200,000.
- Overall turnover is $1,000,000 divided by $175,000 average inventory, or 5.7×. Class C has 219 value-based days of supply using its Sep 30 stock and 12-month COGS.
- The example suggests where to check SKU and warehouse detail, stock age, and lead times. It does not establish why inventory accumulated or whether a replenishment change is appropriate.
This worked example and both images use fictional values; they are not executed queries, customer results, benchmarks, or predictions. The example uses 12-month COGS and 80/15/5 cutoffs, while ABC value bases and class boundaries vary by business. Historical turnover and days of supply do not predict demand or set reorder points.