In this notebook you'll take an Amazon product reviews dataset from Kaggle and use OpenAI gpt-4o to obtain product review summaries, upsert those summaries in a vector database, then use Retrieval Augmented Generation (RAG) to power a sales chatbot that can make targeted product recommendations.
Let's take a look at the overall workflow:
We'll use OpenAI to power all of the GenAI model needs of this notebook: LLMs, image gen, image animation.
In this example we will use the gpt-4o instruct model.
We'll use Couchbase Capella for our vector database. You can create your free account here with your GitHub account or your email.
Open your terminal or command prompt and use the cd command to navigate to the directory where your Jupyter notebook is located. For example:
cd /path/to/your/sales-bot-with-couchbase-vector-databaseUse the venv module (or virtualenv if you prefer) to create a new virtual environment within that directory:
python -m venv .venv # Creates a virtual environment named '.venv'Activate the environment to start using it:
source .venv/bin/activate # On Linux/macOS
.venvScriptsactivate # On WindowsThis allows Jupyter to recognize your virtual environment:
pip install ipykernelThis makes your virtual environment selectable within Jupyter:
python -m ipykernel install --user --name=.venv --display-name="My Notebook Env"(Replace "My Notebook Env" with a descriptive name for your kernel.)
jupyter notebookYou don't need to install additional pip packages ahead of running the notebook, since those will be installed right at the beginning. You will need to ensure your system has imagemagick installed by following the instructions.
source .venv/bin/activate