I Designed a Commerce Bot. WhatsApp Redesigned It.
Summary
FundlyMart, a WhatsApp commerce system for Indian pharmacy retailers, faced significant architectural challenges due to the platform's constraints and user behavior. Lacking a traditional UI, the system had to manage complex natural language inputs, including "Hinglish" queries with phonetic misspellings and mixed languages. This led to a three-tier search fallback: lexical, vector, and LLM extraction, each added after real-world failures. Pharmacists primarily restock, making "same as last time" a core use case, which mandated robust order history recall and modification capabilities. Furthermore, WhatsApp's 24-hour session window forced a critical separation of persistent cart state from ephemeral conversation state, alongside re-entry detection to prevent lost orders. The system's architecture evolved through iterative responses to production failures rather than initial design.
Key takeaway
For AI Engineers building conversational commerce bots on constrained platforms like WhatsApp, prioritize real-world user behavior and platform limitations over idealized UI design. Your architecture will likely emerge from iterative responses to production failures, not upfront whiteboarding. Design for persistent cart state independent of ephemeral conversation sessions, implement multi-tiered natural language understanding for diverse inputs, and ensure context-aware re-entry to prevent lost user progress.
Key insights
WhatsApp's platform constraints and user behavior fundamentally shape commerce bot architecture, demanding iterative, failure-driven design.
Principles
- "Same as last time" is a primary use case.
- Natural language replaces UI for input constraints.
- Cart state must be persistent, user-scoped.
Method
Implement a three-tier product search: lexical match, then vector similarity via pgvector, then LLM extraction. Ensure re-entry detection surfaces pending carts after session expiry.
In practice
- Handle diverse "yes" and "no" inputs.
- Summarize prior orders concisely for re-ordering.
- Separate ephemeral conversation from persistent cart state.
Topics
- WhatsApp Commerce
- Conversational AI
- NLP Challenges
- Bot Architecture
- LLM Integration
- Vector Search
Best for: AI Engineer, Machine Learning Engineer, NLP Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by Towards AI - Medium.