The flow
Starts it 1Model 9Logic 24Service 26
The steps in the order they run, from what starts it. The first 60 of 70.
- 1GPT-5-nano (intent classifier)Lm Chat Open AiModel
- 2GPT-4o (order agent)Lm Chat Open AiModel
- 3Create order in MongoDBMongo Db ToolService
- 4Get product info from MongoDBMongo Db ToolService
- 5Log order to Google SheetsGoogle Sheets ToolService
- 6OpenAI embeddingsEmbeddings Open AiModel
- 7WhatsApp message triggerWhats App triggerStarts it
- 8Session memory for shopping agentMemory Buffer WindowModel
- 9Session memory for order agentMemory Buffer WindowModel
- 10AI shopping agent (BytezBot)AgentModel
- 11Order orchestration AI agentAgentModel
- 12MongoDB Atlas vector searchVector Store Mongo DBAtlasModel
- 13Check if message is button or imageIfLogic
- 14Detect JSON intent or plain text replyCodeLogic
- 15Send order confirmationWhats AppService
- 16Download product image from DriveGoogle DriveService
- 17Combine vector search results with imagesMergeLogic
- 18Route interactive vs image messageSwitchLogic
- 19Validate incoming messageCodeLogic
- 20Append AI reply to session historyCodeLogic
- 21Convert product image to base64Extract From FileService
- 22Combine products with base64 imagesCodeLogic
- 23Parse button and user dataCodeLogic
- 24Get VTO context from RedisRedisService
- 25Pass valid messages, block invalidIfLogic
- 26Save session to RedisRedisService
- 27Aggregate all product base64 imagesAggregateLogic
- 28Store products in cacheRedisService
- 29Route VTO vs order button tapSwitchLogic
- 30Is VTO product ID stored in Redis?IfLogic
- 31Get user session from RedisRedisService
- 32Send validation error to userWhats AppService
- 33Route JSON intent vs plain text replyIfLogic
- 34Unpack products from cache resultCodeLogic
- 35Set VTO context in RedisRedisService
- 36Extract image ID, waId, and product IDCodeLogic
- 37Ask user to send correct photoWhats AppService
- 38Load session and append user messageCodeLogic
- 39Route product search vs recommendSwitchLogic
- 40Send text response to userWhats AppService
- 41Loop through productsSplit In BatchesLogic
- 42Prompt user to upload selfieWhats AppService
- 43Get product image from MongoDBMongo DbService
- 44Get WhatsApp media URLHttp RequestService
- 45Build Redis cache key from search queryCodeLogic
- 46Build product card message bodyCodeLogic
- 47Download product image from Drive (VTO)Google DriveService
- 48Download user selfieHttp RequestService
- 49Check Redis cacheRedisService
- 50Convert product image base64 to binaryCodeLogic
- 51Resize product image to 1024pxEdit ImageService
- 52Analyze user selfie with GeminiGoogle GeminiModel
- 53Resize user selfie to 1024pxEdit ImageService
- 54Is product cached in Redis?IfLogic
- 55Upload product image to WhatsAppHttp RequestService
- 56Extract product image as base64Extract From FileService
- 57Gemini: confirm exactly one personIfLogic
- 58Extract user selfie as base64Extract From FileService
- 59Parse cached product JSON arrayCodeLogic
- 60Send product message with buttonsHttp RequestService