Inspiration

In Indonesia, there are 64+ million UMKM (micro, small, and medium enterprises) — the backbone of our economy. Yet most of them still manage customer inquiries manually through WhatsApp, one message at a time.

As a small business owner myself, I know the struggle: you can't be online 24/7. When you sleep, customers message. When you're busy with orders, new inquiries pile up. And hiring staff? Too expensive for a small warung or toko.

What if every UMKM could have a 24/7 AI assistant that answers product questions, checks stock, and even processes orders — all through the app they already use every day: WhatsApp?

No app downloads. No new platforms. Just chat.

What it does

  1. The Power of "Zero Friction" The biggest lesson: don't ask users to change their behavior. UMKM owners already live on WhatsApp. By building directly on WhatsApp Cloud API, we eliminated the #1 barrier — adoption.

  2. Gemini is Fast and Multilingual We tested Gemini 2.5 Flash across Indonesian and English conversations. It handles code-switching (mixing Bahasa and English in one message) remarkably well — critical for Indonesian users who often mix languages naturally.

  3. AI Vision is a Game Changer for Inventory Using Google Cloud Vision API, shop owners can take a photo of a product and the AI automatically extracts the product name, description, price, and suggested stock level. No typing required. This alone saves 10-15 minutes per product listing.

  4. Multilingual ≠ Just Translation True bilingual support isn't just swapping words. It's about understanding context: "How much is the batik?" vs "Berapa harga batik?" — same intent, different language. We built a detection system that identifies language from the customer's message and responds accordingly.

How we built it

Architecture Customer (WhatsApp) → Meta Cloud API → Flask Webhook → Gemini 2.5 Flash AI ↓ Product Database (Firebase) Cloud Vision API (Photos) ↓ Response → WhatsApp API → Customer

Tech Stack:

  1. AI Engine: Gemini 2.5 Flash for fast inference, multilingual support, and structured output generation.
  2. Vision: Google Cloud Vision API for extracting product information and text from images.
  3. Backend: Python Flask as a lightweight framework for rapid development and prototyping.
  4. Database: SQLite for local development and Firestore for scalable cloud-based data storage.
  5. Messaging: WhatsApp Cloud API for seamless user interactions with minimal friction.
  6. Hosting: Vercel Serverless for cost-effective deployment with automatic scaling.
  7. Frontend: Bootstrap 5 and Jinja2 for building responsive interfaces with dark and light mode support.

Key Features:

  1. WhatsApp AI Agent - Customers chat naturally, AI responds intelligently
  2. Photo-to-Product - Take a photo → AI extracts name, price, description, stock
  3. Bilingual Support - Full Indonesian + English with auto-detection
  4. Smart Fallback - If Gemini API is rate-limited, local intelligence handles basic queries
  5. Admin Dashboard - Manage products, view analytics, track conversations
  6. Order Management - AI can process orders and confirm with customers

How It Works (User Flow):

  1. Customer sends WhatsApp: "Ada sepatu sneakers?"
  2. AI Agent receives message via webhook
  3. Gemini processes: detects Indonesian, queries product DB
  4. AI finds: Sepatu Sneakers - Rp 450,000 (Stock: 3)
  5. Response sent: "Sepatu Sneakers masih ada 3 unit Kak. Harga Rp 450,000. Mau diorder? 😉"
  6. Customer replies: "Iya, mau 1"
  7. AI creates order, sends confirmation
  8. Owner gets notified via admin dashboard

Challenges we ran into

Challenge 1: WhatsApp Rate Limits Problem: Meta's Cloud API has strict rate limits (12 requests/minute for free tier). During testing, we hit limits quickly.

Solution: Built a smart rate limiter with queuing system. When rate-limited, requests are queued and retried with exponential backoff. Also implemented local fallback AI that handles simple queries without hitting the API.

Challenge 2: Language Detection in Code-Switching Problem: Indonesian users often mix languages: "How much harga kemeja batik?" — neither purely English nor Indonesian.

Solution: Priority-based detection: check for Indonesian keywords first (higher false positive risk with English), then fall back to English. Uses word-boundary regex matching to prevent "hi" in "shirt" from triggering Indonesian mode.

Challenge 3: Serverless Cold Starts Problem: Vercel's serverless functions have cold start delays. First request after idle takes 3-5 seconds.

Solution: Implemented health check pinging and optimized imports. Reduced cold start to ~1.5 seconds by lazy-loading heavy dependencies.

Challenge 4: Photo Product Extraction Accuracy Problem: Raw Cloud Vision API returns generic labels, not structured product data.

Solution: Passed Vision API results to Gemini with a structured prompt: "Extract product name, description, price range, and suggest stock from this image." Gemini transforms raw labels into structured JSON.

Challenge 5: Demo vs Production Gap (3/4) Problem: Demo mode works perfectly, but real WhatsApp integration requires Meta app review, business verification, and production phone numbers.

Solution: Built a hybrid architecture — demo page works instantly for judges, while WhatsApp integration works end-to-end for verified business accounts. Documented the full production setup path.

Accomplishments that we're proud of

  • Built a working WhatsApp AI agent in 48 hours using Gemini 2.5 Flash
  • True bilingual support (Indonesian + English) with auto-detection and code-switching
  • Photo-to-Product AI: take a photo → AI extracts name, price, description, stock automatically
  • Zero-friction: no app install needed, works directly on WhatsApp
  • Production-ready architecture with rate limiting, fallback AI, and Firestore persistence
  • Fully eligible for Gemini XPRIZE (Google Cloud Stack + underserved population impact)

What we learned

  • WhatsApp is the ultimate distribution channel in Southeast Asia — no app install = no friction
  • Gemini handles Indonesian-English code-switching remarkably well
  • AI Vision + LLM combo: pass raw image data to Gemini for structured output instead of perfecting OCR
  • Local fallback AI is essential — keeps the system working 99.9% even when API is rate-limited
  • UMKM owners need one thing done well, not a feature-heavy platform
  • Serverless (Vercel) is perfect for MVP — zero server management, free tier

What's next for UMKM COPILOT

  • Production WhatsApp token + real phone number (remove test limitations)
  • Multi-tenant platform: one bot serves thousands of UMKM shops simultaneously
  • Payment integration: QRIS, GoPay, OVO directly in chat
  • Voice message support — customer sends voice note, AI responds
  • Sales analytics dashboard with peak hours, popular products, revenue trends
  • Expand to Thailand, Vietnam, Philippines (WhatsApp-heavy markets)
  • Partner with Tokopedia, Shopee, Lazada for inventory sync

Built With

Share this project:

Updates