Skip to content

37nomad/AI-Travel-Agent

Repository files navigation

TravelBot AI

An intelligent travel companion powered by LangGraph, RAG (Retrieval-Augmented Generation), and the TravelPlanner dataset. TravelBot AI helps users plan their trips by providing information about destinations, weather, and some useful calculations through an interactive chat interface.

Features

  • 🔍 Knowledge Search: Access to comprehensive travel information from the TravelPlanner dataset
  • 🌤️ Weather Information: Real-time weather data for any destination
  • 🧮 Travel Calculator: Calculate costs, distances, and other travel-related math
  • 🤖 Conversational AI: Powered by Hugging Face transformers with LangGraph workflow
  • 📊 Vector Search: FAISS-powered semantic search across travel data
  • 🎯 Interactive UI: Clean Streamlit interface with chat history and tool execution tracking

Architecture

  • LangGraph: Orchestrates the AI agent workflow with conditional routing
  • RAG Pipeline: Combines retrieval from vector database with generative AI
  • FAISS Vector Store: Efficient similarity search across travel documents
  • Hugging Face Models: Local model execution with transformer support
  • Streamlit: Modern web interface for user interaction

Alt text

Prerequisites

  • GPU recommended for optimal performance
  • API keys for enhanced functionality (required)

Installation

  1. Clone the repository

    git clone <https://github.com/37nomad/AI-Travel-Agent.git>
    cd AI-Travel-Agent
  2. Install dependencies

    pip install -r requirements.txt
  3. Set up environment variables

    Create a .env file in the project root:

    HUGGINGFACE_TOKEN=your_huggingface_token_here
    OPENWEATHER_API_KEY=your_openweather_api_key_here

    Getting API Keys:

  4. Run the setup script

    python setup_script.py

    This will:

    • Create necessary directories
    • Download and process the TravelPlanner dataset (500-1000 entries)
    • Build the FAISS vector index
    • Test the installation

Quick Start

  1. Launch the application

    streamlit run main.py
  2. Open your browser and navigate to the displayed URL (typically http://localhost:8501)

Usage Examples

Try these example queries in the chat interface:

  • "Find hotels in Paris for 2 nights"
  • "What's the weather like in Tokyo?"
  • "Calculate the total cost: flight ₹15000 + hotel ₹8000"
  • "Tell me about restaurants in New York"
  • "Find attractions in London"

Configuration

Model Selection

The default model is microsoft/DialoGPT-medium. For better performance, consider upgrading to a paid/premium model by modifying the model_name parameter in agent.py:

agent = TravelAgent(model_name="your-preferred-model")

Dataset Limit

Adjust the dataset processing limit in setup_script.py or when running directly:

# Process 500 entries (recommended for testing)
processor.process_and_save_dataset(limit=500)

# Process 1000 entries (maximum, better coverage)
processor.process_and_save_dataset(limit=1000)

Tools Available

1. Knowledge Search

Search the travel database for information about:

  • Hotels and accommodations
  • Restaurants and dining
  • Tourist attractions
  • Destination information

2. Weather Information

Get current weather data for any city worldwide using OpenWeather API.

3. Calculator

Perform travel-related calculations:

  • Cost estimation
  • Distance calculations
  • Currency conversion
  • General arithmetic

Performance Tips

  • GPU Usage: The application will automatically use GPU if available via device_map="auto"
  • Memory: Vector index loading requires sufficient RAM
  • First Run: Initial setup takes longer due to model and dataset downloads
  • Batch Processing: Large dataset limits may require more processing time

What more could have been done

  • Additional travel APIs integration
  • Enhanced Tool Scraping Capability Or Using Enhanced features for smooth tool extraction
  • Multi-language support
  • Performance optimizations

Acknowledgments

  • TravelPlanner Dataset: OSU NLP Lab for the comprehensive travel dataset

About

Hands on project to incroporate tools and RAG functionalities on LLM through langgraph.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors