Skip to content

🏝️ Create personalized travel itineraries using this AI Assistant. Save time and focus on enjoying your trip!

License

Notifications You must be signed in to change notification settings

Logisx/TripTailor

Repository files navigation

TripTailor Logo

🏝️ TripTailor

TripTailor is an AI-powered travel planning assistant that creates personalized itineraries tailored to your preferences. Simply describe your dream adventure, and TripTailor will generate a detailed plan, complete with recommended destinations, travel times, opening hours, and even lunch breaks β€” so you can focus on enjoying your trip!

Python LangChain Redis Flask

πŸŽ₯ Demonstration

TripTailor Demo

Here’s how TripTailor works:

  1. The user provides a text prompt describing their ideal trip (with as much or as little detail as they want).
  2. They can also apply filters for budget, travel dates, and other preferences.
  3. This information is processed by the AI pipeline, which:
    • Identifies user preferences.
    • Brainstorms destination ideas.
    • Fetches relevant data from Google Maps.
    • Generates a final, polished itinerary.

πŸ“‹ Table of Contents

⭐ Features

  • Personalized Travel Itineraries: Generates customized plans based on budget, travel dates, and preferences.
  • Real-Time Data Integration: Fetches live information from APIs like Google Places.
  • In-Depth Analysis: Considers distances and travel times to optimize your itinerary.
  • Itinerary PDF: Download a PDF version of your personalized itinerary.

πŸ› οΈ Tech Stack & APIs

  • AI Pipeline: LangChain, OpenAI API (to be replaced with open-source), Google Places API
  • Backend: Python, Flask, Redis (session data storage)
  • Frontend: HTML, CSS, JavaScript, Bootstrap, Leaflet (map integration)
  • Deployment: Docker, Heroku

πŸ€– AI Agent Architecture

AI Agent Architecture

The AI pipeline follows these steps:

  1. Extract Preferences: Analyze the user’s input to identify travel preferences.
  2. Generate Destination Ideas: Brainstorm potential destinations based on the extracted preferences.
  3. Create Itinerary: Design a detailed travel plan, including activities and timings.
  4. Populate with Data: Enhance the itinerary with links, photos, and real-time data from Google Places API.

πŸ“ Project Structure

β”œβ”€β”€ LICENSE            <- Open-source license if one is chosen
β”œβ”€β”€ Makefile           <- Makefile with convenience commands like `make data` or `make train`
β”œβ”€β”€ README.md          <- The top-level README for developers using this project.
β”œβ”€β”€ data
β”‚   β”œβ”€β”€ external       <- Data from third party sources.
β”‚   β”œβ”€β”€ interim        <- Intermediate data that has been transformed.
β”‚   β”œβ”€β”€ processed      <- The final, canonical data sets for modeling.
β”‚   └── raw            <- The original, immutable data dump.
β”‚
β”œβ”€β”€ docs               <- A default mkdocs project; see www.mkdocs.org for details
β”‚
β”œβ”€β”€ models             <- Trained and serialized models, model predictions, or model summaries
β”‚
β”œβ”€β”€ notebooks          <- Jupyter notebooks for initial experiments
β”‚
β”œβ”€β”€ pyproject.toml     <- Project configuration file with package metadata for 
β”‚                         triptailor and configuration for tools like black
β”‚
β”œβ”€β”€ references         <- Data dictionaries, manuals, and all other explanatory materials.
β”‚
β”œβ”€β”€ reports            <- Generated analysis as HTML, PDF, LaTeX, etc.
β”‚   └── figures        <- Generated graphics and figures to be used in reporting
β”‚
β”œβ”€β”€ requirements.txt   <- The requirements file for reproducing the analysis environment, e.g.
β”‚                         generated with `pip freeze > requirements.txt`
β”‚
β”œβ”€β”€ setup.cfg          <- Configuration file for flake8
β”‚
β”œβ”€β”€ Procfile           <- File defining how to start the app for Heroku
β”‚
└── triptailor   <- Source code for use in this project.
    β”‚
    β”œβ”€β”€ __init__.py             <- Makes triptailor a Python module
    β”‚
    β”œβ”€β”€ etc/defaults.cfg        <- Store useful variables and configuration
    β”‚
    β”œβ”€β”€ logger.py               <- Initialized logger
    β”‚
    β”œβ”€β”€ main.py                 <- Starts up the application
    |
    β”œβ”€β”€ routes.py               <- Defines API routes
    |
    β”œβ”€β”€ templates/              <- HTML templates for Flask to render  
    |
    β”œβ”€β”€ modeling                
    β”‚   β”œβ”€β”€ __init__.py 
    β”‚   β”œβ”€β”€ agent.py            <- Class defining the pipeline of LLM calls         
    β”‚   β”œβ”€β”€ data_schemas.py     <- Contains desired output format for the LLM calls          
    β”‚   β”œβ”€β”€ inference.py        <- Class running a pipeline to generate itinerary          
    β”‚   β”œβ”€β”€ prompts.py          <- Contains prompt templates used to form an LLM request          
    β”‚   └── itinerary_example.json <- Sample itinerary used when debugging
    β”‚
    └── static/                 <- CSS and JS files for the frontend

πŸš€ Run Locally

Prerequisites

  • Python 3.12.0
  • Redis Server (for caching)

Create .env file and add the relevant API keys and your Redis server url. Use env_example.txt as a template for your env file.

Option 1: Using Poetry

  1. Install Poetry if not already installed:

    pip install poetry
  2. Install dependencies:

    poetry install
  3. Start the application:

    poetry run python -m triptailor.main

Option 2: Using requirements.txt

If Poetry is not available, use pip to install dependencies.

  1. Install dependencies:

    pip install -r requirements.txt
  2. Start the application:

    python -m triptailor.main

πŸ›€οΈ Roadmap

  • Itinerary Redaction Tool: Allow users to modify specific parts of the itinerary with a new text prompt. For example, "Replace the museum visit on Day 3 with a beach day."
  • Overall Estimated Cost: Provide a detailed breakdown of estimated trip expenses, including accommodation, transportation, and activities.
  • General Info: Include useful details like currency exchange rates, time zones, common languages, and outlet types.
  • Currency Selection: Allow users to input their budget in their preferred currency, not just EUR.
  • Event Integration: Use APIs like Eventbrite to display local events during the user’s stay, with options to add them to the itinerary.
  • Open-Source LLM: Transition from OpenAI API to a local, open-source LLM for greater independence and cost efficiency.

βš–οΈ License

This project is licensed under the MIT License.

πŸ”— Links