Skip to main content
Mujtaba
Back to Projects

StockSense—InventoryReorderAgentforE-Commerce

Illustrative ExampleSaaSE-commerce
Node.jsNext.jsOpenAI APIPostgreSQLAWS Lambda

Mood board

Illustrative imagery from Unsplash, not screenshots of this project.

6 pieces

Two hands touching in front of a pink background

Piece 1

Two hands touching in front of a pink background

Server rack with blinking green lights

Piece 2

Server rack with blinking green lights

Close-up of syntax-highlighted code on a screen

Piece 3

Close-up of syntax-highlighted code on a screen

Night-time desk setup with laptop, lamp and city view

Piece 4

Night-time desk setup with laptop, lamp and city view

Light streaks of a city at night

Piece 5

Light streaks of a city at night

The letters AI on a blurred background

Piece 6

The letters AI on a blurred background

Illustrative Project

StockSense is an illustrative example demonstrating an AI-powered inventory automation pattern, not a completed client engagement.

Overview

StockSense monitors inventory levels, recent sales velocity, and supplier lead times across hundreds of SKUs, and proactively drafts reorder recommendations before a stockout occurs — factoring in seasonal patterns and demand trends that a simple fixed-threshold reorder point misses entirely.

The Challenge

The previous system used static reorder thresholds per SKU, set once and rarely updated. This worked acceptably for steady-demand products but consistently failed for seasonal items — triggering stockouts during demand spikes and excess inventory during slow periods, because a static threshold has no concept of trend or seasonality.

Architecture & Technical Decisions

Demand Forecasting as Input, Not the Whole System

Rather than building the agent around a complex standalone forecasting model, I used a lighter statistical trend analysis (moving averages with seasonal adjustment) as a structured input that the agent reasons over, combined with supplier lead time and current stock level, to produce a recommended reorder point and quantity with explicit reasoning.

Reasoning-Visible Recommendations

Every reorder recommendation includes the agent's stated reasoning — current stock, recent velocity, lead time, and seasonal context — so the operations team can quickly sanity-check a recommendation rather than trusting a black-box number. This visibility was critical to getting the team comfortable relying on the system.

Tiered Autonomy by SKU Risk Profile

Low-cost, high-velocity SKUs with stable demand patterns were configured for automatic reorder submission once the system proved reliable on them. Higher-cost or highly seasonal SKUs remained in human-approval mode, where the agent drafts the recommendation but a person confirms before the order is placed.

  • Trend and seasonal adjustment as structured input to the agent's reasoning, not a separate opaque model
  • Explicit reasoning attached to every recommendation for ops team review
  • Tiered autonomy — auto-submit for stable, low-risk SKUs; human approval for higher-stakes ones
  • Continuous tracking of recommendation accuracy to inform which SKUs graduate to auto-submit

Results

  • 61% reduction in stockout incidents compared to the previous fixed-threshold system
  • 27% reduction in excess inventory on slow-moving and seasonal SKUs
  • 850+ SKUs actively monitored across multiple warehouse locations
  • 89% of draft reorder recommendations approved without modification by the operations team

What I Learned

Tiered autonomy based on SKU risk profile, rather than an all-or-nothing automation decision, was what made this system adoptable. The operations team trusted automatic reordering on stable products almost immediately, and that trust extended gradually to higher-stakes SKUs only as the system's track record on the easier cases built confidence — exactly the gradual-trust pattern that works well across most agent deployments.

Related Projects

Ready to Put AI to Work in Your Business?

Whether you need a custom AI agent, an automation workflow, or a full-stack AI product built from scratch — let's talk about how I can help your team move faster and build smarter.

I typically respond within 24 hours