Smart multi-agent restocking system for a steam bun shop
Challenge: A steam bun shop restocks by over-ordering slow-moving items and running out of fast sellers. Without data-driven insights, the owner wastes money on excess stock and loses sales from stockouts.
Solution: Stock Manager uses multiple AI agents to automate restocking. It analyzes sales trends, monitors stock levels, predicts potential stockouts, and generates a purchase order in Google Sheets — all from a single question.
Queries AlloyDB for average daily sales per product and compares week-over-week trends to identify fast movers, slow movers, and rising demand items.
Checks current inventory against reorder points for all 18 products. Flags items as critical (below 50% of reorder point), low, or healthy.
Combines sales trends with inventory data. Items with rising demand (10%+ increase) and stock within 1.5x of reorder point are flagged for early restocking.
Creates a purchase order grouped by supplier with product names, quantities, and contact details. Pushes directly to Google Sheets via MCP.
Left sidebar displays real-time stock levels for all products with color-coded status badges. Updates reflect the latest database state.
Conversational UI with quick-action buttons for common queries. Supports markdown tables, bold text, and clickable links in responses.
Uses SequentialAgent to chain three specialized sub-agents: Sales Analyst, Inventory Checker, and Restock Decider. Each agent has its own tools and instructions.
Queries AlloyDB with two SQL tools: daily sales summary and week-over-week trend comparison. Identifies top 5 fast/slow movers and all rising-demand products.
Queries AlloyDB for current stock levels and low-stock items. Reports critical/low items with reorder quantities and supplier contact details.
Synthesizes findings from both previous agents. Applies restocking rules and generates a purchase order pushed to Google Sheets via MCP tool.
/static directory