Planning a trip can be overwhelming and time-consuming, requiring users to:
- Research destinations and attractions
- Compare flight options and prices
- Find suitable accommodations
- Discover local restaurants and activities
- Calculate budgets and travel times
- Coordinate multiple aspects of the trip
Traditional travel planning often involves:
- Visiting multiple websites
- Manually comparing options
- Dealing with information overload
- Making decisions without comprehensive context
- Spending hours on research and coordination
TripIntel AI is an intelligent travel planning assistant that uses advanced AI and natural language processing to create personalized travel itineraries. It leverages LangGraph for orchestration and Claude for natural language understanding to provide a seamless, conversational travel planning experience.
-
Natural Language Interface
- Conversational interaction with the AI assistant
- Understands complex travel queries and preferences
- Handles follow-up questions and modifications
-
Intelligent Itinerary Planning
- Multi-day trip planning with daily schedules
- Smart activity sequencing and time management
- Balance between popular attractions and local experiences
-
Comprehensive Travel Components
- Flight search and booking recommendations
- Hotel and accommodation options
- Local attractions and activities
- Restaurant recommendations
- Route planning and transportation options
-
Interactive Planning Process
- Real-time feedback and modifications
- Budget considerations and adjustments
- Preference-based customization
- Validation of travel parameters
The system is built using a LangGraph pipeline with the following components:
-
Core Nodes
ChatInputNode: Processes natural language input from usersIntentParserNode: Extracts structured travel intent from user queriesTripValidatorNode: Validates trip parameters and handles missing informationAgentSelectorNode: Determines which specialized nodes to call based on user needs
-
Specialized Agent Nodes
FlightsNode: Searches and recommends flight optionsHotelNode: Finds suitable accommodation optionsAttractionsNode: Discovers local attractions and activitiesRestaurantsNode: Finds dining optionsItineraryPlannerNode: Creates daily schedules and manages the overall itinerary
-
Support Nodes
ProcessResponseNode: Handles user feedback and additional informationEndNode: Finalizes the planning process and returns the complete itinerary
The graph follows a sequential flow:
- User input is processed through core nodes
- Validation ensures all necessary information is available
- Specialized agents gather travel components in sequence:
- Flights → Hotels → Attractions → Restaurants
- The itinerary planner creates a cohesive schedule
- User feedback is handled through the process response node
- The process continues until all days are planned
- Backend Framework: FastAPI
- AI/ML:
- LangGraph for workflow orchestration
- Claude for natural language processing
- Gemini for additional AI capabilities
- APIs:
- Google Places API for location data
- Flight booking APIs
- Maps and routing services
- Frontend: Modern web interface with real-time updates
-
Prerequisites
- Python 3.8+
- API keys for required services
- Virtual environment
-
Installation
git clone https://github.com/yourusername/tripintel-ai.git cd tripintel-ai python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
-
Configuration Create a
.envfile with your API keys:GEMINI_API_KEY=your_gemini_api_key GOOGLE_PLACES_API_KEY=your_google_places_api_key PERPLEXITY_API_KEY=your_perplexity_api_key -
Running the Application
# Development mode DEV_MODE=true python run.py # Production mode python run.py
We welcome contributions! Please see our Contributing Guidelines for details.
This project is licensed under the MIT License - see the LICENSE file for details.
- LangGraph team for the workflow orchestration framework
- Anthropic for Claude AI capabilities
- Google for Places API and mapping services
This application uses a LangGraph pipeline to create travel itineraries based on natural language queries. The pipeline consists of several nodes that handle different aspects of the travel planning process:
- ChatInputNode: Accepts natural language input
- IntentParserNode: Extracts structured travel intent from user input
- TripValidatorNode: Validates trip parameters
- PlannerNode: Decides which agent nodes to call
- Agent Nodes:
- FlightsNode: Finds flight options
- RouteNode: Calculates route information
- PlacesNode: Finds attractions using Google Places API
- RestaurantsNode: Finds dining options using Google Places API
- HotelNode: Finds accommodation using Google Places API
- BudgetNode: Calculates budget estimates
- SummaryNode: Generates a natural language itinerary
- Clone the repository:
git clone https://github.com/yourusername/ai-travel-planner.git
cd ai-travel-planner- Create a virtual environment and install dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt- Create a
.envfile with your API keys:
GEMINI_API_KEY=your_gemini_api_key
GOOGLE_PLACES_API_KEY=your_google_places_api_key
PERPLEXITY_API_KEY=your_perplexity_api_key
- Gemini API Key: Get one from the Google AI Studio
- Google Places API Key: Get one from the Google Cloud Console with the Places API enabled
- Perplexity API Key: Get one from the Perplexity AI Platform
Run the application in development mode with hot reload:
DEV_MODE=true python run.pyRun the application in production mode:
python run.pyFor production deployments with multiple workers, use Gunicorn:
gunicorn -c gunicorn_conf.py app.main:appIf you experience duplicate request processing or database connections, try the following:
-
Set DEV_MODE correctly:
- Use
DEV_MODE=trueonly during development - In production, make sure
DEV_MODEis not set or explicitly set tofalse
- Use
-
Use Gunicorn with proper worker configuration:
- The included
gunicorn_conf.pyhas optimal settings - Adjust worker count based on your server's CPU cores
- The included
-
Monitor request processing:
- Check logs for duplicate processing patterns
- Use tools like New Relic or Prometheus to monitor request processing times
The API will be available at http://localhost:8000.
POST /chat
Request body:
{
"query": "I want to plan a trip from Boston to NYC from May 15 to May 18, 2025 for 2 people."
}POST /generate-itinerary
Request body with structured trip data.
import requests
response = requests.post(
"http://localhost:8000/chat",
json={"query": "I want to plan a trip from Boston to NYC from May 15 to May 18, 2025 for 2 people."}
)
print(response.json())- Natural language processing with Claude
- Dynamic workflow using LangGraph
- Real attractions, restaurants, and hotels using Google Places API
- Comprehensive budget estimation
- Customized recommendations based on user preferences
- Flight data uses mock data instead of a real API (like Amadeus)
- Limited error handling
- No persistent memory for multi-turn conversations
- Integration with a flight booking API
- Adding a conversational memory store
- Implementing a React-based frontend
- Supporting itinerary editing
