About StockMind

Inventory Markdown Recommendation Engine

What is StockMind?

StockMind is an intelligent promotion recommendation engine that analyzes your inventory to identify distressed SKUs and suggests optimal markdown strategies. It balances the need to move inventory quickly while protecting profit margins.

🎯

Smart Targeting

Identifies non-moving, aging, and at-risk inventory

📊

Data-Driven

Uses sales velocity, storage costs, and decay risk

💰

Margin Protection

Recommends minimum discount needed to move stock

How It Works

1

Distress Scoring

Each SKU receives a distress score (0-1) based on 6 weighted factors:

Non-Moving (25%): Days since last sale
Overstock (20%): Days of cover vs threshold
Aging (20%): Inventory age in days
Decay (15%): Age vs shelf life ratio
Storage (10%): Physical storage burden
Demand Weak (10%): Recent velocity decline
2

Baseline Forecast

Estimates expected 30-day demand without promotion using weighted moving average of recent sales history.

3

Promotion Simulation

For each distressed SKU, tests all discount levels and calculates:

  • Expected units sold (baseline × uplift factor)
  • Expected margin (discounted price - cost) × units
  • Holding cost avoided (saved storage fees)
  • Waste avoided (prevented decay/spoilage)
  • Leftover penalty (remaining stock risk)
4

Business Guard Rails

Before recommending, applies safety checks:

  • Skip SKUs below distress threshold
  • Don't promote low-stock items
  • Respect minimum margin floor
  • Cap discount at 20%
5

Final Recommendation

Selects the discount level with the highest action score (maximizes margin while moving inventory).

Discount Ladder

StockMind tests 5 fixed discount levels with estimated demand uplift:

Discount Expected Uplift Use Case
0% 1.00x (baseline) Healthy inventory, no action needed
5% 1.08x (+8%) Gentle nudge for slow movers
10% 1.18x (+18%) Moderate promotion for at-risk stock
15% 1.32x (+32%) Aggressive clearance for aging inventory
20% 1.50x (+50%) Maximum discount for urgent clearance

Configurable Parameters

Tune the engine to match your business requirements:

Distress Threshold (default: 0.55)

Minimum distress score to consider for promotion. Higher = more selective.

Minimum Margin (default: 0.15)

Minimum acceptable gross margin percentage. Prevents unprofitable discounts.

Low Stock Threshold (default: 0.75)

Don't promote if inventory is below this multiple of baseline demand.

Distress Weight Sliders

Adjust relative importance of each distress factor. Must sum to 1.0.

Technology Stack

FastAPI
Web Framework
HTMX
Dynamic UI
DuckDB
Analytics Database
Polars
Data Processing
Chart.js
Visualizations
Alpine.js
Interactivity
Tailwind CSS
Styling
Python 3.12
Runtime

Process Flow Diagram

Inventory Data
↓
Distress Scoring
6 weighted factors
↓
Baseline Forecast
30-day demand estimate
↓
Promotion Simulation
Test 5 discount levels
↓
Guard Rails
Business rules validation
↓
Optimal Recommendation

Note: This is a proof-of-concept (POC) deployment optimized for a 1GB server. The engine analyzes up to 200 SKUs per run. For production use with larger datasets, consider upgrading to at least a 2GB server.