Voice AI Agent for Appointment Booking
An automated Voice AI agent handles appointment scheduling over the phone, checks real-time availability against a clinic calendar, confirms the booking only after explicit patient agreement, and delivers booking reference IDs.
What it does
- Greets the caller and gathers patient name, phone number, preferred date/time, and appointment type
- Respects all information given upfront in a single utterance (never re-asking details already provided)
- Queries open slots from the calendar in real-time (never inventing availability)
- Confirms details explicitly before writing to the calendar
- Reads back the confirmed booking reference ID over the phone
- Optionally delivers an instant Telegram confirmation with event IDs
- Delivers a polite goodbye and disconnects cleanly
This sample
Amy at HealthFirst Clinic on AgentDuet with Gemini Live and Google Calendar (or an in-memory calendar backend). Optional Telegram confirmation. Full source: agentduet-samples / appointment-booking.
State flow: NEW → LIVE (answer()) → Gemini Live bidirectional scheduling loop → disconnect() / close()
Prerequisites
- Python 3.12+
- Get an API key and connector UUID at agentduet.com
- Google Gemini API key (Google AI Studio, Gemini Live)
- Optional: Google Calendar API service-account JSON (Google Cloud Console)
- Optional: Telegram bot token and chat ID for confirmation messages
Tutorial
Step 1: Clone the sample
Step 2: Install
Step 3: Configure .env
Share the target calendar with the service account email (Make changes to events).
Step 4: Run
Step 5: Place a call and test
Call your connector number. Amy should greet as HealthFirst. Try:
After a successful booking, Amy reads back the booking ID and concludes the call. If Telegram is configured, the booking confirmation arrives in chat.
How it works
Gemini Live streams PCM audio bidirectionally over WebSockets. Structured tool calls handle calendar operations and call lifecycle. When a slot is confirmed, the calendar backend writes the appointment and returns a verified booking ID. Once the booking is read back and acknowledged, the agent speaks its closing greeting and disconnects cleanly.
