Supabase

FirstBatch integrates Supabase/PGVector through the Supabase Class.

Example run:

import vecs
from firstbatch import Supabase

supabase_uri = os.environ["SUPABASE_URL"]
client = vecs.create_client(supabase_uri)
embedding_size = int(os.environ["EMBEDDING_SIZE"])
config = Config(batch_size=20, verbose=True)
personalized = FirstBatch(api_key=os.environ["FIRSTBATCH_API_KEY"], config=config)
personalized.add_vdb("supabase_db", Supabase(client=client, collection_name="default", query_name="match_documents", embedding_size=embedding_size))

Distance metric can explicitly be provided. If not, default value is COSINE_SIM

class DistanceMetric(Enum):
    COSINE_SIM = "cosine_sim"
    EUCLIDEAN_DIST = "euclidean_dist"
    DOT_PRODUCT = "dot_product"
from firstbatch import DistanceMetric

Supabase(client=client, collection_name="default", query_name="match_documents"
distance_metric=DistanceMetric.EUCLIDEAN_DIST)

Last updated