Skip to content

feat: Add Supabase integration with PgVector document store and embedding retriever #3164

Merged
davidsbatista merged 37 commits intodeepset-ai:mainfrom
pontuselmrin:supabase
Apr 22, 2026
Merged

feat: Add Supabase integration with PgVector document store and embedding retriever #3164
davidsbatista merged 37 commits intodeepset-ai:mainfrom
pontuselmrin:supabase

Conversation

@pontuselmrin
Copy link
Copy Markdown
Contributor

Related Issues

Proposed Changes:

  • Adds a new supabase integration (integrations/supabase/) that provides SupabasePgVectorDocumentStore and SupabasePgvectorEmbeddingRetriever as thin wrappers around the existing pgvector-haystack integration, pre-configured for Supabase's connection model.
  • They subclass the PgvectorDocumentStore and PgvectorEmbeddingRetriever, respectively

How did you test it?

The testing functionality is done using a Supabase instance but because the feature is wrapping the pgvector integration the tests are essentially lifted from there.

  • Unit tests covering init (defaults, custom params, invalid store), serialization (to_dict/from_dict), run, and run_async
  • All existing integration tests continue to pass
  • integrated a full CI workflow via supabase.yml

Notes for the reviewer

Tested on Mac OS and Supabase CLI run via Docker locally.

Checklist

@pontuselmrin pontuselmrin requested a review from a team as a code owner April 14, 2026 18:11
@pontuselmrin pontuselmrin requested review from julian-risch and removed request for a team April 14, 2026 18:11
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 14, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added topic:CI type:documentation Improvements or additions to documentation labels Apr 14, 2026
@pontuselmrin pontuselmrin marked this pull request as draft April 14, 2026 18:12
@pontuselmrin pontuselmrin marked this pull request as ready for review April 14, 2026 18:32
@julian-risch julian-risch requested review from bogdankostic and removed request for julian-risch April 15, 2026 13:13
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to rename the file from document_store.py to pg_document_store.py the reason for the same is this issue makes use of SupabaseVectorBucketDocumentStore. Hence the question.
cc @davidsbatista

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its a good idea to wait for this one to be merged. I already scaffolded the integration so I think it could simplify the workflow for you a bit. @srini047

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's what even I think orelse the effort gets duplicated here. So only my question on file naming remains.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's first merge this one - it's already in a very good state, just a few things need being addressed

@davidsbatista davidsbatista self-requested a review April 16, 2026 08:16
@davidsbatista
Copy link
Copy Markdown
Contributor

@pontuselmrin I did a first review and pushed some adjustments and fixed a few issues. But, overall, the PR looks pretty good!

Just some small improvements to complete it, and it should be ready to go:

  • We can also add a SupabasePgvectorKeywordRetriever as with the embedding retriever inheriting from the PgvectorEmbeddingRetriever
  • No retriever integration test, all the tests are still unit tests, we should add some integration tests that run against a docker instance
  • The README is missing setup instructions, env var, connection modes, and examples

Let me know if you have any questions/doubts

@pontuselmrin
Copy link
Copy Markdown
Contributor Author

@davidsbatista Thanks for the review David! I'm working on addressing your points.

@davidsbatista
Copy link
Copy Markdown
Contributor

@pontuselmrin thanks for the corrections/additions and adjustments. I worked a bit on your branch, namely:

  • Dropped create_extension=True from test fixtures — Supabase pre-enables pgvector, so the override was incorrect; CI workflow and local docker-compose.yml now pre-create the extension instead
  • Replaced test_retrieval.py + test_retriever.py with one file per retriever, matching the Elasticsearch/OpenSearch convention
  • Removed test classes in favour of module-level functions; @pytest.mark.integration is now applied per function, also following what Elasticsearch/OpenSearch integrations do
  • Added missing tests: test_from_dict_without_filter_policy, test_run_with_filters, test_run_async_with_filters, and split test_init_default into focused single-concern tests

@davidsbatista
Copy link
Copy Markdown
Contributor

Ot looks good - green - I will give it another look tomorrow morning and then merge.

In the mean time, @pontuselmrin do you want to open a PR here: https://github.com/deepset-ai/haystack-integrations so that this integration is listed ou our website?

@pontuselmrin
Copy link
Copy Markdown
Contributor Author

@davidsbatista Thanks for going over it again, I'm opening the PR at the integrations page now :)

Copy link
Copy Markdown
Contributor

@davidsbatista davidsbatista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this @pontuselmrin - we appreciated it! :)

@davidsbatista davidsbatista merged commit f682fc4 into deepset-ai:main Apr 22, 2026
11 checks passed
@pontuselmrin pontuselmrin deleted the supabase branch April 22, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic:CI type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SupabasePgVectorDocumentStore and SupabasePgvectorEmbeddingRetriever

4 participants