DEV Community

Barmaley26
Barmaley26

Posted on

I built an AI agent that answers my villa booking emails — Gemini + Google ADK

I host villas in Phuket. So I built an AI agent that answers my booking emails — with Gemini and Google ADK
published: true

tags: googlecloud, ai, agents, gemini

This article was created for the purposes of entering the **All Things Agentic Hackathon.

The chore

I'm a vacation-rental host in Phuket. Every week the same chain eats my hours:

read a guest email → decode vague dates ("around Christmas", "del 29 de diciembre al 5 de enero") → check the calendar → do seasonal price math with discounts → write a warm reply → remember to place a hold → follow up.

Every step is trivial. The chain is not. And one missed email is a lost $3,000+ booking.

That's exactly the "messy, multi-step chore" the hackathon's Taskmaster track describes. So I built the agent I needed myself.

What HostPilot does

A raw guest inquiry goes in — email or chat text, any language — and the agent handles it end-to-end:

  1. Extracts dates (including cross-year stays like Dec 29 → Jan 5), party size, guest name.
  2. Checks real availability against the bookings store.
  3. Builds a quote: high/low season rates, 10% long-stay discount, cleaning fee, min-stay and capacity validation.
  4. If the guest clearly wants to book — places a 48-hour hold in Firestore. A real state change, not just text.
  5. Replies in the guest's own language (English, Spanish, Chinese in the demo) with a full price breakdown.

My favorite moment: when requested dates conflict with an existing booking, the agent doesn't just say "unavailable" — it inspects the calendar, finds the nearest free windows on both sides, verifies and prices each one, and offers the guest two concrete alternatives.

Live demo: https://hostpilot-406193234542.asia-southeast1.run.app
Code: https://github.com/Barmaley26/hostpilot
Video: https://youtu.be/LGkHqfLt3mY

The architecture

  • Google ADK 2.6 defines the agent: one Agent, five plain-Python tools (get_property_info, check_availability, quote_price, create_booking, list_bookings).
  • Gemini 3.5 Flash (via Vertex AI) does the reasoning, multilingual parsing and reply generation through function calling.
  • Cloud Run hosts the whole app (FastAPI + a one-screen "host inbox" UI), deployed straight from source.
  • Firestore persists bookings across instances and restarts.

guest text → FastAPI → ADK Agent (gemini-3.5-flash)
├─ get_property_info
├─ check_availability ──► Firestore
├─ quote_price
└─ create_booking (48h hold) ──► Firestore
← reply in guest's language + full action log

Three things that bit me

1. The model has no clock. "December 20" was parsed as 2024. One line fixed year resolution, including cross-year stays:


python
instruction = f"Today's date is {date.today().isoformat()}. ..."

2. Free tiers are not for agents. One agent turn = 5–6 generations (planning + tool calls + final reply). The Gemini API free tier (20 requests/day) died mid-testing. Switching to Vertex AI with ADC on Cloud Run solved it properly: no API keys in the container at all, billing through the project.

3. Autonomy needs guardrails in code, not in prompts. Every tool returns explicit ok/reason dicts; create_booking re-validates availability server-side. The model physically cannot double-book, no matter what it decides.

The lesson

Agents become reliable when the LLM plans and the tools decide. Everything that must be true — availability, price, capacity — is enforced in deterministic, testable Python. Everything that must be human — tone, language, judgment about intent — is left to Gemini.

The result: a guest writing in Chinese gets a correct, warm, fully-priced booking hold in Chinese — while the host sleeps.

Built solo with Gemini 3.5 Flash, Google ADK, Cloud Run and Firestore for the All Things Agentic Hackathon.
Enter fullscreen mode Exit fullscreen mode

Top comments (0)