Multi-Agent Trip Planning with Budget-Constrained ReplanningID: 107

AI Multi-Agent Travel Planner

A multi-agent trip-planning system built on Google ADK that researches flights, hotels, and activities in parallel, then loops a budget-validation agent until the itinerary fits — with real flight/hotel/activity providers behind a deterministic mock fallback.

PythonGoogle ADKFastAPINext.jsOpenaiGPT-4oPydanticTypeScript
AI Multi-Agent Travel Planner
Click to watch in action

The Challenge

LLMs are unreliable at arithmetic and prone to hallucinating structured data, so a travel planner that lets the model both pick options and compute the running budget risks silently wrong totals — and real provider APIs (flights, hotels, activities) each have different auth, rate limits, and response shapes that can break a pipeline with no fallback.

The Solution

Split responsibility strictly: LLM agents only rank, filter, and justify — every dollar figure comes from a pure-Python calculate_budget() function, so the reported total always equals the sum of its parts. A Protocol-based provider seam lets flights (SerpApi/Sky Scrapper/Duffel), hotels (Hotelbeds/SerpApi), and activities (Tavily + a Gemini price-tier classifier) swap in as real data sources while a mock JSON dataset stays the default and automatic fallback, with a shared HTTP layer (timeout + bounded retry/backoff) so a slow or failing provider degrades gracefully instead of hanging the pipeline.

System Architecture

Intake & Research Agents

Parses natural-language trip requests into a structured schema, then runs flight, hotel, and activity search concurrently via a ParallelAgent.

Budget Loop Agent

A LoopAgent alternates an LLM selector with a pure-Python budget calculator, forcing the selector to trade down until the itinerary passes budget or the iteration cap is reached.

Itinerary & Write-up Agents

Builds a day-by-day plan with transport and cost breakdowns, then generates a final summary that stays honest about over-budget outcomes.

Key Outcomes

Guaranteed budget-arithmetic correctness by routing every cost total through deterministic Python instead of LLM generation, eliminating a whole class of hallucinated numbers.

Built a closed replanning loop where a selector agent and budget agent iterate automatically until the trip fits, or transparently reports infeasibility after a capped number of attempts.

Integrated five real provider APIs (SerpApi, Sky Scrapper, Duffel, Hotelbeds, Tavily) behind one provider interface, with mock data as a zero-cost default and automatic graceful degradation on provider failure.

Tech Foundation

AI Models
Gemini (default)GPT-4o (via LiteLLM)
Frontend
Next.jsTailwind CSSLeaflet
Backend
Google ADKFastAPIPydantichttpx