ReStockAI: Rescuing Perishable Millions Before the Expiry Clock Runs Out
What if expiring inventory isn't unsellable—it's just sitting in the wrong store? ReStockAI is an AI-orchestrated Inventory Recovery Network built during First Commit (Bharat Builds Tour 2026). It actively monitors stock at risk of expiry, calculates net economic recovery tradeoffs across channels, dispatches cold-chain transfers, and validates predictions against ground truth outcomes.
₹10,000 Realization: Inventory Isn't Dead, It’s Just Misplaced
Imagine two retail outlets separated by a 20-minute drive across town:
- Store A is staring at 50 units of organic Greek yogurt expiring in 48 hours. Foot traffic is slow, and local demand is near zero.
- Store B has only 5 units left on the shelf, but customers are buying them almost as fast as staff can unpack them.
In standard retail software, Store A flags a upcoming loss write-off, while Store B flags a stockout.
The inventory hasn't lost its intrinsic utility. It isn't unwanted. It is simply sitting in the wrong room.
That simple observation was our lightbulb moment for ReStockAI during the First Commit — Bharat Builds Tour 2026.
Most inventory systems obsess over forward-looking replenishment: “How much should we order next month?” We decided to flip the question on its head: “What stock is at risk right now, and how do we rescue its economic value before it hits zero?”
Inventory doesn't become a loss when it gets thrown in a dumpster—it becomes a loss weeks earlier when nobody takes action.
Supply chain teams usually face a compound puzzle:
- Asymmetric Local Demand: Store A is dead; Store B is booming.
- Ticking Clock: Shelf life is decaying exponentially.
- Hidden Logistics Friction: Moving product costs money. If transfer logistics exceed expected sales revenue, you lose even more cash.
- Static Dashboards: Standard tools show red badges, but leave operators guessing what to do next.
The Breakthrough: Transfer Is Not Always the Answer
Then we asked ourselves a brutal engineering question: What if transferring the stock costs more than the inventory is actually worth?
That single edge case forced us to redesign our entire architecture and invent the Recovery Decision Engine.
ReStockAI evaluates multiple competing channels before moving a single box:
- Inter-Store Transfer: Move stock to a high-velocity store node.
- Local Dynamic Markdown: Apply a 30%–50% discount at the current store.
- Vendor Buyback / Return: Ship back to distributor under contract terms.
- Local Write-Off / Disposal: Liquidate if logistics costs exceed item value.
To rank these options, we compute Expected Net Recovery:
$$\text{Net Recovery} = (\text{Units Transferred} \times \text{Selling Price} \times \text{Prob(Sell-Through)}) - \text{Logistics Cost} - \text{Risk Penalty}$$
If transferring 25 units yields ₹12,000 in gross sales but costs ₹13,000 in expedited cold-chain freight, the engine rejects the transfer. It defaults to dynamic local discounting instead.
Our goal isn't to move boxes—it's to maximize dollar recovery.
How It Works: A Real Operational Walkthrough
Let's look at SKU: YOG-001 (Organic Yogurt) in our system:
- Store A: 50 units remaining | 2 days to expiry | Demand: 4 units/day
- Store B: 5 units remaining | 2 days to expiry | Demand: 18 units/day
[ Store A: 50 units (At Risk) ] ──( Evaluates Logistics )──> [ Store B: 5 units (High Demand) ] │ [ ReStockAI Decision Engine ] │ ├── Option 1: Move 50 units ❌ (Overstocks Store B) ├── Option 2: Local Discount ⚠️ (Forfeits 50% Value) └── Option 3: Move 25 units ✅ (Net Recovery: ₹12,000)
- Detection: ReStockAI flags Store A's inventory as
CRITICALrisk based on decay rate and local velocity.
- Optimization: The decision engine calculates that Store B can absorb 25 units within the 2-day window without overstocking.
- Logistics Matching: The logistics dispatcher pairs the order with a certified cold-chain partner (ColdChain Express) ensuring ETA satisfies the shelf-life constraint.
- Execution Manifest: An atomic manifest (
TRF-10928374) is dispatched directly to store operations.
Architecture: Keeping Logic Deterministic & AI Contextual
We made a strict architectural boundary early on: Never use an LLM to calculate numbers that require mathematical certainty.
Calculations like financial net recovery, logistics routing fees, and shelf-life decay curves are handled by predictable, deterministic logic. AI shouldn't guess math.
Instead, we use AI (via Strands Agents and Amazon Bedrock) for contextual operational intelligence: translating dense numerical tradeoffs into clear natural language explanations for human store managers.
AWS Cloud Architecture Mapping
[ Store Telemetry / POS Data ] │ ▼ [ Amazon API Gateway ] │ ▼ [ AWS Lambda ] │ ┌───────────────────┴───────────────────┐ ▼ ▼ [ Amazon DynamoDB ] [ Amazon Bedrock ] (Operational State & Manifests) (Contextual Reasoning Agent) │ │ └───────────────────┬───────────────────┘ ▼ [ AWS Step Functions ] (Recovery Workflow Orchestration) │ ▼ [ ReStockAI War Room UI ]
- Amazon S3: Stores raw inventory snapshot datasets and model logs.
- Amazon DynamoDB: Handles atomic real-time updates for active transfer manifests.
- AWS Lambda: Runs serverless deterministic decision calculations and logistics route evaluations.
- AWS Step Functions: Manages multi-step state machine orchestrations (
CREATED$\rightarrow$APPROVED$\rightarrow$ASSIGNED$\rightarrow$IN_TRANSIT$\rightarrow$COMPLETED).
- Amazon EventBridge: Drives continuous scheduled risk scanning across all store nodes.
- Amazon Bedrock: Powers natural language reasoning for the AI Assistant and operator decision explanations.
The Closed-Loop Feedback Engine: Learning From Ground Truth
The true power of ReStockAI starts after a transfer finishes.
Suppose our engine predicts ₹10,000 in net recovery on a transfer. When the batch sells out at Store B, the actual ledger records ₹11,200 recovered (+₹1,200 positive variance).
We store both the prediction and the actual outcome in our historical ledger. By comparing predicted vs. actual sell-through, ReStockAI creates a ground-truth feedback loop that continuously calibrates its future risk scoring and demand assumptions.
What We Learned Building ReStockAI at First Commit
Building ReStockAI taught us that the hardest part of software isn't writing code—it's defining the right problem.
We started this hackathon asking: “How do we move expiring inventory?”
We finished by asking: “How do we salvage maximum economic value before inventory expires?”
That shift in perspective transformed ReStockAI from a simple alert screen into an automated operational recovery war room.
Project Links & Resources
- GitHub Repository: github.com/Manish-N-2006/Restock_AI
- 3-Minute
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article