|
|
Purchase Order Automation Agent
Author: Venkata Sudhakar
ShopMax India's procurement team currently raises purchase orders manually when someone notices stock running low. This reactive approach leads to stockouts during peak demand periods and over-ordering when sales slow. An automated PO agent that monitors stock levels daily, compares them to reorder points, and generates structured purchase orders when action is needed removes human latency from the restocking cycle. This tutorial builds a Purchase Order Automation Agent using ADK and Gemini. The agent scans the inventory for SKUs that have hit their reorder point, calculates the required order quantity based on lead time and safety stock, and drafts a formal purchase order for each vendor. The below example shows automated PO generation for ShopMax India low-stock products.
It gives the following output,
Purchase Order Generation - ShopMax India
3 SKUs scanned | 3 reorder triggers found
!! CRITICAL - STOCKOUT RISK !!
SKU-1003 | Apple iPad Air | Days cover: 2.5 days | Lead time: 10 days
Stock will run out before delivery. Expedite or source from alternate supplier.
PO-AUTO-1003 | Apple India Distributor
Product : Apple iPad Air 11-inch
Qty : 25 units
Unit : Rs 58,000
Total : Rs 14,50,000
Delivery: 2025-04-17 (10 days)
PO-AUTO-1001 | Samsung India Pvt Ltd
Product : Samsung 55-inch 4K TV
Qty : 50 units
Unit : Rs 45,000
Total : Rs 22,50,000
Delivery: 2025-04-14 (7 days) [CRITICAL - 1.6 days cover]
PO-AUTO-1002 | Sony India Ltd
Product : Sony WH-1000XM5 Headphones
Qty : 30 units
Unit : Rs 20,000
Total : Rs 6,00,000
Delivery: 2025-04-12 (5 days) [NORMAL - 7.3 days cover]
Total PO value this run: Rs 43,00,000
Deploy this agent as a daily Cloud Run job that reads live inventory from BigQuery and submits approved POs directly to vendor portals via API integration. Add a human-in-the-loop step for POs above Rs 10 lakhs using ADK callback patterns - the agent pauses and sends a Pub/Sub notification to the procurement manager for approval before the PO is submitted.
|
|