[{"data":1,"prerenderedAt":130},["ShallowReactive",2],{"work-shopify-agent":3},{"id":4,"title":5,"body":6,"category":87,"challenge":88,"codeSnippet":89,"description":93,"extension":94,"featured":95,"finalScreenshot":96,"gridOrder":97,"isDemo":95,"isDemoURL":80,"liveUrl":97,"meta":98,"mockupImage":99,"navigation":100,"nextProject":101,"order":104,"path":105,"results":106,"schneiderFeatured":100,"schneiderOrder":107,"seo":108,"solution":109,"stem":110,"subtitle":111,"tags":112,"techStack":118,"thumbnail":126,"thumbnailVideo":127,"year":128,"__hash__":129},"works/works/shopify-agent.md","StockPilot",{"type":7,"value":8,"toc":79},"minimark",[9,14,18,22,25,32,38,44,50,54,60,66,72,76],[10,11,13],"h2",{"id":12},"the-problem","The Problem",[15,16,17],"p",{},"Multi-store Shopify merchants face a compounding inventory challenge: as SKU counts grow and sales patterns shift seasonally, manual inventory management becomes a bottleneck. Spreadsheet-based reorder points can't adapt to real-time demand changes, and by the time a human notices a trending product is running low, the sales window has already passed.",[10,19,21],{"id":20},"architecture","Architecture",[15,23,24],{},"The system follows an event-driven architecture built entirely on AWS CDK infrastructure-as-code:",[15,26,27,31],{},[28,29,30],"strong",{},"Data Ingestion Layer"," — Shopify webhooks (orders/create, inventory_levels/update) flow through API Gateway into SQS queues, ensuring no events are lost during traffic spikes. Each event is enriched with historical context from DynamoDB before processing.",[15,33,34,37],{},[28,35,36],{},"Analysis Pipeline"," — Lambda functions calculate rolling sales velocity, seasonal adjustment factors, and supplier reliability scores. These metrics feed into a decision context that the AI agent evaluates.",[15,39,40,43],{},[28,41,42],{},"Decision Engine"," — Claude evaluates each potential restock against multiple factors: current velocity, upcoming seasonal trends, supplier lead times, and cash flow constraints. The agent doesn't just calculate — it reasons about whether a restock makes strategic sense.",[15,45,46,49],{},[28,47,48],{},"Execution Layer"," — Approved restock decisions automatically generate purchase orders via supplier APIs and update Shopify inventory expectations. Every decision is logged with full reasoning for merchant review.",[10,51,53],{"id":52},"key-technical-decisions","Key Technical Decisions",[15,55,56,59],{},[28,57,58],{},"Why multi-agent over single-agent?"," Each store has different suppliers, margins, and seasonal patterns. Dedicated agents per store maintain focused context windows while a coordinator agent handles cross-store optimization (e.g., transferring stock between locations).",[15,61,62,65],{},[28,63,64],{},"Why DynamoDB over RDS?"," The access patterns are almost entirely key-value lookups (SKU → velocity, SKU → supplier context). DynamoDB's single-digit millisecond reads keep the decision pipeline under the 15-minute Lambda timeout even for bulk evaluations.",[15,67,68,71],{},[28,69,70],{},"Why Claude over rule-based?"," Pure threshold-based systems can't handle edge cases: a sudden TikTok viral moment, a supplier delay announcement, or a seasonal shift that historical data hasn't seen. The LLM layer adds judgment to the data.",[10,73,75],{"id":74},"outcome","Outcome",[15,77,78],{},"The system processes approximately 2,000 inventory evaluations daily across 15,000+ SKUs. The merchant's stockout rate dropped from ~8% to under 1%, and the time saved on manual inventory review freed up 20+ hours per week for strategic work.",{"title":80,"searchDepth":81,"depth":81,"links":82},"",2,[83,84,85,86],{"id":12,"depth":81,"text":13},{"id":20,"depth":81,"text":21},{"id":52,"depth":81,"text":53},{"id":74,"depth":81,"text":75},"AI Agent","Managing inventory across multiple Shopify stores meant constant manual monitoring, delayed restock decisions, and missed sales opportunities during peak periods. Merchants needed a system that could think and act on its own.",{"language":90,"filename":91,"code":92},"typescript","agent/restock-decision.ts","export async function evaluateRestockDecision(\n  sku: string,\n  context: InventoryContext\n): Promise\u003CRestockDecision> {\n  const salesVelocity = await calculateVelocity(sku, 30)\n  const currentStock = context.availableQuantity\n  const leadTime = context.supplier.avgLeadTimeDays\n\n  const daysOfStock = currentStock / salesVelocity.unitsPerDay\n  const reorderPoint = salesVelocity.unitsPerDay * leadTime * 1.3\n\n  if (currentStock \u003C= reorderPoint) {\n    const orderQty = Math.ceil(\n      salesVelocity.unitsPerDay * leadTime * 2 - currentStock\n    )\n\n    const decision = await claude.messages.create({\n      model: 'claude-sonnet-4-20250514',\n      messages: [{\n        role: 'user',\n        content: buildRestockPrompt(sku, {\n          salesVelocity,\n          currentStock,\n          orderQty,\n          seasonalTrends: context.trends,\n        }),\n      }],\n    })\n\n    return parseRestockDecision(decision, orderQty)\n  }\n\n  return { action: 'hold', reason: `${daysOfStock.toFixed(0)}d remaining` }\n}\n","An autonomous AI agent that monitors inventory, analyzes sales trends, and executes restocking decisions across multiple Shopify stores without human intervention.","md",false,"/images/projects/shopify-agent-final.jpg",null,{},"/images/projects/shopify-agent-mockup.jpg",true,{"title":102,"slug":103},"Shopify AI Copilot","shopify-ai-copilot",1,"/works/shopify-agent","92% reduction in stockout events. Average restock decision time dropped from 48 hours to 12 minutes. System manages 15,000+ SKUs across 3 stores autonomously.",5,{"title":5,"description":93},"Built a multi-agent system powered by Claude that ingests real-time Shopify webhooks, processes sales velocity data through AWS Lambda pipelines, and autonomously creates purchase orders when inventory drops below dynamically calculated thresholds.","works/shopify-agent","AI-powered inventory management that thinks and acts autonomously",[113,114,115,116,117],"AI","AWS CDK","Claude","Data Pipeline","Shopify",[119,114,120,121,122,123,124,125],"Claude API","Lambda","DynamoDB","SQS","EventBridge","Shopify Admin API","TypeScript","/images/projects/shopify-agent.jpg","/videos/shopify-agent.mp4","2026","DbuSjHTGX9j1ymb5TRzaGhgM344qIYoJnQcMK03V6ck",1773700381179]