AWS Builder Center
ReStockAI: Recovering Inventory Value Before It Becomes a Loss

ReStockAI: Recovering Inventory Value Before It Becomes a Loss

What if inventory doesn't become a loss because nobody wants it, but because it is in the wrong place at the wrong time? ReStockAI is an AI-powered inventory recovery network that detects at-risk stock, chooses the most valuable recovery action, orchestrates the transfer, and measures the value actually recovered.

3rd Year VIT Chennai Student

Inventory Isn't Dead, It's Just Misplaced β€” Meet ReStockAI

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 an 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 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.

ο»Ώ

The Problem We Wanted to Solve

Supply chain teams usually face a compound puzzle:

Asymmetric Local Demand

Store A may have almost no demand while Store B is selling the same SKU rapidly.

A Ticking Clock

For perishable inventory, every hour can reduce the available recovery window.

Hidden Logistics Friction

Moving inventory costs money. If transfer logistics exceed the expected recovered value, the transfer itself can create another loss.

Static Dashboards

Traditional dashboards can highlight an inventory problem, but often leave the operator with the harder question:
β€œWhat should I actually do about it?”
ReStockAI was designed around that question.

ο»Ώ

The Breakthrough: Transfer Is Not Always the Answer

Our first instinct was straightforward:
Find expiring inventory β†’ find a high-demand store β†’ transfer it.
Then we asked ourselves a more important engineering question:
What if transferring the stock costs more than the inventory is actually worth?
That single edge case forced us to redesign the architecture and build the Recovery Decision Engine.
ReStockAI evaluates multiple possible recovery actions before moving a single box:
  1. Inter-Store Transfer β€” Move stock to a high-velocity store node.
  1. Local Dynamic Markdown β€” Reduce the price at the current store to accelerate sell-through.
  1. Vendor Buyback / Return β€” Return inventory to the distributor when contractual terms allow.
  1. Local Write-Off / Disposal β€” Choose disposal when recovery economics no longer justify another action.
The decision engine estimates:

Expected Net Recovery

Expected Recovered Contribution βˆ’ Logistics Cost βˆ’ Handling Cost βˆ’ Risk Cost
For example, if transferring 25 units creates β‚Ή12,000 of potential recovered sales but requires β‚Ή13,000 of expedited cold-chain logistics, the engine rejects the transfer.
It can instead recommend a local markdown or another economically viable action.
Our goal isn't to move boxes. Our goal is to maximize recovered value.
That became the central design principle of ReStockAI.

ο»Ώ

How It Works: A Real Operational Walkthrough

Let's look at SKU: YOG-001 β€” Organic Greek Yogurt.
ο»Ώ
Store A
Store B
Current inventory
50 units
5 units
Remaining shelf life
2 days
2 days
Demand
4 units/day
18 units/day
Status
AT RISK
HIGH DEMAND
ReStockAI evaluates the network state and determines that Store B can absorb 25 additional units within the recovery window without creating excessive overstock.
The decision flow becomes:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Store A β”‚
β”‚ 50 units β€’ 2 days remaining β”‚
β”‚ β”‚ β”‚
β”‚ β–Ό β”‚
β”‚ ReStockAI Decision Engine β”‚
β”‚ β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β–Ό β–Ό β–Ό β”‚
β”‚ Transfer Discount No Action β”‚
β”‚ β”‚ β”‚
β”‚ β–Ό β”‚
β”‚ 25 units β”‚
β”‚ Store A β†’ Store B β”‚
β”‚ Expected Net Recovery: β‚Ή12,000 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

1. Detection

ReStockAI flags Store A's inventory as CRITICAL based on remaining shelf life, inventory level, and local demand velocity.

2. Optimization

The decision engine determines that Store B can absorb 25 units within the available two-day window without creating excessive inventory at the destination.

3. Logistics Matching

The logistics dispatcher evaluates available logistics providers and selects a compatible cold-chain option whose ETA satisfies the remaining shelf-life constraint.

4. Execution Manifest

An operational transfer manifest such as TRF-10928374 is generated and passed into the recovery workflow.
The result is not merely an alert.
It is an actionable operational decision.

ο»Ώ

Architecture: Keeping Logic Deterministic and AI Contextual

We made a strict architectural boundary early in development:
Never use an LLM to calculate numbers that require mathematical certainty.
Calculations such as:
  • expected recovery,
  • logistics costs,
  • transfer quantities,
  • shelf-life constraints,
  • risk calculations,
  • partner evaluation
