Skip to content

AI travel buddy web app. Built for the lazy tourists.

Notifications You must be signed in to change notification settings

yeoshuheng/travel-gpt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TravelGPT

Your one-stop travel buddy app build for the lazy tourists. Build for SIA Application Challenge under the Generative AI category.

Table of Contents

Introduction

Currently travel guides on SIA websites are lacking in locations, with very little information on them. It is however unrealistic for SIA to be able to provide handy travel guides for every location. As tourists, it is also very cumbersome to gather information across various sources, hence we wanted a one-stop solution for everything from itinerary recommendations to weather forecasts. With that, we have decided to leverage on the growing trend of free to use LLMs such as chatGPT to help tourists generate recommendations and gather related information.

Demo

Watch the video

Tools

  • Frontend: JavaScript, HTML, CSS
  • Backend: Python, Flask, OpenAI API, LangChain
  • Database: Redis
  • Tooling: Docker, Postman

Project Structure

.
├── client
│   ├── images
│   ├── src
│   ├── styles
│   └── app.js
├── config
│   └── config.json # Put OpenAI API key here
├── launch
│   ├── launch.bat # For Windows
│   └── launch.sh # For Unix
└── server
    ├── database
    ├── chat
    └── main.py

Getting Started

  1. Clone this repository
git clone https://github.com/yeoshuheng/travel-gpt.git
  1. Create OpenAI account by visiting the OpenAI API page.
  2. Create a API key Settings>User>API Key and copy it.
  3. Go into the travel-gpt/config/config.json and add your API Key.
  4. Install Docker
  5. Run Docker
  6. Run application

    MacOS
    For MacOS, you will need to first give Google Chrome Full Disk Access, you can do so by going into System Preferences > Privacy & Security > Full Disk Access and adding Google Chrome.

    Afterwards, cd into the project directory's launch file and run:
    bash launch.sh
    The application should open, wait for a minute for the docker build to complete and you can now enjoy the app.

    Windows
    For Windows, cd into the project directory's launch file and run:
    start launch.bat
    The application should open, wait for a minute for the docker build to complete and you can now enjoy the app.

    Manual
    You can also manually start the app. Cd into the project directory and run:
    docker compose up --build
    Afterwards, you can just open ./client/src/index.html and enjoy the application.

Technology Choices

  • While LangChain is available on both JS and Python, we eventually decided to adopt the Python version because Python is traditionally used to work with data, hence we felt that it would provide more flexibility if we eventually decide to add more data-enabled features in the future or if we decide to use a different model and finetune it with transfer learning.
  • Since we were already working in Python, we also decided to use Flask for our backend.
  • A future consideration could possibly be to shift the backend's code into Mojo, a pythonic language that runs with the performance of C++. Additionally, Mojo also plans to support popular Python data manipulation packages and is already supporting MatplotLib & NumPy.
  • Redis is easy to set up and handles queries more efficiently than SQL. Since we do not have any complex queries within our application that requires SQL, we decided upon Redis as our caching database. however this may change as the app evolves and more functionally is developed.
  • We eventually decided to Dockerize the application to ease up application deployment, be it on our local devices or in the cloud.

Testing & Optimization

  • A issue we noticed is the long loading time in between user input and querying, this is because of the need for the LLM to generate the response. We decided to optimise this by caching standard responses (eg. Description of travel location) which does not change into a Redis database.
  • The API for the Flask server has been tested on Postman.

Credits

These are some tutorials we used when setting up the application that were of amazing help.

About

AI travel buddy web app. Built for the lazy tourists.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •