Installation
- Install Wagtail Vector Index. You need to specify optional dependencies for vector
backend and AI backends (for embeddings and chat models) and it will depend on your
project's circumstances.
- Select an AI provider backend, we recommend starting with
LiteLLM. - For the vector storage provider, you can choose between:
- pgvector (Postgres database extension):
python -m pip install wagtail-vector-index[pgvector] - Qdrant:
python -m pip install wagtail-vector-index[qdrant] - Weaviate:
python -m pip install wagtail-vector-index[weaviate] - NumPy:
python -m pip install wagtail-vector-index[numpy](not recommended for big databases or production applications due to scale issues) - Read more about storage providers on the specific documentation page: Storage Providers.
- pgvector (Postgres database extension):
- In your final installation call, you should comma-separate the optional
dependencies you want to install, e.g.
python -m pip install wagtail-vector-index[litellm,pgvector].
- Select an AI provider backend, we recommend starting with
- Add
wagtail_vector_indexto yourINSTALLED_APPSin your Django project settings file.- If you are using the pgvector backend, you also need to add the specific pgvector app:
- Add an AI backend configuration to your Django project settings file. Wagtail
Vector Index ships with a backend for the
LiteLLM package which you configure for OpenAI in your project
settings:
WAGTAIL_VECTOR_INDEX = { "CHAT_BACKENDS": { "default": { "CLASS": "wagtail_vector_index.ai_utils.backends.litellm.LiteLLMChatBackend", "CONFIG": { "MODEL_ID": "gpt-3.5-turbo", }, }, }, "EMBEDDING_BACKENDS": { "default": { "CLASS": "wagtail_vector_index.ai_utils.backends.litellm.LiteLLMEmbeddingBackend", "CONFIG": { "MODEL_ID": "text-embedding-ada-002", }, } }, } - You can supply your OpenAI key in the
OPENAI_API_KEYenvironment variable which is read directly by the openai library (installed by the llm package). - Run database migrations.