Python client
Manage unstructured vector stores in PostgreSQL.
Supabase provides a Python client called vecs
for managing unstructured vector stores. This client provides a set of useful tools for creating and querying collections in Postgres using the pgvector extension.
Quick start
Let's see how Vecs works using a local database. Make sure you have the Supabase CLI installed on your machine.
Initialize your project
Start a local Postgres instance in any folder using the init
and start
commands. Make sure you have Docker running!
Create a collection
Inside a Python shell, run the following commands to create a new collection called "docs", with 3 dimensions.
Add embeddings
Now we can insert some embeddings into our "docs" collection using the upsert()
command:
Query the collection
You can now query the collection to retrieve a relevant match:
Deep dive
For a more in-depth guide on vecs
collections, see API.
Resources
- Official Vecs Documentation: https://supabase.github.io/vecs/api
- Source Code: https://github.com/supabase/vecs