NOTE: the examples here work with AllegroGraph 8.0.0
or later. The Embedding Tool in AGWebView was introduced in 8.1.0
but the provided agtool
method for embedding works with versions before 8.1.0
.
Welcome to AllegroGraph's LLM Embedding Example Jupyter notebook. To start, please run the following commands to create a conda environment.
First, create a new environment
conda create -n agvector python=3.10
then activate the new conda environment with:
conda activate agvector
then run the install environment script
./create-environment.sh
To actually perform the SPARQL queries you need to set your OpenAI API key as a query option in webview. Please follow the following instructions to do so.
- Please navigate to your local installation of the new webview
- Go to the repository where your data is stored (
llm-philosophy
if you're using the repo created from this demo) - Go to
Repository Control
in the left column underRepository
and search forquery execution options
. Select it. - Select
+ New Query Option
and add openaiApiKey as the name, and your OpenAI api key as the value. Set theScope
to Repository - Don't forget to save by hitting
Save Query Options
!
- In your terminal, navigate to your AllegroGraph installation.
cd
to/data/rootcatalog/
and then to the repository, in our casellm-philosophy
rm *.vdb.*
if you want to delete all existing VDBs associated with that repo, otherwise you can manuallyrm
thellm-philosophy.vdb.vec
andllm-philosophy.vdb.dat
files.