for the Craft 2024 presentation.
Ensure you are using Python v3.8 - v3.11 (newer versions may work too).
Working in a virtual environment is suggested for isolation and better control.
Install
pip install -r requirements.txt
The happy path is to use an Astra DB instance to run the demos.
Visit astra.datastax.com
, sign up for a free account, create a Vector Database
and when it's ready grab the API Endpoint and generate a Token for it.
Notebooks will ask you for these two secrets. If you're running locally, you can
copy the .env.template
file to a new .env
and set the secrets there to skip
interactive secret input. A few demos also need an OpenAI API key, which can also
be set in .env
.
Run locally from the repo's root with
jupyter notebook
or alternatively open the notebooks in Google Colab (links below).
Note. Free-tier accounts have a limited number of collections available.
If you run into an error ("too many indices...") while creating collections on
Astra DB, try dropping collections from previous demos. This means uncommenting
the actual drop
method in each notebook's last cell -- just emptying the contents
with the delete_all
method does not suffice).
In the Jupyter console, open and run the Demo 1 notebook.
Alternatively you can run it in Colab (or just view the notebook).
Open and run the Demo 2 notebook.
Alternatively: Colab, or view in browser.
Open and run the Demo 3 notebook.
Alternatively: Colab, or view in browser.
Open and run the Demo 4 notebook.
Alternatively: Colab, or view in browser.
Open and run the Demo 5 notebook.
Alternatively: Colab, or view in browser.
Open and run the Demo 6 notebook.
Alternatively: Colab, or view in browser.
Open and run the Demo 7 notebook.
Alternatively: Colab, or view in browser.
Open and run the Demo 8 notebook.
Alternatively: Colab, or view in browser.
Note: this demo will install additional requirements when run for the first time - an operation which may take a few minutes.
Open and run the Demo 9 notebook.
Alternatively: Colab, or view in browser.
Note: this demo is originally featured in the OpenAI Cookbook gallery.