ReStockAI: Autonomous Inventory Recovery & Commerce

The Problem

Retail businesses operating across multiple locations face an expensive operational challenge: inventory can be available in one store while another experiences a shortage. Perishable products may approach expiry, excess stock may require heavy markdowns, and emergency replenishment can increase operational costs.

The problem is not simply identifying excess inventory. Businesses need to determine:

  • What should happen to the excess inventory?
  • Where can it be moved or recovered?
  • Is the proposed action economically viable?
  • How can the decision be executed and financially reconciled?

Our Solution

ReStockAI is an AI-powered, multi-agent inventory intelligence and recovery platform that helps multi-location retailers make and execute smarter inventory recovery decisions.

Instead of treating every store independently, ReStockAI considers the retail network as a connected system.

It identifies inventory risks, matches surplus stock with potential demand, evaluates operational constraints, compares recovery strategies, and coordinates execution through specialized AI agents.

When internal redistribution is not economically or operationally feasible, ReStockAI enables an external B2B liquidation route powered by PayPal.

How ReStockAI Works

1. Inventory Risk Intelligence

The Risk Engine evaluates inventory using expiry dates, sales velocity, available quantities and risk scores to identify stock requiring attention.

2. Network-Wide Inventory Matching

The Demand and Network Matching Engines identify suitable donor and receiving locations.

Matching considers:

  • Store-level demand and inventory.
  • Safety stock requirements.
  • Storage capacity.
  • Product expiry and remaining shelf life.
  • Cold-chain and temperature compatibility.
  • Distance and estimated logistics costs.

3. Intelligent Recovery Decisions

The Recovery Decision Engine evaluates multiple possible actions:

  • TRANSFER: Move inventory to another location.
  • DISCOUNT: Reduce prices to accelerate sales.
  • BUNDLE: Combine slow-moving products.
  • PROMOTE: Increase product visibility.
  • RETURN: Return eligible products to suppliers.
  • DISPOSE: Handle inventory that cannot be recovered.
  • NO_ACTION: Avoid unnecessary recovery costs when no alternative is beneficial.

The objective is to select a feasible action that maximizes expected economic value rather than simply moving inventory.

4. Autonomous Multi-Agent Coordination

ReStockAI includes seven specialized AI agents representing different operational responsibilities:

Agent Responsibility
Sarah Chen Operations Supervisor
Marcus Vance Inventory Risk Specialist
Elena Rostova Recovery Strategy Specialist
David Kim Logistics Specialist
Aisha Patel Commerce Specialist
Tom Becker Fulfillment Specialist
Linda Zhang Finance Specialist

These agents coordinate tasks, interact with underlying business engines, communicate decisions and support human approval and execution workflows.

5. PayPal-Powered B2B Liquidation

When inventory cannot be recovered through internal redistribution, ReStockAI can create an external B2B liquidation order.

We integrated the PayPal Orders API v2 with OAuth 2.0 authentication, buyer approval, server-side payment capture and transaction validation.

PayPal enables external buyers to complete purchases of liquidated inventory. Captured payment information is incorporated into ReStockAI's transaction and financial reconciliation workflow.

An important distinction: internal transfers between company-owned stores do not represent external sales or PayPal transactions. PayPal is used for external B2B commerce.

6. Outcome and Financial Intelligence

The Outcome Engine compares predicted recovery outcomes with actual execution results.

It tracks:

  • Inventory recovery value.
  • Avoided waste.
  • Transfer and handling expenses.
  • Financial variance.
  • Predicted versus actual outcomes.

This helps businesses evaluate whether their recovery decisions created measurable economic value.

Four Demonstration Scenarios

ReStockAI includes four isolated demonstration scenarios:

Scenario A — Surplus Inventory Rescue

Identifies excess inventory and evaluates possible recovery actions.

Scenario B — Stockout Prevention

Finds suitable donor locations to address inventory shortages.

Scenario C — Network-Wide Inventory Balancing

Evaluates inventory movements across multiple locations under operational and economic constraints.

Scenario D — External B2B Liquidation

Identifies an external buyer and demonstrates PayPal-powered checkout and payment processing using PayPal Sandbox.

These scenarios use demonstration data. Their simulated financial outcomes are not claims of actual customer savings.

Technology and Architecture

ReStockAI combines deterministic business engines with AI-driven orchestration.

Backend

  • Python
  • FastAPI
  • SQLAlchemy
  • SQLite

Frontend

  • React
  • TypeScript
  • Vite
  • Tailwind CSS

AI and Agent Framework

  • Strands Agents
  • Groq
  • GPT-OSS-120B

Payment Integration

  • PayPal REST APIs
  • PayPal Orders API v2
  • OAuth 2.0

Search, Routing and Infrastructure

  • OpenSearch
  • OSRM
  • AWS SAM

Testing

  • Pytest
  • Automated frontend production builds

A key architectural decision is keeping critical calculations and business constraints in deterministic engines while using AI agents for coordination, reasoning and tool orchestration.

What Inspired Us

We were inspired by a simple operational contradiction: one location can have inventory it cannot sell in time while another location needs that same product.

We wanted to build a system that looks beyond individual inventory records and helps businesses recover value across their entire network.

Rather than building another dashboard that only reports problems, we explored how AI agents could coordinate the process from detecting an inventory risk to selecting a recovery strategy and supporting its execution.

Challenges We Faced

Building ReStockAI involved several engineering challenges:

  • Designing inventory matching while respecting safety stock, capacity, expiry and cold-chain constraints.
  • Comparing economic recovery strategies without double-counting internal inventory movements as revenue.
  • Coordinating multiple AI agents with deterministic backend workflows.
  • Integrating PayPal Sandbox checkout, buyer approval, server-side capture and idempotent transaction handling.
  • Maintaining isolation between demonstration simulations and production business records.
  • Balancing fast network optimization with the accuracy of more computationally expensive optimization methods.

What We Learned

We learned that building an autonomous business system requires more than connecting an LLM to a set of tools.

Critical financial calculations, inventory constraints, payment verification and transaction state changes must remain reliable and auditable.

We also learned that an AI recommendation creates business value only when it leads to a feasible decision, successful execution and measurable financial outcomes.

What's Next

Our next objective is to validate ReStockAI with real multi-location retail operators, integrate existing ERP, POS and warehouse systems, and measure its financial impact using actual inventory and transaction data.

Our vision is to make inventory recovery an intelligent, coordinated and financially measurable business operation.

Built With

Share this project:

Updates

Submission history