Skip to content

endx-star/Touri

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Touri — AI-Powered Travel Planner

Touri is a multi-agent AI travel planning system built with CrewAI and Groq. It orchestrates specialized AI agents to search for real flights, hotels, and build day-by-day itineraries — all through a Streamlit web interface.


Features

  • Multi-agent architecture — dedicated agents for flights, accommodation, and itinerary planning
  • Real data — live flight search via FlightAPI.io, hotel search via Booking.com (RapidAPI), weather via OpenWeatherMap
  • Currency conversion — automatic price conversion to 150+ world currencies via ExchangeRate API
  • PDF export — download your complete travel plan as a formatted PDF
  • Budget breakdown — visual pie chart of cost distribution across flights, accommodation, and activities
  • Weather forecast — 5-day forecast for your destination integrated into the overview

Project Structure

Travel Planner/
├── main.py                        # Entry point — validates env and launches Streamlit
├── pyproject.toml                 # Project metadata and dependencies (uv/pip)
├── .env                           # Your API keys (not committed)
├── .env.example                   # Template for required environment variables
│
├── app/
│   └── streamlit_app.py           # Full Streamlit UI — sidebar inputs, tabs, PDF download
│
└── src/
    ├── agents/
    │   ├── base_agent.py          # Base class — Groq LLM setup, retry logic, agent factory
    │   ├── flight_agent.py        # Searches for flights using FlightAPITool
    │   ├── accommodation_agent.py # Searches for hotels using BookingComTool
    │   └── itinerary_agent.py     # Builds day-by-day plans using WeatherTool
    │
    ├── crew/
    │   └── travel_crew.py         # Orchestrates agents, runs tasks sequentially,
    │                              # handles rate limits, currency conversion, plan assembly
    │
    ├── models/
    │   └── travel_model.py        # Pydantic models — TravelPlan, FlightOption,
    │                              # AccommodationOption, DailyItinerary, Activity, etc.
    │
    ├── tools/
    │   ├── flight_tool.py         # FlightAPI.io integration — one-way and round-trip search
    │   ├── booking_tool.py        # Booking.com RapidAPI — two-step city→hotel search
    │   ├── weather_tool.py        # OpenWeatherMap — 5-day forecast by city and date range
    │   └── currency_tool.py       # ExchangeRate API — USD to any currency conversion
    │
    └── utils/
        └── pdf_generator.py       # ReportLab-based PDF generation for travel plans

Prerequisites

  • Python 3.10–3.13
  • uv (recommended) or pip

Installation

Using uv (recommended):

uv sync

Using pip:

pip install -e .

Configuration

Copy .env.example to .env and fill in your API keys:

cp .env.example .env
# Required
GROQ_API_KEY=your_groq_api_key          # https://console.groq.com/keys

## Tools 
FLIGHT_API_KEY=your_flightapi_key       # https://flightapi.io
RAPIDAPI_KEY=your_rapidapi_key          # https://rapidapi.com (Booking.com API)
OPENWEATHER_API_KEY=your_openweather_key # https://openweathermap.org/api
EXCHANGE_RATE_API_KEY=your_exchange_key  # https://exchangerate-api.com

Running

uv run main.py

Then open http://localhost:8501 in your browser.


How It Works

  1. User fills in departure city, destination, dates, budget, currency, and preferences in the sidebar
  2. Three agents run sequentially, each in its own CrewAI crew with a 12-second pause between them to respect Groq's rate limits:
    • FlightAgent → calls FlightAPI.io, returns best flight option
    • AccommodationAgent → calls Booking.com, returns best hotel option
    • ItineraryAgent → calls OpenWeatherMap, builds a day-by-day activity plan
  3. Post-processing in TravelCrew._create_travel_plan:
    • Dates are corrected to match the actual trip start date
    • Prices are converted from USD to the user's selected currency via ExchangeRate API
    • Weather forecast is fetched directly and attached to the plan
  4. Results are displayed across four tabs: Overview, Flights, Accommodation, Itinerary
  5. PDF export is available from the Itinerary tab

Models Available

Configured in src/agents/base_agent.py. Switch via the model parameter in TravelCrew:

Key Model Notes
llama-70b llama-3.3-70b-versatile Default — best quality, 12k TPM free tier
llama-8b llama-3.1-8b-instant Faster, 6k TPM free tier
gpt-oss-20b openai/gpt-oss-20b Good balance
gpt-oss-120b openai/gpt-oss-120b Highest quality
llama-4-scout meta-llama/llama-4-scout-17b-16e-instruct Preview
qwen3 qwen/qwen3-32b Preview

Rate Limits

Groq's free tier has tight TPM (tokens per minute) limits. Touri handles this with:

  • 12-second sleep between agent tasks
  • Exponential backoff retry (up to 5 attempts) on rate limit errors
  • LiteLLM configured with num_retries=6

Upgrading to Groq's Dev tier removes these constraints.


Tech Stack

Layer Technology
AI Agents CrewAI
LLM Provider Groq (LiteLLM)
UI Streamlit
Data Models Pydantic v2
PDF Generation ReportLab
Charts Plotly
Package Manager uv

About

AI-powered travel planner using CrewAI multi-agent orchestration and Groq LLMs — searches real flights, hotels, and builds day-by-day itineraries with weather forecasts and currency conversion.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages