AI Receptionist Booking Backend

Your voice agent sounds great until the platform retries a booking, two callers grab the last slot, or it offers 2:30 AM on the night the clocks change. This is the booking backend behind an AI receptionist, already tested against those calls.

AI Receptionist Booking Backend cover

What goes wrong on real calls

44 tests, all offline. ./run_tests.sh runs them over real HTTP on localhost with Retell- and Vapi-shaped payloads.

What goes wrong on real callsWhat this backend doesTest
The platform retries a tool call after a timeout (Retell max_retry, network blips)Idempotent: the same call + function + args returns the first bookingtest_retry_with_same_idem_key_never_double_books, live HTTP retry test
Two callers grab the last slot at the same momentBookings run in BEGIN IMMEDIATE transactions: one wins, the other is offered alternatives12-thread race test
The agent offers 2:30 AM on a DST night, or skips an hourSlots computed in UTC instants: 23 hourly slots on spring-forward day, 25 on fall-back day, nonexistent local times refusedDST tests (Mar 14 2027, Nov 1 2026)
Lunch breaks, holidays, buffers between appointments, "can't book within 2 hours"All in one config, validated at start-upslot tests
The owner's own calendar (conference day, staff training)Import their private ICS address as busy time (TZID, UTC, all-day, DURATION, transparent/cancelled skipped)ICS tests
A caller cancels someone else's booking by guessing a codeCancel/reschedule require the booking's phone number; a wrong number gets the same answer as a missing bookingleak test
Reschedule fails half-way and the caller loses both timesAtomic move: the old time is kept unless the new one is bookedatomic reschedule test
Late cancellationsPolicy window (e.g. 24 h) hands the request to a person as a messagelate-cancel test
"My face is swelling" at 10 PMEmergency keywords transfer day or night; "talk to a person" transfers in hours and takes a message afterrouting tests
Names and numbers leaking into logs and SlackLogs keep codes and refs only; notifications mask phones and scrub numbers/emails/cards from messagesPII tests
Forged webhooksRetell X-Retell-Signature (HMAC-SHA256, 5-minute window) and Vapi Bearer / X-Vapi-Secret, constant-time comparesignature tests
Vapi says "no result returned"Vapi replies are always HTTP 200 with a flat one-line result or error per toolCallIdmulti-tool-call test

The 6 functions

Retell and Vapi tool definitions are included, ready to paste.

  • check_availability
  • book_appointment
  • reschedule_appointment
  • cancel_appointment
  • take_message
  • route_call

What you get

  • receptionist/: the backend: slots.py (availability), store.py (SQLite), tools.py (the 6 functions), adapters.py (Retell + Vapi), ics.py, redact.py, server.py
  • config.example.json: a worked example (dental office: split hours, holidays, 3 services with buffers, emergency routing)
  • tools/retell-functions.json: the 6 custom functions with parameter schemas, ready to paste into Retell
  • tools/vapi-tools.json: the same 6 as Vapi function tools
  • prompts/receptionist-prompt.md: the agent prompt that matches the tools
  • skills/voice-receptionist-setup/SKILL.md: an agent skill (Claude Code, Codex, Cursor) that onboards a new client business step by step
  • scripts/simulate.py: an offline call: availability, book, retry, reschedule, emergency, cancel
  • tests/: 44 tests + payload fixtures
Terminal output of simulate.py and the 44 passing tests

Quick start

Then go live: host it anywhere that runs Python 3.9+ with a public HTTPS URL, set RETELL_API_KEY and/or VAPI_SECRET, and point Retell custom functions or Vapi tools at it (step-by-step in the README).

./run_tests.sh                      # 44 tests + config check
python3 scripts/simulate.py         # see what the agent would say
cp config.example.json config.json  # then edit: hours, services, holidays, routing
python3 -m receptionist.server --config config.json --check

Already on Cal.com and Retell only?

Already on Cal.com and Retell only? Retell’s native Cal.com integration may be all you need. Pick this backend when you use Vapi, want your own booking data, or need the policy rules (emergency transfer, late-cancel window, buffers, holidays).

Honest limits

  • No direct Google Calendar or Outlook write in v1. The backend is the booking source of truth; the owner sees bookings through the ICS feed (calendar apps refresh subscribed feeds on their own schedule, often hours) and blocks time through their own ICS export.
  • Imported calendars: recurring events (RRULE) only block their first occurrence. The config check prints a warning for each.
  • One shared capacity per business (e.g. 2 chairs). Per-staff calendars and "book with Dr. X" are not in v1.
  • Keyword routing is literal: it matches the words you configure, it does not understand meaning. Keep the emergency list broad.
  • No payments, deposits, SMS or reminders. Use the notification webhook to trigger those in n8n/Make/Zapier.
  • Your voice platform and model decide what the agent says between tool calls; this backend only makes the tool answers correct.
  • You are responsible for call-recording consent and data rules where you operate (e.g. HIPAA if you handle patient data: this kit stores names, numbers and a short note in SQLite on your server and is not a compliance product).

Requirements

Python 3.9+ (tested on 3.10 and 3.13). On Windows also pip install tzdata. No dependencies. Not affiliated with Retell AI or Vapi.

Format and license

Zip, 37 KB, v1.0, 26 files. Use and modify it for yourself and for your clients, including paid client projects; no resale or redistribution of the kit itself. Full terms in LICENSE.txt.

FAQ

Does it work with Retell AI and Vapi?
Yes, both. Tool definitions for each are included.
Do I need Cal.com or Calendly?
No. The backend is the booking source of truth; owners subscribe to its ICS feed and can block time with their own calendar’s ICS export.
Google Calendar sync?
Not two-way in v1 (see Honest limits).
Is it HIPAA compliant?
It’s not a compliance product. It stores names, numbers and a short note on your server.
Can I resell it to clients?
Use it for clients you serve; don’t resell the kit itself.
How do I get the files?
Right after payment, Stripe’s confirmation page shows your download link.
Refunds?
Email hello@youraitools.co within 14 days if it doesn’t work and we can’t fix it.
Can I pay with crypto?
Yes. Pay the same price in USDC or USDT on Base, Ethereum, Arbitrum, Optimism, Polygon or Solana from the "Pay with crypto" button, with no account or KYC. We check the payment on-chain and show your download links as soon as it confirms.

Get AI Receptionist Booking Backend

Booking backend for Retell AI and Vapi receptionists: availability, book, reschedule, cancel, transfer. Retry-safe, 44 tests (Python).

Save with a bundle

Pairs well with

Download$69

AI Agent Guardrails Bundle

AI agent guardrails you can test: Claude Agent SDK hooks, LangGraph undo/approval patterns, agent safety skills and an autonomy ladder. 4 kits, $69 ($124 separately).

View AI Agent Guardrails Bundle
Download$59

x402 Developer Bundle

Build with x402 payments: builder skills, a paid agent API starter, Hermes and ElizaOS plugin templates. 4 tested kits, $59 ($96 separately).

View x402 Developer Bundle
Download$19

n8n AI Agent Workflows Pack

4 importable n8n AI agent workflows: FAQ support agent, Gmail AI triage, AI lead qualification with rule-based scoring, feedback sentiment router. Tested. $19.

View n8n AI Agent Workflows Pack

Related