Skip to main content

Restaurant booking agent

A full agent that handles three things customers want from a restaurant on WhatsApp:
  1. Browse the menu (with filters: vegan, gluten-free).
  2. Check availability for a date and party size.
  3. Confirm a reservation with a code they can quote on arrival.
By the end you’ll have ~200 lines of TypeScript, no infrastructure to manage, and the whole thing deploys with one command.
The restaurant-booking template ships with the CLI:
This guide walks through what that template produces and how to evolve it into a production setup with real data.

What you’ll build

1. Scaffold

index.ts is the entire integration:
index.ts

2. Configure

3. Deploy

Watch the summary:

4. Test

Send a WhatsApp to the sender’s number:
hola, qué tienen vegano?
The agent answers, calls tools, and confirms a reservation.

Moving to production

The template uses in-memory state — fine for demo, useless in real life (cold starts wipe it).

Step 1: persist reservations

Add a real database. We’ll use Postgres via the postgres npm package:
package.json

Step 2: real availability

Replace the demo logic with a query against your reservations + capacity:

Step 3: send confirmation message

After creating a reservation, send a follow-up WhatsApp confirming the booking. The auto-provisioned ZAVUDEV_API_KEY already lets you do this:

Step 4: cancellation tool

Note the WHERE phone = ${ctx?.contactPhone} — customers can only cancel their own reservations, even if they get the right ID.

Step 5: opening hours guard

Add reasoning the LLM can’t accidentally bypass:
The LLM reads the message field and incorporates it into a natural-sounding reply. No need to add “and we’re closed Mondays” to the prompt — the tool itself enforces it.

Iterating fast

When you remove a tool from the code, npx zavudev deploy deletes it from the agent automatically. The summary will show:

Costs

For a busy restaurant doing ~50 customer conversations a day: Add your DB hosting (PlanetScale free tier works) and you’re under $10/mo for a fully automated booking agent.

Next

Customer support example

Knowledge base lookup + ticket creation.

Ecommerce example

Order tracking + smart recommendations.