Skip to content

SupabasePgVectorDocumentStore and SupabasePgvectorEmbeddingRetriever #3081

@davidsbatista

Description

@davidsbatista

Implement SupabasePgVectorDocumentStore and SupabasePgvectorEmbeddingRetriever as a thin wrapper around the existing pgvector-haystack integration, pre-configured to work with Supabase's connection model.

Detailed design

Reuses PgvectorDocumentStore under the hood and handles Supabase-specific connection setup (URL + service role key/JWT).

from haystack_integrations.document_stores.supabase import SupabasePgVectorDocumentStore
from haystack_integrations.components.retrievers.supabase import SupabasePgvectorEmbeddingRetriever

document_store = SupabasePgVectorDocumentStore(
    supabase_url="https://<project>.supabase.co",
    supabase_key=Secret.from_env_var("SUPABASE_SERVICE_KEY"),
    table_name="haystack_documents",
    embedding_dimension=1536,
)

retriever = SupabasePgvectorEmbeddingRetriever(document_store=document_store, top_k=5)

Implementation notes

  • Primary dependency: supabase-py + pgvector-haystack
  • Auth via supabase_url and supabase_key (using Secret for secure handling)
  • Supabase connection strings follow the pattern postgresql://postgres.<project>:<password>@aws-0-<region>.pooler.supabase.com:6543/postgres
  • Support optional schema and table_name overrides
  • Integration lives in integrations/supabase/

Checklist

  • The code is documented with docstrings and was merged in the main branch
  • There is a Github workflow running the tests for the integration nightly and at every PR

Metadata

Metadata

Labels

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions