Adds semantic search example using Supabase Vector #913
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds a cookbook example to store and query OpenAI embeddings in Supabase using pgvector and Supabase's auto-generated REST API. This guide is written for JavaScript developers, but also adds callouts that explain how they can modify it for other languages.
Motivation
Many Supabase customers use OpenAI embeddings in their DB (via pgvector) to perform semantic search and RAG over their data. This PR adds a guide that demonstrates exactly how to implement semantic search in Supabase using OpenAI embeddings while also following database best practices (like HNSW indexes, row level security, etc).
Supabase exposes an auto-generated REST API (based on the user's table schema), so this guide walks users through how to interact with their data via this API. There also aren't too many cookbook examples written for JavaScript developers, so this guide targets this audience and explains how to implement semantic search for multiple JavaScript runtimes (Node.js, Deno, Edge Functions). Since this focuses on JavaScript, the guide was written as
mdx
, but let me know ifipynb
is preferred here!For new content
When contributing new content, read through our contribution guidelines, and mark the following action items as completed:
We will rate each of these areas on a scale from 1 to 4, and will only accept contributions that score 3 or higher on all areas. Refer to our contribution guidelines for more details.