A sophisticated multi-agent travel planning system built with LangGraph that orchestrates specialized AI agents to create personalized travel itineraries using real-time data.
This system uses a LangGraph-based multi-agent architecture where each agent specializes in a specific domain:
- Planner Agent: Orchestrates the workflow using Gemini AI
- Weather Agent: Fetches real-time weather data
- POI Agent: Discovers points of interest
- Itinerary Agent: Creates intelligent day-by-day plans
- Formatter Agent: Presents results in a user-friendly format
graph TD
A[User Query] --> B[Input Handler]
B --> C[Planner Agent]
C --> D[Weather Agent]
C --> E[POI Agent]
D --> F[Itinerary Agent]
E --> F
F --> G[Formatter Agent]
G --> H[Streamlit UI]
style C fill:#e1f5fe
style D fill:#f3e5f5
style E fill:#e8f5e8
style F fill:#fff3e0
style G fill:#fce4ec
- Sequential Planning: Planner decides which tools to use
- Parallel Execution: Weather and POI agents run simultaneously
- State Management: Shared memory through LangGraph TypedDict
- Intelligent Synthesis: Itinerary agent combines all data sources
- User-Friendly Output: Formatted for optimal readability
- Python 3.9+
- API Keys (see Setup Guide)
# Clone the repository
git clone https://github.com/92kareeem/agentic-travel-planner-syed-abdul-kareem.git
cd agentic-travel-planner-syed-abdul-kareem
# Install dependencies
pip install -r requirements.txt
# Set up environment variables
cp .env.example .env
# Edit .env with your API keys (see API Keys Setup section)
# Run the application
streamlit run app.py- Open http://localhost:8502 in your browser
- Enter a travel request like: "Plan a 3-day trip to Tokyo starting 2025-11-01, focus on temples"
- Watch the LangGraph agents work in parallel!
-
Google Gemini AI (Free tier available)
- Get key: https://aistudio.google.com/
- Usage: Planning and itinerary generation
-
OpenWeatherMap (Free: 1000 calls/day)
- Get key: https://openweathermap.org/api
- Usage: Real-time weather data
-
OpenTripMap (Free: 1000+ requests/day)
- Get key: https://opentripmap.io/docs
- Usage: Detailed POI data with coordinates
-
Serper (Free: 2500 searches)
- Get key: https://serper.dev/
- Usage: Enhanced search capabilities
Copy .env.example to .env and add your keys:
GEMINI_API_KEY=your_gemini_key_here
OPENWEATHERMAP_API_KEY=your_weather_key_here
OPENTRIPMAP_API_KEY=your_opentripmap_key_here
SERPER_API_KEY=your_serper_key_hereLangGraph Execution Flow:
- Planner β Decides: "Get weather + Find museum POIs"
- Weather Agent β Fetches: "Clear sky, 16Β°C, no precipitation"
- POI Agent β Finds: "Louvre, MusΓ©e d'Orsay, Centre Pompidou..."
- Itinerary Agent β Plans: Smart daily schedules considering weather
- Formatter β Outputs: Markdown table with timeline
Output:
**Weather**
- 2025-10-05: few clouds, 16.29Β°C, pop=0
- 2025-10-06: overcast clouds, 12.99Β°C, pop=0
- 2025-10-07: clear sky, 14.45Β°C, pop=0
**Points of Interest**
- Louvre Museum
- MusΓ©e d'Orsay
- Centre Pompidou
- MusΓ©e Rodin
- PanthΓ©on
**Itinerary**
| Day | Date | Morning | Afternoon | Evening |
|-----|------|---------|-----------|---------|
| 1 | 2025-10-05 | Louvre Museum | MusΓ©e d'Orsay | Seine River Walk |
| 2 | 2025-10-06 | Centre Pompidou | MusΓ©e Rodin | Montmartre District |
| 3 | 2025-10-07 | PanthΓ©on | Luxembourg Gardens | Farewell Dinner |
- API Failures: Automatic fallback to mock data
- Invalid Cities: Intelligent geocoding with multiple attempts
- Rate Limits: Exponential backoff retry logic
- Missing Keys: Wikipedia fallback for POI data
Input: "Plan trip to InvalidCityName123" System Response: Uses mock weather data + Wikipedia search, still generates useful itinerary
agentic-travel-planner/
βββ agents/ # LangGraph agent nodes
β βββ planner.py # Orchestration logic
β βββ weather_agent.py # Weather data fetching
β βββ poi_agent.py # Points of interest discovery
β βββ itinerary_agent.py # Itinerary generation
β βββ formatter.py # Output formatting
βββ utils/ # Shared utilities
β βββ api_clients.py # API integration layer
β βββ state.py # LangGraph state schema
β βββ logger.py # Logging configuration
βββ docs/ # Documentation
β βββ design.md # Detailed design document
βββ examples/ # Example outputs
βββ main.py # LangGraph workflow orchestrator
βββ app.py # Streamlit web interface
βββ requirements.txt # Dependencies
- π Parallel Processing: Weather and POI agents execute simultaneously
- π§ Intelligent Planning: Gemini AI decides optimal agent workflows
- π Real-time Data: Live weather forecasts and POI information
- π‘οΈ Robust Fallbacks: Graceful handling of API failures
- π¨ User-friendly UI: Clean Streamlit interface
- β‘ High Performance: LangGraph optimized execution
- Users provide valid city names in English
- Trip duration is reasonable (1-14 days)
- Internet connectivity is available
- API rate limits are respected
- English language only
- Limited to city-based travel (no multi-city routes)
- Weather forecasts limited to 5-day horizon
- POI data quality depends on OpenTripMap coverage
- Multi-language support: Internationalization
- Multi-city routes: Complex itinerary planning
- Hotel integration: Accommodation recommendations
- Transportation: Flight and train bookings
- Budget optimization: Cost-aware planning
- User preferences: Learning from past trips
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For questions or issues:
- π§ Email: [email protected]
Built using LangGraph, Streamlit, and modern AI APIs
This project implements a LangGraph-style multi-agent travel planner. It uses Gemini (via google-generativeai) as the primary LLM to plan tool calls and create itineraries. Weather and POI agents fetch real-time data. The Streamlit UI provides a simple chat interface for interaction.
- Input parsing (city, dates, preferences)
- Gemini-powered Planner and Itinerary nodes
- Weather agent (OpenWeatherMap)
- POI agent (Serper / Wikipedia fallback)
- Simple LangGraph-like orchestrator (main.py)
- Streamlit chat UI (app.py)
- Robust error handling and mock fallbacks
- Clone or download this repository.
- Create a
.envfile from.env.exampleand fill your API keys. - (Optional) create a virtualenv and install dependencies:
python -m venv .venv source .venv/bin/activate # or .venv\Scripts\activate on Windows pip install -r requirements.txt
- Run the Streamlit UI:
streamlit run app.py
- If Gemini is not configured or the client isn't installed, the planner will fall back to a deterministic mock planner.
- If OpenWeatherMap or Serper calls fail, deterministic mock data is used and the UI will show messages indicating mock results.
- The code is modular and intended to be replaced with
langgraphnodes if you want to plug in the LangGraph library later.
app.py: Streamlit UI and chat logicmain.py: Orchestrator that runs the LangGraph-like pipelineagents/: agent implementationsutils/: API clients, schema validation & helpers.env.example: example env vars