Hangout AI uses a Large Language Model (LLM) to create custom travel itineraries based on user input such as location, date, and weather conditions. The project integrates several software components to deliver a comprehensive and dynamic itinerary generation service.
Our target audience is the general public, including travelers, tourists, and adventure seekers who want a personalized and seamless travel planning experience.
- Overview
- Folder Structure
- Tech Stack
- Architecture
- TiDB Utilization Overview
- Setup
- Usage
- Hangout AI Application
- Contribution
- License
This repository contains three main components for the Hangout AI project, which is designed to generate personalized travel itineraries for users. The components are divided into three folders: llm
, server
, and client
.
- llm: Contains the code for the Large Language Model (LLM) that generates itineraries.
- server: Hosts the FastAPI and Node.js servers, managing user requests, authentication, and LLM integration.
- client: The front-end application built with React, where users interact with the AI to generate their travel itineraries.
- LLM: Groqcloud Llama3-70B-8192
- Indexing & Retrieval: LlamaIndex
- API Framework: FastAPI (Python), Node.js
- Data Scrapping: Golang, Google maps scraper
- Data Cleaning: Python, Pandas
- Database: TiDB (Vector DB) & All the data (user, chat, location) on TiDB
- Frontend: React, Vite, Tailwind CSS
- Embeddings: Gemini models/embedding-001
- External APIs: Google Maps, Visual Crossing (Weather API)
- Client : React JS, Tailwind CSS, React Markdown
- Authentication : OAuth 0.2 Google APIs and JWT
- Deployment : Vercel, Heroku, Personal VPS
- Web Analytic : Firebase Google Analytic
The project is built using a microservices architecture, with each component independently handling specific tasks:
- LLM Service (
llm
folder): Generates itineraries using the Groq Llama3-70B-8192 model. - API Server (
server
folder): Handles user requests, authenticates via Google OAuth, and interacts with the LLM and database. - Client Application (
client
folder): A React-based front-end where users can generate and interact with their itineraries.
- Using RAG with PingCAP Vector MySQL Database
- Using TiDB Serverless for MetaLocations
- Using MySQL Database from TiDB
RAG (Retrieval-Augmented Generation) is a technique where a model retrieves relevant data from a database or knowledge base to enhance the quality and relevance of generated outputs. In the context of Hangout AI, we use RAG with the PingCAP Vector MySQL Database to efficiently process and retrieve location-based information that improves the accuracy and personalization of travel itineraries.
-
Data Embedding:
- Location data (e.g., descriptions, reviews, metadata) is embedded into vector representations using models like the Gemini embedding model.
- These vectors are stored in the PingCAP Vector MySQL Database for efficient similarity searches.
-
Retrieval Process:
- When a user requests an itinerary, relevant location data is retrieved by performing similarity searches in the vector database.
- This data is then fed into the Large Language Model (LLM), enhancing the contextual understanding and output relevance.
-
Itinerary Generation:
- The retrieved data enriches the LLM's prompts, leading to more accurate and tailored itineraries based on user preferences, current weather, and other dynamic factors.
By leveraging RAG with PingCAP Vector MySQL Database, Hangout AI can generate more informed and contextually appropriate itineraries, ensuring that users receive recommendations that are both personalized and relevant.
TiDB Serverless is used in Hangout AI to manage and retrieve MetaLocations data, which is not sensitive and is utilized for visual itinerary previews integrated with Google Maps and Google Reviews.
-
Scalable Data Management:
- TiDB Serverless efficiently handles large datasets of MetaLocations, ensuring that the service remains responsive even as the volume of data grows.
- This flexibility allows Hangout AI to scale its location database without worrying about underlying infrastructure.
-
Integration with Google Maps and Reviews:
- MetaLocations stored in TiDB Serverless are used to provide visual previews of itinerary locations.
- The integration with Google Maps enables users to view detailed maps, directions, and nearby attractions.
- Google Reviews provide additional insights, helping users make informed decisions about their travel plans.
-
Non-Sensitive Data Handling:
- Since MetaLocations data is non-sensitive, it can be freely shared and used for public-facing features without compromising user privacy.
- This makes TiDB Serverless an ideal solution for managing this type of data, balancing performance with security.
By utilizing TiDB Serverless for MetaLocations, Hangout AI ensures that users can preview their itineraries visually and access detailed information about each location, enhancing the overall travel planning experience.
we delve into how TiDB’s MySQL compatibility enhances data management within the Hangout AI project.e efficiently manage user profiles, location information, and chat records using Sequelize. TiDB's scalable nature ensures that as data volumes grow, the system remains performant and responsive, while the MySQL compatibility allows for seamless integration with existing tools and libraries. This setup provides a powerful and flexible solution for handling diverse data types essential for generating personalized travel itineraries.
-
User Data Management:
- Purpose: Efficiently handle user profiles, including personal details and authentication.
- Schema: Includes fields such as
id
,name
,email
,image
, and timestamps (createdAt
,updatedAt
).
-
Location Data Management:
- Purpose: Manage and store information about various travel locations.
- Schema: Includes fields like
id
,title
,address
,latitude
,longitude
, and additional metadata.
-
Chat Data Management:
- Purpose: Store interactions between users and the AI, including messages and metadata.
- Schema: Includes fields such as
id
,name
,messages
,address
,latitude
,longitude
, and user associations.
-
MySQL Compatibility:
- Advantage: Utilize TiDB’s MySQL protocol support to seamlessly integrate with Sequelize for data management.
-
Scalability:
- Benefit: TiDB’s distributed nature ensures scalability and efficiency in handling large volumes of data.
- Python 3.8+
- Node.js 14+
- Virtual environment tool (e.g.,
venv
orconda
) - TiDB instance
- API keys for Groq, Google Maps, and other external services
-
Clone the repository:
git clone https://github.com/yourusername/hangout-ai.git cd hangout-ai # read the README.md
-
Set up the LLM:
- Navigate to the
llm
directory and install Python dependencies:cd llm python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate` pip install -r requirements.txt # read the README.md & create the .env
- Navigate to the
-
Set up the Server:
- Navigate to the
server
directory and install Node.js dependencies:cd ../server npm install # read the README.md & create the .env & config.json
- Navigate to the
-
Set up the Client:
- Navigate to the
client
directory and install Node.js dependencies:cd ../client npm install # read the README.md & create the .env
- Navigate to the
-
Set up environment variables:
- Create a
.env
file in each of thellm
,server
, andclient
directories using the provided templates.
- Create a
To start the LLM service:
cd llm
python main.py
To start the FastAPI and Node.js servers:
cd server
npm run start
To start the client application:
cd client
npm run dev
Hangout AI is a web application that can be opened in a browser. It is designed to be responsive for both desktop and mobile devices
Users need to log in with the Google Sign-In option that we provide.
Note : We will change the YouTube link after we finish recording.
We set the default location to Jakarta, but if the user changes it to Singapore or Kuala Lumpur, the city illustration will change as well.
Users can continue chatting with the AI, for example, by asking for a table. We have a preview button to show an image of the mentioned location or open a new tab to view the location on Google for more details and reviews.
Hangout AI Developer :
Feel free to open an issue or submit a pull request if you'd like to contribute to this project.
This project is licensed under the MIT License. See the LICENSE file for more details.