Inspiration
Planning a trip can quickly become overwhelming. You have to search for flights, hotels, restaurants, attractions, and then somehow organize everything into a schedule that actually makes sense. We wanted to make that process simpler. Instead of making users search across multiple websites and put everything together themselves, we wanted to create an AI travel agent that could take their preferences and turn them into a personalized trip plan.
What it does
AI Travel Agent helps users plan a trip from start to finish. Users enter their starting location, destination, dates, budget, trip type, and optional preferences such as dietary restrictions or types of attractions they enjoy. The app validates the information they enter, searches for real flight, hotel, attraction, and restaurant information, and lets users choose their preferred flight and hotel. Our AI then uses those selections and the user's preferences to generate a personalized day-by-day itinerary.
How we built it
We built the frontend using React and JavaScript and the backend using FastAPI and Python. We use SerpAPI to retrieve current information about flights, hotels, attractions, and restaurants. We use Google Gemini to validate user preferences and generate the final itinerary.
The general flow is:
The user enters their trip information. The app validates the locations and optional preferences. SerpAPI searches for relevant travel information. The user selects a flight and hotel. Gemini uses the trip details, preferences, and selected options to generate a day-by-day itinerary. The completed trip can then be viewed from the itinerary and dashboard.
We also deployed the frontend with Vercel and the backend with Render, allowing the project to work as a fully deployed web application.
Challenges we ran into
One of our biggest challenges was getting multiple APIs and different parts of our application to work together reliably. We had to handle cases where an API returned no results, unexpected data, or took longer than expected. We also had to make our validation more useful. We didn't want the app to simply reject unusual preferences, so we used Gemini to distinguish between a valid but uncommon travel preference and completely unrelated or nonsensical input. Deployment introduced another challenge. Our application worked locally, but once we deployed it, we ran into environment variable and CORS issues between our Vercel frontend and Render backend. Debugging those issues helped us understand the differences between running an application locally and running it in production.
Accomplishments that we're proud of
We're proud that we built a complete travel planning experience rather than just an AI chatbot. The user can go from entering their trip information to selecting real travel options and receiving a personalized itinerary. We're also proud of how we incorporated AI into different parts of the experience. Gemini isn't only used to generate text at the end; it also helps validate user preferences and personalize the itinerary based on the information the user provides. Most importantly, we were able to take an idea and turn it into a working, deployed application that combines a React frontend, FastAPI backend, external APIs, and generative AI.
What we learned
This project taught us a lot about connecting different technologies into one application. We learned how to work with external APIs, pass data between a frontend and backend, handle API failures, and manage environment variables for deployment. We also learned that building an AI application involves much more than simply calling an AI model. We had to think about what information to give the model, how to validate user input, how to structure the output, and how to make the AI-generated results fit into the rest of the application. Finally, we learned a lot about debugging. Several issues that worked perfectly on our local machines appeared only after deployment, which taught us how important it is to test the entire application in a real production environment.
What's next for AI Travel Agent
We'd like to make the itinerary even more personalized by allowing users to adjust individual activities and regenerate specific parts of their trip instead of regenerating the entire itinerary. We also want to improve the travel recommendations by considering factors such as travel time between activities, opening hours, weather, and user preferences in more detail. In the future, we could also add features such as budget tracking, map-based itinerary visualization, and the ability to save and share trips with other travelers.
Built With
- css
- fastapi
- geminiapi
- html
- javascript
- python
- react
- serpapi
Log in or sign up for Devpost to join the conversation.