are handled by predictable, deterministic logic.
AI shouldn't guess math.
Instead, we use AI through Strands Agents and Amazon Bedrock for contextual operational intelligence.
The AI layer can translate dense numerical trade-offs into clear explanations for store managers and operations teams.
For example:
Why was this transfer recommended?
Because the destination has significantly higher demand, the remaining shelf-life window is sufficient for the transfer, and the expected recovered value exceeds the estimated recovery cost.

ο»Ώ

AWS Architecture

Our AWS-oriented architecture maps each component to a specific responsibility:
Store Telemetry / POS Data
β”‚
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Amazon API β”‚
β”‚ Gateway β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ AWS Lambda β”‚
β”‚ Decision Logic β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β–Ό β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ DynamoDB β”‚ β”‚ Amazon β”‚
β”‚ Operational β”‚ β”‚ Bedrock β”‚
β”‚ State β”‚ β”‚ AI Reasoning β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Step Functions β”‚
β”‚ Recovery β”‚
β”‚ Workflow β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ReStockAI β”‚
β”‚ War Room UI β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Amazon S3

Stores raw inventory snapshot datasets and relevant model or application artifacts.

Amazon DynamoDB

Maintains operational state and active transfer manifests.

AWS Lambda

Runs serverless deterministic decision calculations and logistics evaluation logic.

AWS Step Functions

Manages the multi-step recovery workflow:
CREATED
↓
APPROVED
↓
ASSIGNED
↓
IN_TRANSIT
↓
COMPLETED

Amazon EventBridge

Drives scheduled inventory-risk scanning across store nodes.

Amazon Bedrock

Powers contextual reasoning for the AI assistant and generates human-readable explanations of operational recommendations.

ο»Ώ

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 expected net recovery
After the batch sells through at Store B, the actual ledger records:
β‚Ή11,200 recovered
That gives us a valuable comparison:
Predicted Recovery
β”‚
β–Ό
Actual Recovery
β”‚
β–Ό
Variance Analysis
β”‚
β–Ό
Historical Outcome
β”‚
β–Ό
Future Decisions
We store both the predicted and actual outcomes in the historical ledger.
By comparing predicted versus actual sell-through and recovery, ReStockAI creates a ground-truth feedback loop that can be used to calibrate future risk scoring and demand assumptions.
The system therefore moves beyond:
Predict β†’ Recommend
toward:
Predict β†’ Execute β†’ Measure β†’ Learn

ο»Ώ

What We Learned Building ReStockAI at First Commit

Building ReStockAI taught us that the hardest part of software isn't necessarily writing the code.
It is 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 transformed ReStockAI from a simple inventory alert system into an automated operational recovery war room.
The most important realization was that inventory recovery is not purely a logistics problem.
It is a decision problem involving demand, time, economics, constraints, and execution.

ο»Ώ

Why ReStockAI Is Different

The objective is not simply to predict demand.
It is not simply to identify expiring inventory.
And it is not simply to move stock between stores.
The system connects the entire loop:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ DETECT β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ DECIDE β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ DISPATCH β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ RECOVER β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ LEARN β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
└──────────────► DETECT
The inventory already exists. The opportunity is recovering its value before that opportunity disappears.

ο»Ώ

Where We See This Going

Although our First Commit prototype focuses on inventory recovery, the underlying decision framework can apply to many inventory-driven environments:

Quick Commerce

Move short-shelf-life products toward stronger demand.

Retail

Recover value from regional overstock and slow-moving inventory.

Pharmacy

Optimize inventory approaching expiry while considering operational constraints.

Fashion

Rebalance regional inventory before markdown pressure increases.

Electronics

Move slow-moving products toward locations where demand exists.

Spare Parts

Move underutilized parts toward facilities where they are more likely to be required.
The common principle remains:
Inventory value depends not only on what the product is, but also where it is, when it is there, and what action is economically possible next.

ο»Ώ

Final Thought

A system doesn't always need to predict the future.
Sometimes it needs to recognize the value that is already there β€” before it disappears.
That's what we're building with ReStockAI.

We don't just predict inventory. We recover its value before it becomes a loss.


ο»Ώ

Project Links & Resources

  • First Commit β€” Bharat Builds Tour 2026
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article