Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

ai-travel-agent

> 编程语言
Open source

AI Travel Agent

794 stars0 likes0 views
WebsiteGitHub

About

AI Travel Agent

✈️ AI Travel Agent - Powered by LangGraph: A Practical Use Case

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.

Features

  • Stateful Interactions: The agent remembers user interactions and continues from where it left off, ensuring a smooth user experience.
  • Human-in-the-Loop: Users have control over critical actions, like reviewing travel plans before emails are sent.
  • Dynamic LLM Usage: The agent intelligently switches between different LLMs for various tasks, like tool invocation and email generation.
  • Email Automation: Automatically generates and sends detailed travel plans to users via email.

Getting Started

Clone the repository, set up the virtual environment, and install the required packages

  1. git clone [email protected]:nirbar1985/ai-travel-agent.git

  2. ( In case you have python version 3.11.9 installed in pyenv)

    bash
    pyenv local 3.11.9
  3. Install dependencies

    bash
    poetry install --sync
  4. Enter virtual env by:

    bash
    poetry shell

Store Your API Keys

  1. Create a .env file in the root directory of the project.
  2. Add your API keys and environment variables to the .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_agent

Make 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.

How to Run the Chatbot

To start the chatbot, run the following command:

streamlit run app.py

Using the Chatbot

Once 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.

Example Outputs

  • Flight and hotel options with relevant logos and links for easy reference:

Email Integration

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.

  • Travel data formatted in HTML, delivered straight to your inbox:

Learn More

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)

License

Distributed under the MIT License. See LICENSE.txt for more information.

Issues· 2 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Python

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言