Skip to content

An AI-powered travel planning application that uses Gemini LLM and CrewAI to automate trip planning with multiple specialized AI agents. This project demonstrates agentic AI collaboration to search flights, find hotels, and generate personalized travel itineraries.

Notifications You must be signed in to change notification settings

arjunprabhulal/gemini-crewai-travelplanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi-Agent AI Travel Planner

An agentic AI travel planning application using Gemini LLM and CrewAI framework. This project demonstrates how AI agents collaborate to streamline the travel planning process - retrieving real-time flight and hotel data, analyzing options, and generating personalized itineraries.

Travel Planner Demo

Demo

Travel Planner in Action

Overview

This project demonstrates how to build a multi-agent system where specialized AI agents work together to create comprehensive travel plans. Instead of manually searching across multiple platforms, this application automates the process through intelligent AI collaboration.

The system leverages:

  • Gemini 2.0 LLM: Powers the intelligence behind each agent
  • CrewAI: Coordinates the multi-agent workflow
  • SerpAPI: Retrieves real-time flight and hotel data
  • FastAPI: Handles backend API endpoints
  • Streamlit: Provides a user-friendly interface

Key Features

1. Flight Search Automation

  • Retrieves real-time flight data from Google Flights via SerpAPI
  • Filters flights based on price, layovers, and travel time
  • AI recommends the best flight based on cost-effectiveness and convenience

2. Hotel Recommendations

  • Searches real-time hotel availability from Google Hotels
  • Filters based on location, budget, amenities, and user ratings
  • AI suggests the best hotel by analyzing factors like proximity to key locations

3. AI-Powered Analysis & Recommendations

  • Gemini LLM-powered AI agent evaluates travel options
  • Uses CrewAI to coordinate multiple AI agents for better decision-making
  • AI explains its recommendation logic for flights and hotels

4. Dynamic Itinerary Generation

  • AI builds a structured travel plan based on flight and hotel bookings
  • Generates a day-by-day itinerary with must-visit attractions, restaurant recommendations, and local transportation options

5. User-Friendly Interface

  • Streamlit provides an intuitive UI for inputting travel preferences
  • Interactive tabs for viewing flights, hotels, and AI recommendations
  • Downloadable formatted itinerary

Based On

This project is based on the article: Agentic AI: Building a Multi-Agent AI Travel Planner using Gemini LLM & Crew AI

Installation

Prerequisites

  • Python 3.8+
  • SerpAPI key for fetching real-time flight and hotel data
  • Google Gemini API key for AI recommendations

Setup

  1. Clone the repository
git clone https://github.com/arjunprabhulal/gemini-crewai-travelplanner.git
cd gemini-crewai-travelplanner
  1. Create and activate a virtual environment
# Create virtual environment
python -m venv venv

# Activate virtual environment
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate
  1. Install dependencies
pip install -r requirements.txt
  1. Configure API keys Set your API keys in the gemini2_travel_v2.py file:
# Load API Keys
GEMINI_API_KEY = os.getenv("GOOGLE_API_KEY", "your_gemini_api_key_here")
SERP_API_KEY = os.getenv("SERP_API_KEY", "your_serpapi_key_here")

Usage

  1. Start the FastAPI backend
python gemini2_travel_v2.py
  1. In a new terminal window, start the Streamlit frontend
python gemini2_travel_v2_frontend.py
  1. Open your browser and navigate to http://localhost:8501

  2. Enter your travel preferences:

    • Input departure and destination airports
    • Set travel dates
    • Select search mode (complete, flights only, or hotels only)
    • Click "Search" and wait for the AI to process your request
  3. Review the personalized results:

    • Flight options with AI recommendations
    • Hotel options with AI recommendations
    • Day-by-day itinerary with activities and restaurant suggestions

Architecture

Multi-Agent System

The application uses a collaborative AI system with specialized agents:

  1. Flight Analyst Agent:

    • Analyzes flight options based on price, duration, stops, and convenience
    • Provides structured recommendations with reasoning
  2. Hotel Analyst Agent:

    • Evaluates hotel options based on price, rating, location, and amenities
    • Offers detailed hotel recommendations with pros and cons
  3. Travel Planner Agent:

    • Creates comprehensive itineraries using flight and hotel information
    • Schedules activities, meals, and transportation for each day of the trip

Project Structure

  • gemini2_travel_v2.py: FastAPI backend application with API endpoints, data fetching, and AI agent coordination
  • gemini2_travel_v2_frontend.py: Streamlit frontend interface for user interaction
  • requirements.txt: Project dependencies
  • images/: Directory containing demonstration images and GIFs
    • travelplanner.webp: Static screenshot of the application interface
    • travelplanner-demo.gif: Animated demonstration of the application in use

Implementation Details

The application follows a modular architecture:

  1. API Initialization:

    • FastAPI setup with endpoints for flight search, hotel search, and itinerary generation
  2. Data Retrieval:

    • Asynchronous functions connect to SerpAPI to fetch real-time flight and hotel data
    • Response formatting and data validation using Pydantic models
  3. AI Analysis:

    • CrewAI orchestrates specialized AI agents
    • Each agent analyzes specific aspects of the travel plan
    • Gemini LLM powers the intelligence of each agent
  4. Frontend Interface:

    • Streamlit UI with interactive forms and tabs
    • Real-time data display with filtering options
    • Downloadable itinerary generation

Repository

This code is available on GitHub at arjunprabhulal/gemini-crewai-travelplanner.

Author

For more articles on AI/ML and Generative AI, follow me on Medium: https://medium.com/@arjun-prabhulal

About

An AI-powered travel planning application that uses Gemini LLM and CrewAI to automate trip planning with multiple specialized AI agents. This project demonstrates agentic AI collaboration to search flights, find hotels, and generate personalized travel itineraries.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages