AI Travel Agent
Welcome to the AI Travel Agent repository! This project demonstrates how to leverage LangGraph for building a smart travel assistant that uses multiple language models (LLMs) to handle tasks such as finding flights, booking hotels, and sending personalized emails. The agent is designed to interact with users, invoke necessary tools, and provide a seamless travel planning experience.
Clone the repository, set up the virtual environment, and install the required packages
git clone [email protected]:nirbar1985/ai-travel-agent.git
( In case you have python version 3.11.9 installed in pyenv)
pyenv local 3.11.9Install dependencies
poetry install --syncEnter virtual env by:
poetry shell.env file in the root directory of the project..env file:OPENAI_API_KEY=your_openai_api_key
SERPAPI_API_KEY=your_serpapi_api_key
SENDGRID_API_KEY=your_sendgrid_api_key
# Observability variables
LANGCHAIN_API_KEY=your_langchain_api_key
LANGCHAIN_TRACING_V2=true
LANGCHAIN_PROJECT=ai_travel_agentMake sure to replace the placeholders (your_openai_api_key, your_serpapi_api_key, your_langchain_api_key, your_sendgrid_api_key) with your actual keys.
This version includes the necessary environment variables for OpenAI, SERPAPI, LangChain, and SendGrid and the LANGCHAIN_TRACING_V2 and LANGCHAIN_PROJECT configurations.
To start the chatbot, run the following command:
streamlit run app.pyOnce launched, simply enter your travel request. For example:
I want to travel to Amsterdam from Madrid from October 1st to 7th. Find me flights and 4-star hotels.
The chatbot will generate results that include logos and links for easy navigation.
Note: The data is fetched via Google Flights and Google Hotels APIs. There’s no affiliation or promotion of any particular brand.
The email integration is implemented using the human-in-the-loop feature, allowing you to stop the agent execution and return control back to the user, providing flexibility in managing the travel data before sending it via email.
For a detailed explanation of the underlying technology, check out the full article on Medium: Building Production-Ready AI Agents with LangGraph: A Real-Life Use Case)
Distributed under the MIT License. See LICENSE.txt for more information.
No open issues yet, or sync has not completed.