WhoBuilt

Supabase Vector: The Postgres Vector database

Nov 3, 2023· 16 min· 14K views·Watch on YouTube

Speaker

Paul Copplestone, CEO and co-founder of Supabase, makes the case for pgvector and Postgres at the AI Engineer conference, thanking Swyx and Ben for having him.

Supabase and pgvector

Copplestone describes Supabase as a backend service that gives each project a Postgres database, along with authentication, Deno-powered Edge Functions, file storage, and realtime features. Its vector offering uses pgvector to store embeddings. He says Supabase is open source and supports existing tools and communities.

How pgvector joined Supabase

Contributor Greg emailed Supabase about accepting pgvector as a Postgres extension, and the team merged it. Copplestone then invited Greg to help repair Supabase's documentation search, leading to Clippy, an AI-powered docs search example. He says Supabase now launches about 12,000 databases a week, with 10 to 15 percent using pgvector.

Responding to vector benchmarks

Copplestone recounts a claim that pgvector was 20 times slower than Qdrant and less accurate, based on PostgreSQL's IVF-Flat index. The pgvector contributors added HNSW with help from Oracle and AWS; in the chart he presents, HNSW improves query throughput and reaches 0.99 accuracy, matching Qdrant. He also describes a cost comparison with Pinecone, using six replicas costing $480 against a $410 Supabase database.

Using Postgres partitions for filtering

Copplestone uses an image embedding example to show how Postgres can classify uploads with a function and trigger. In his cat illustration, a similarity score above 0.8 sends an image to a good-cats partition, while other images go to a default partition. He says partitions can be indexed or dropped separately, which can help keep unwanted content out of the active dataset.

Postgres strengths and next steps

Copplestone points to Postgres extensions, row-level security, and keeping embeddings beside operational data to reduce database round trips. He sees room for specialized vector databases, while arguing Postgres fits storing, indexing, and retrieving embeddings. Supabase is exploring Citus sharding for enterprise workloads with billions of vectors and invites potential design partners.

Takeaways

  • Keep embeddings beside operational data when a single database fetch can replace multiple round trips.
  • Use Postgres triggers and functions to classify records as they arrive.
  • Consider partitions when you need to isolate, index, or remove subsets of vector data.
  • Treat vector benchmark results as dependent on the index, workload, accuracy target, and compute budget.
  • Explore row-level security to enforce user data boundaries inside the database.

Mentioned in this talk

Search inside this talk

What was claimed 10

  • founded
    CEO
    “I’m Paul Copplestone, CEO and co-founder of Supabase.”
    YouTube
    Verified4 sources· Talk, Web· archived
  • built
    “pgvector is actually owned by Andrew Kane, a solo contributor who developed it many years before Supabase came along.”
    YouTube
    Verified3 sources· Talk, Web· archived
  • feature
    Supabase: Provides a Postgres database for each project, authentication, Edge Functions, file storage, and realtime features.
    “We give you a full Postgres database.”
    YouTube
    Unverified1 source· Talk
  • uses
    “we have a vector offering for storing embeddings, powered by pgvector.”
    YouTube
    Unverified1 source· Talk
  • built
    “It’s a simple yet powerful extension to support vector operations. I’ve already done the work.”
    YouTube
    Unverified1 source· Talk
  • launched
    “we released Clippy”
    YouTube
    Unverified1 source· Talk
  • metric
    Supabase: Launching around 12,000 databases a week; an estimated 10–15% use pgvector.
    “we’re launching around 12,000 databases a week, and maybe 10 to 15% of them use pgvector”
    YouTube
    Unverified1 source· Talk
  • feature
    pgvector: HNSW indexing
    “It took about a month to build in HNSW.”
    YouTube
    Unverified1 source· Talk
Show all 10 facts

Related talks