An intelligent AI-powered travel planning assistant built with LangChain and Groq. This application helps users plan their trips by providing flight recommendations, hotel suggestions, destination information, weather forecasts, and budget estimates.
βοΈ Flight Search: Find and compare flight options for your travel dates- π¨ Hotel Recommendations: Get personalized hotel suggestions based on preferences
- π Destination Planning: Discover attractions and places to visit
- π€οΈ Weather Forecasts: Check weather conditions for your destination
- π° Budget Estimation: Calculate estimated costs for your entire trip
- π€ AI-Powered Agent: Intelligent agent that understands natural language queries and leverages multiple tools
- Backend: Flask (Python)
- AI/LLM: LangChain + Groq API
- Frontend: HTML, CSS, JavaScript
- Dependencies: See
requirements.txt
agentic-travel-assistant/
βββ agent/ # AI Agent logic
β βββ travel_agent.py # Main agent creation and setup
β βββ prompts.py # System prompts and instructions
β βββ __init__.py
βββ app/ # Application configuration
β βββ config.py
β βββ data/ # Sample data files
β βββ flights.json
β βββ hotels.json
β βββ places.json
βββ tools/ # Tool implementations
β βββ flight_tool.py
β βββ hotel_tool.py
β βββ places_tool.py
β βββ weather_tool.py
β βββ budget_tool.py
βββ web/ # Frontend assets
β βββ templates/
β β βββ index.html
β βββ static/
β βββ script.js
β βββ style.css
βββ main.py # Flask application entry point
βββ requirements.txt # Python dependencies
βββ render.yaml # Deployment configuration
- Python 3.8+
- Groq API Key (get one at console.groq.com)
-
Clone the repository
git clone https://github.com/SA9572/AI_Agent_travel-Assistant.git cd agentic-travel-assistant -
Create a virtual environment
python -m venv .venv # On Windows .venv\Scripts\activate # On macOS/Linux source .venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Configure environment variables
# Create a .env file in the root directory echo GROQ_API_KEY=your_api_key_here > .env
python main.pyThe application will start on http://localhost:5000
- Description: Serves the web interface
- Response: HTML page
- Description: Submit a travel planning query
- Request Body:
{ "query": "I need to plan a trip to Paris for 5 days with a budget of $2000" } - Response:
{ "result": "AI-generated travel plan..." }
- "Find flights from New York to London for next week"
- "Recommend hotels in Tokyo within $150 per night"
- "What are the best attractions in Barcelona?"
- "What's the weather like in Sydney?"
- "Plan a 7-day trip to Italy with a $3000 budget"
Searches for available flights based on origin, destination, and dates.
Recommends hotels based on location, price range, and preferences.
Provides information about attractions and places to visit in destinations.
Fetches weather forecasts for specified locations.
Calculates estimated trip costs including flights, accommodation, and activities.
Create a .env file in the root directory:
GROQ_API_KEY=your_groq_api_key_hereNote: The .env file is ignored in git for security purposes. See .gitignore for details.
The project includes a render.yaml configuration file for easy deployment to Render:
- Push your code to GitHub
- Connect your repository to Render
- The app will automatically deploy using the configuration in
render.yaml
The application runs in debug mode by default, which enables:
- Auto-reloading on code changes
- Detailed error messages
- Interactive debugger
The agent uses a ReAct (Reasoning + Acting) pattern:
- User submits a natural language query
- LLM analyzes the query and decides which tools to use
- Tools execute and return results
- LLM synthesizes the results into a comprehensive response
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
For issues and questions, please open an issue on the GitHub repository.
SA9572