An AI-powered travel assistant that plans end-to-end trips (flights, hotels, car rentals) based on user preferences, with multilingual support and rich UI rendering on the web.
AI-Trip-Planner/
backend/
app/
__init__.py
main.py # FastAPI app entry
agents.py # Guardian Agent, TravelAgent wiring
travelAgent.py # TravelAgent logic and tool usage
models/
Activity.py
Chat.py
Message.py
frontend/
src/
App.tsx
components/
AIChatbot.tsx
ItineraryBuilder.tsx
figma/ImageWithFallback.tsx # hotel image fallback
ui/ ... (shadcn/ui components)
styles/globals.css
main.tsx
index.html
vite.config.ts
- User converses in the web UI (
AIChatbot.tsx). - Backend (FastAPI) orchestrates an LLM-based flow to:
- understand intent and preferences (dates, budget, cabin class, chains, car class, etc.),
- fetch flight/hotel/car options via connected tools,
- evaluate and rank options against user preferences,
- build an itinerary and stream results back to the UI.
- Guardian Agent → TravelAgent → Tools
Flow:
-
Guardian Agent
- Validates and guards prompts, enforces policies and safety.
- Sets constraints and high-level objectives for planning.
-
TravelAgent (planner/executor)
- Decomposes the task (transport → stay → ground).
- Calls domain tools, merges results, and produces the trip plan.
-
Connected Tools (used by TravelAgent)
- MCP: external data access (e.g., flight/hotel/car providers) and utilities.
- pick_options: scores and re-ranks candidate options based on user preferences.
- trip_plan: composes the final, day-by-day plan and summaries.
Guardian Agent → TravelAgent → [ MCP | pick_options | trip_plan ] → Ranked options + Itinerary
- Flights: balances price, departure/arrival windows, cabin class, baggage, airline preference, and number of stops (prefers direct when requested).
- Hotels: considers price/night, location proximity, rating, amenities, cancellation policy, and brand/chain preferences; images are rendered in UI with a fallback.
- Car rentals: weighs price, pickup/dropoff alignment, transmission/class preference, mileage/insurance rules, and provider reliability.
- Re-ranking is adaptive: the system re-scores results when the user changes constraints (e.g., “evening flight”, “walkable to city center”).
- Multilingual conversation handling: prompts and responses support multiple languages; Turkish and English are first-class.
- The UI and agent respond in the user’s language when possible.
- The frontend uses
components/figma/ImageWithFallback.tsxto display hotel images. - Graceful fallback avoids layout shifts or broken images, improving UX for listings and plan cards.
- React + Vite + TypeScript.
- Components:
AIChatbotfor conversation,ItineraryBuilderfor structured trip output. - Reusable
ui/components (shadcn/ui) for a modern, consistent interface.
- FastAPI application (
app/main.py). - Agents defined in
app/agents.py; planning logic inapp/travelAgent.py. - Pydantic models in
backend/modelsfor chats, messages, and activities.
- This README focuses on architecture and capabilities. Internal endpoints, auth, and provider credentials are expected to be configured per environment.