Supabase is an open-source Firebase alternative.Supabaseis built on top ofPostgreSQL, which offers strong SQL querying capabilities and enables a simple interface with already-existing tools and frameworks.
PostgreSQL also known as Postgres, is a free and open-source relational database management system (RDBMS) emphasizing extensibility and SQL compliance.
This notebook shows how to use Supabase and pgvector as your VectorStore.
You’ll need to install langchain-community with pip install -qU langchain-community to use this integration
To run this notebook, please ensure:
- the
pgvectorextension is enabled - you have installed the
supabase-pypackage - that you have created a
match_documentsfunction in your database - that you have a
documentstable in yourpublicschema similar to the one below.
OpenAIEmbeddings so we have to get the OpenAI API Key.
SupabaseVectorStore directly:
Similarity search with score
The returned distance score is cosine distance. Therefore, a lower score is better.Retriever options
This section goes over different options for how to use SupabaseVectorStore as a retriever.Maximal marginal relevance searches
In addition to using similarity search in the retriever object, you can also usemmr.