- Technologies Used
- Description
- Objectives
- Demo
- Notebooks Overview
- Using Docker
- Installation
- Usage
- Project Structure
- Collaborators
- License
This project aims to provide gift recommendations using a chatbot interface. The system leverages embeddings and vector stores along with LLMs to process and recommend products from store's catalogue based on user queries.
The main goal is to develop a Proof Of Concept that is could be used by a customer.
- Load and embed product data from CSV files.
- Utilize a pretrained language model (LLM) with Retrieval-Augmented Generation (RAG) for recommendations.
- Implement conversation and chat history with the retrieval & answer chain
- Create a Streamlit front end for the app.
The dataset used, compiled by McAuley Lab in 2023, encompasses a comprehensive collection of Amazon Reviews. It features:
- User Reviews (ratings, text, helpfulness votes, etc.)
- Item Metadata (descriptions, price, raw image, etc.)
Important
Disclaimer: The source code as well as the demo currently use free embedidng and llm models provided by TogetherAI. Those models are thus not performant and generally do not offer great recommendations. It is recommended to switch to higher performance models like those from OpenAI, Anthropic... or capable Local models to get better results. An up to date more refined product database would also contribute to getting better results as the database contains rather "random" results
The app demo is hosted & available on the following link: Demo Link
- create_llm_ready_csv.ipynb:
- Used to preprocess the Amazon Dataset and extract products with rich text features for the demo.
You can pull the docker image from Docker Hub or Github Packages To pull the Docker image from Docker Hub, run the following command:
# Pull the docker image
$ docker pull medkallel/gift-recommendation-chatbot:latest
If you prefer to build the Docker image locally, navigate to the project directory and run:
# Build the docker image
$ docker build -t gift-recommendation-chatbot .
To run the Docker container, use the following command:
# Run the docker container
$ docker run -p 8501:8501 -e TOGETHER_API_KEY=<your_api_key_here> gift-recommendation-chatbot
Tip
Do not forget to add your TogetherAI api key
You can access the app on another device by following the link: http://<server-ip>:8501
Important
The project was developed and tested on Python 3.11.6
To run this project locally, follow these steps:
- Clone the repository:
$ git clone https://github.com/yourusername/Gift-Recommendation-ChatBot
$ cd Gift-Recommendation-ChatBot
- Install requirements:
$ pip install -r requirements.txt
- Download the Chroma VecStore & upload it to your Dropbox App: Chroma Store Download Link
Important
Ensure you have the necessary API keys for TogetherAI and Dropbox set up in the secrets.toml
file.
- Run the app using:
$ streamlit run src/Gift_Recommendation_Bot.py
- Use the
Products Catalogue βοΈ
script to upload and embed product data. - Use the
Gift Recommendation Bot
script to start the chatbot interface and get gift recommendations.
TIP: The embedding process may take a while depending on the size of the CSV file. Please be patient.
π¦ Gift-Recommendation-ChatBot/
βββ π.github/workflows
β βββ π€github-docker-cicd.yaml # Used for CI/CD workflows
βββ πchroma_vectorstore/ # Contains the vector store
βββ πData/ # Contains the dataset
βββ βββ πcreate_llm_ready_csv.ipynb
βββ πsrc/
β βββ πGift_Recommendation_Bot.py
β βββ πpages/
β β βββ πProducts Catalogue βοΈ.py
βββ πtmp/ # Used to store temporary csv file for data embedding
βββ π.streamlit/
β βββ πsecrets.toml # Used to store api Keys for running locally
βββ π.gitignore
βββ π.dockerignore
βββ π.Dockerfile
βββ πREADME.md
βββ πLICENCE.md
βββ πrequirements.txt
βββ πΌοΈbanner.png
This project was developed by a collaborative team. Each member played a crucial role in the research, development, and analysis:
- Mohamed Kallel
- Jean Christophe Rigoni
- Simon Pierre Rodner
This project is under the CC BY-NC 4.0 License. For more information, refer to the license file.