Build · 3h 30m · ₹0
An AI voice agent that handles hotel and restaurant bookings through natural, real-time conversation on a live speech pipeline with automated SMS confirmations via Twilio.
What it does
The mechanics, data flow, and user interaction model behind SARA AI.
Guests call in or speak through a web interface and book rooms or tables the way they'd talk to a front-desk agent: no forms, no hold music. The system tracks multi-turn conversations (so a guest can change their mind mid-booking, ask follow-up questions, or add special requests without restarting), checks availability in real time, and applies a configurable pricing/negotiation layer that can offer discounts within bounds the property sets, rather than a fixed rate-card. Once a booking is confirmed, the guest gets an SMS confirmation automatically. A separate admin dashboard gives staff visibility into bookings as they come in.
Technical Highlights
- Real-time streaming voice pipeline (STT → LLM → TTS) with session/context management across multi-turn dialogue
- Rule-based dynamic pricing engine with configurable negotiation bounds by room type/season
- Guest-facing web interface + separate admin dashboard for staff
- Automated SMS confirmation flow via Twilio
Why it matters
The architectural judgment, practical engineering decisions, and core problems solved.
Hotels—especially smaller or boutique properties—lose bookings to unanswered calls and slow response times, particularly outside business hours. A voice agent that can hold a real conversation (not an IVR menu tree) closes that gap: it's always available, it doesn't put guests through 'press 1 for reservations,' and it can flex on price within limits instead of forcing a take-it-or-leave-it rate.
Boutique hotels & independent resorts
Small hotel chains & bed-and-breakfasts
Restaurant reservation & dining tables
Resort package & weekend getaway bookings
System architecture
End-to-end execution pipeline running across LiveKit, Deepgram, Gemini, Cartesia, Twilio.
WebRTC audio transport and bi-directional real-time agent session orchestration
Streaming speech-to-text with voice activity detection (VAD) and sub-300ms latency
Multi-turn intent recognition, availability tool calling, and discount negotiation logic
Ultra-low latency expressive text-to-speech with natural conversational pacing
Telephony SIP trunking and automated instant SMS booking confirmation flow
The path
Step-by-step implementation guide. Verbatim code snippets, configurations, and prompts.
Provisioning the LiveKit Agent & Speech Pipeline
Spin up a LiveKit Cloud session and connect Deepgram Nova-2 for streaming STT and Cartesia for sub-200ms voice synthesis. Configure turn-detection with endpointing so the agent doesn't interrupt natural mid-sentence pauses.
Verbatim Code / Config
Configure LiveKit voice agent session with Deepgram STT (model: 'nova-2', endpointing: 400ms) and Cartesia TTS (model: 'sonic-english'). Enable bi-directional audio streaming with interruption detection.Prompt Engineering the Front-Desk Agent in Gemini
Author the system instructions defining SARA's persona: polite, concise, natural front-desk coordinator. Provide strict schema for room/table availability tools and date parsing.
Verbatim Code / Config
You are SARA, an AI front-desk reservation agent for Grand Vista Hotel. Greet guests warmly, answer room/amenities questions concisely (1-2 sentences per turn), and check check-in/check-out dates. Never list raw JSON. If a guest asks for a discount, check get_discount_bounds() before confirming any rate.Dynamic Pricing & Negotiation Boundary Tool
Implement a deterministic tool function for Gemini that evaluates stay length, room category, and occupancy rate to return a permissible discount window (max 15%) without letting the model invent arbitrary rates.
Verbatim Code / Config
def calculate_rate(room_type: str, nights: int, requested_discount: float) -> dict:
# Rule-based guardrail: limit maximum discretionary discount to 15%
allowed_discount = min(requested_discount, 0.15 if nights >= 3 else 0.05)
final_rate = base_price * (1 - allowed_discount)
return {'rate': final_rate, 'confirmed': True}Twilio SMS Confirmation & Admin Dashboard
Hook up the post-reservation webhook to trigger a Twilio SMS dispatch with booking reference number, check-in date, and Google Maps location link. Feed real-time reservation logs to the staff dashboard.
Verbatim Code / Config
client.messages.create(to=guest_phone, from_=twilio_number, body=f'Confirmed! Booking #{ref_id} at Grand Vista Hotel for {dates}. Check-in at 2:00 PM. See you soon!')Where it broke
The failure mode, root-cause breakdown, and resolution discovered during development.
The Tell
“The model accepted an absurd 60% discount request from a guest when asked repeatedly with polite pressure.”
Why it failed
Because the LLM had room rate information in its system prompt without a hard programmatic clamp, prolonged multi-turn conversational pressure convinced the model to override its instructions and offer 60% off.
The Fix
Stripped rate calculation authority from the LLM prompt. All discounts are now calculated exclusively inside a deterministic tool function ('calculate_rate') with hard server-side floor bounds. The model can only report the function's return value.
What it cost
₹0 to build and run permanently within verified free tiers.
| Service / Tool | Cost | Free Tier Limits |
|---|---|---|
| LiveKit Cloud | ₹0 | 100 free monthly agent minutes |
| Deepgram Nova-2 | ₹0 | ₹16,000 ($200) free trial credits |
| Google Gemini API | ₹0 | Free tier (15 RPM / 1M TPM) |
| Cartesia Sonic | ₹0 | Free starter tier |
| Twilio | ₹0 | Free trial balance covers demo SMS |
Make it yours
Three concrete variations you can build and ship using this exact foundation.
- 01
Doctor Clinic Appointment Voice Agent: Replaces room types with doctors/specialties and patient slots with calendar sync.
- 02
Salon & Spa Booking Assistant: Handles stylist selection, service packages, and SMS reminders with cancellation links.
- 03
Car Rental Scheduler: Handles vehicle category selection, pickup dates, and deposit calculation with instant SMS receipts.
Where next
Ready to ship SARA AI?
Review the architecture, clone the prompt and implementation steps, and deploy your live URL for ₹0.