Guides / AI & automation
How to Build a WhatsApp AI Chatbot with Google Gemini
A WhatsApp chatbot that actually knows your products - prices, delivery charges, policies - and answers customers 24/7 used to be an enterprise project. With Google Gemini's free API tier and a QR-linked WhatsApp gateway, you can launch one in about 15 minutes without writing code.
What you'll build
- A bot on your own WhatsApp number that answers incoming messages using Google Gemini.
- Grounded in your knowledge base - it quotes your real prices and policies instead of inventing them.
- With conversation memory ('how much is the second one?' works), photo understanding, business-hours rules, and human takeover.
Step 1 - Get a free Gemini API key
Go to aistudio.google.com/apikey, sign in with any Google account, and create a key. The free tier comfortably covers a small business's daily chat volume with a fast model like gemini-2.0-flash.
Step 2 - Connect your WhatsApp number
Create an account on the platform, open Dashboard → Connection, and scan the QR code with the WhatsApp app - the same pairing used by WhatsApp Web. Use a dedicated business number rather than your personal one.
Step 3 - Configure the bot
Open Dashboard → AI Chatbot and fill in three things:
- Gemini API key - the key from step 1. It's yours, so there's no per-reply markup.
- System prompt - the bot's personality: 'You are the friendly assistant for Athens Leather Store. Be brief, warm, and always answer in the customer's language.'
- Knowledge base - plain bullet points of facts: products, prices, sizes, delivery charges, return policy, address, opening hours.
- We sell handmade leather shoes. Sizes 39-45.
- Classic Oxford: Rs 8,500. Loafers: Rs 7,200. Chelsea boots: Rs 11,000.
- Delivery: Rs 300 nationwide, 3-5 working days. Cash on delivery available.
- Returns within 7 days if unworn, buyer pays return shipping.
- Shop: Shop 12, Liberty Market, Lahore. Open 11am-9pm, closed Friday.💡 The bot is explicitly instructed to never invent prices or policies that aren't in the knowledge base - if something isn't covered, it says a human will follow up. That single rule prevents most chatbot embarrassments.
Step 4 - Turn on the power features
- Conversation memory - keeps the last ~10 messages per chat so follow-up questions resolve correctly.
- Understand images - customers send a photo of a product or a payment receipt; Gemini's vision looks at it and the bot responds accordingly.
- Business hours - typical setup: the bot answers only outside 9:00-18:00, and your team handles chats live during the day.
- Blacklist - your own numbers, family, and suppliers never get a bot reply.
Step 5 - Test and hand off gracefully
Message your number from another phone: ask a price, send a follow-up, send a photo. Then open Dashboard → Inbox - replying manually from there automatically pauses the AI for that conversation for 6 hours, so bot and humans never talk over each other. A per-chat toggle hands control back whenever you want.
Why this beats building it yourself
The DIY route means running a WhatsApp Web bridge (and keeping the session alive), wiring Gemini's API with conversation state storage, handling media downloads and encryption, plus rate-limiting so your number doesn't get banned. All of that is exactly what the platform already does - your job reduces to writing good knowledge-base bullets.
Try it with your own number
Free account, QR-code setup, plans from Rs 1,500/month. Everything in this guide works out of the box.