An intelligent travel planning web application that helps you plan budget-friendly trips with personalized recommendations for flights, hotels, and itineraries using AI.
- Smart Trip Planning: AI-powered search for flights and hotels within your budget
- Personalized Itineraries: Custom day-by-day plans based on your interests
- Interactive Chat Assistant: Ask questions about destinations, travel tips, and more
- Budget Optimization: Intelligent budget allocation across flights, hotels, and activities
- Interest-Based Recommendations: Tailored suggestions based on your preferences
- Multi-Person Planning: Support for group travel planning
- Real-Time Search: Live flight and hotel data via SERP API
- Responsive Design: Works perfectly on desktop and mobile devices
-
Clone the repository
git clone <your-repo-url> cd Travel-Planner-AI-agent
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
# Copy the example file copy .env.example .env # Edit .env file and add your API keys: # GEMINI_API_KEY=your_actual_gemini_api_key # SERP_API_KEY=your_actual_serp_api_key
-
Run the application
python app.py
-
Open your browser Navigate to
http://localhost:5000
- Go to Google AI Studio
- Create a new API key
- Copy the key to your
.envfile
- Sign up at SerpApi
- Get your free API key (100 searches/month)
- Copy the key to your
.envfile
Create a .env file in the root directory:
GEMINI_API_KEY=your_gemini_api_key_here
SERP_API_KEY=your_serp_api_key_here
FLASK_SECRET_KEY=your_random_secret_key_here- Enter your origin and destination cities
- Select your travel dates
- Choose number of people
- Set your budget
- Select your interests (adventure, culture, food, etc.)
- Click "Plan My Trip"
- Flights Tab: View recommended flights within your budget
- Hotels Tab: See hotel options with ratings and amenities
- Itinerary Tab: Get a personalized day-by-day plan
- Budget Tab: See how your budget is allocated
- Ask questions about destinations
- Get travel tips and recommendations
- Clarify details about your itinerary
- Get help with travel planning
Travel-Planner-AI-agent/
βββ app.py # Main Flask application
βββ templates/
β βββ index.html # Web interface
βββ requirements.txt # Python dependencies
βββ .env.example # Environment variables template
βββ README.md # This file
βββ .gitignore # Git ignore rules
GET /- Main web interfacePOST /search- Search for flights, hotels, and generate itineraryPOST /chat- Chat with AI assistantGET /suggestions- Get destination suggestions based on interests
- 40% for flights
- 35% for hotels
- 25% for activities and food
Choose from various interests:
- Adventure & Outdoor Activities
- Culture & Museums
- Food & Culinary Experiences
- Nature & Wildlife
- History & Architecture
- Nightlife & Entertainment
- Shopping & Markets
- Relaxation & Wellness
- Photography & Sightseeing
- Sports & Recreation
The AI creates detailed daily plans including:
- Recommended attractions and activities
- Restaurant suggestions for all meals
- Transportation tips
- Budget breakdown for activities
- Local cultural insights
- Emergency contacts and important info
Edit the interests array in templates/index.html:
// Add new interest tags
<div class="interest-tag" data-interest="your-interest">Your Interest</div>Update the budget percentages in app.py:
flight_budget = budget * 0.4 # 40% for flights
hotel_budget = budget * 0.35 # 35% for hotels
activity_budget = budget * 0.25 # 25% for activitiesModify the system prompts in the TravelAgent class methods to change AI behavior.
-
API Key Errors
- Ensure your API keys are correctly set in the
.envfile - Check that your Gemini AI API key is active
- Verify your SERP API quota hasn't been exceeded
- Ensure your API keys are correctly set in the
-
No Search Results
- Try different city names or airport codes
- Adjust your budget range
- Check your internet connection
-
Chat Not Working
- Verify your Gemini API key is working
- Check the browser console for errors
Run the app in debug mode for detailed error messages:
export FLASK_DEBUG=1 # On Windows: set FLASK_DEBUG=1
python app.pyThis project is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any issues or have questions, please:
- Check the troubleshooting section above
- Search existing issues on GitHub
- Create a new issue with detailed information
- User authentication and trip saving
- Integration with booking platforms
- Weather information integration
- Currency conversion
- Offline itinerary access
- Social sharing features
- Multi-language support
- Mobile app version
Happy Traveling! π