Build in Public · 2025-03-01
Building a WhatsApp AI booking agent from scratch
How I'm building an AI-powered WhatsApp agent that handles court bookings and community management for padel clubs — and what I've learned so far.
The idea
Padel clubs have a problem: they manage court bookings and player communication through a patchwork of WhatsApp groups, spreadsheets, and manual admin work. The person at the front desk is essentially doing the job of a CRM, a scheduler, and a community manager all at once.
I started building a WhatsApp AI agent to fix that. The agent handles incoming messages, understands booking intent, checks availability, confirms reservations, and sends reminders — all through the same WhatsApp thread the club already uses.
The architecture
The core loop is simpler than it sounds:
1. Incoming message → WhatsApp Business API webhook fires 2. Intent classification → LLM determines: is this a booking request, a cancellation, a question, or something else? 3. Tool execution → depending on intent, the agent calls the relevant function (check availability, create booking, send confirmation) 4. Response → natural language reply sent back via WhatsApp
The tech stack:
- WhatsApp Business API (via Meta Cloud API)
- Anthropic Claude for the LLM layer — tool use / function calling makes the intent-to-action loop clean
- Supabase for bookings data and availability logic
- AWS Lambda for the webhook handler (keeps it serverless and cheap to run)
- n8n for orchestrating some of the multi-step flows
What's working
The intent classification is surprisingly accurate. "Can I book a court tomorrow at 6?" and "I need a court for 4 people Saturday morning" both route correctly without any fine-tuning — just good system prompt engineering and Claude's reasoning.
Tool use (function calling) has been the right pattern here. Rather than trying to do everything in one LLM call, I define discrete tools (check_availability, create_booking, cancel_booking, list_upcoming_bookings) and let the model decide which to call. It makes the agent much more reliable and debuggable.
What's hard
State management. WhatsApp conversations are stateful but the webhook is stateless. I'm storing conversation history in Supabase and retrieving it on each message, but threading the state correctly across multi-turn conversations (e.g. "book me a court" → "which day?" → "tomorrow" → "what time?") took more work than expected.
Edge cases. Natural language is wild. "Book me something next week" — what does that mean exactly? I'm handling ambiguity by having the agent ask clarifying questions, but calibrating when to ask vs. when to make a reasonable assumption is an ongoing tuning process.
WhatsApp API rate limits and delivery guarantees. The Meta API has quirks. Message delivery isn't always instant, and some message types (like interactive buttons) only work in certain regions or with certain account configurations.
What's next
The core booking flow is working. Next up:
- Club admin dashboard — a simple web UI for club managers to see bookings, manage court availability, and review agent conversations
- Expanding beyond padel — the underlying architecture works for any business that manages appointments via WhatsApp (sports facilities, salons, restaurants for reservations)
- Early access — I'm looking for 2-3 padel clubs to pilot this
If you run a club or know someone who does, reach out. This is being built in public and I'd rather have real users shaping it than build in isolation.

