tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Generative AI > Google Gemini API > Demand Sensing Agent

Demand Sensing Agent

Author: Venkata Sudhakar

ShopMax India's inventory team needs to react to demand surges before stock runs out. Traditional monthly forecasts miss short-term spikes triggered by festivals, product launches, or viral social media moments. A demand sensing agent that reads live sales velocity and external signals fills this gap - giving the team a 7-day forward view with restock recommendations.

This tutorial builds a Demand Sensing Agent using ADK and Gemini. The agent reads recent sales data, computes daily velocity, checks seasonal uplift factors, and produces a 7-day demand forecast with recommended purchase quantities for each SKU.

The below example shows the demand sensing pipeline for ShopMax India during a festival period.


It gives the following output,

Demand Sensing Report - Diwali Season (uplift: 2.4x)

SKU      | Product                    | Stock | 7d Forecast | Days Cover | Action
---------|----------------------------|-------|-------------|------------|----------
SKU-1001 | Samsung 55-inch 4K TV      |  42   |    218      |   1.7 days | URGENT RESTOCK - order 394 units
SKU-1002 | Sony WH-1000XM5 Headphones |  18   |    151      |   1.1 days | URGENT RESTOCK - order 284 units
SKU-1003 | Apple iPad Air 11-inch     |   9   |    173      |   0.5 days | URGENT RESTOCK - order 337 units
SKU-1004 | Bose SoundLink Speaker     |  55   |    115      |   3.9 days | URGENT RESTOCK - order 175 units

All 4 SKUs require immediate purchase orders.
Recommendation: Place orders today - lead times of 4-10 days mean
stock-out is likely before Diwali without immediate action.

In production, replace the simulated history with a BigQuery query over your actual order data. Connect the agent to Google Trends API as an additional signal source, and push restock recommendations directly to your ERP system via a Pub/Sub trigger when urgency is high.


 
  


  
bl  br