---
title: "Supabase Vecs: a vector client for Postgres"
description: "Vecs is a new Python library for managing embeddings in Postgres databases that use pgvector, offering a vector-store-like interface for table creation, indexing, querying, and metadata filtering. Collections are stored in a vecs schema with an id text primary key, a vector column, and JSONB metadata; queries support cosine distance, l2 distance, and maximum inner dot product, with optional filters and returned values. A short Python workflow can create a collection, upsert records, create an index after insertion, and search by vector; the collection can also be queried without an index. With Supabase, a collection can be exposed through a public-schema view and accessed from supabase-js, while proposed preprocessing transforms and an asynchronous client remain under debate."
---

# Supabase Vecs: a vector client for Postgres

[Supabase](https://yomu.fyi/company/supabase) · oli\_rice · May 29, 2023

**Type:** Announcement

## Summary

Vecs is a new Python library for managing embeddings in Postgres databases that use pgvector, offering a vector-store-like interface for table creation, indexing, querying, and metadata filtering. Collections are stored in a vecs schema with an id text primary key, a vector column, and JSONB metadata; queries support cosine distance, l2 distance, and maximum inner dot product, with optional filters and returned values. A short Python workflow can create a collection, upsert records, create an index after insertion, and search by vector; the collection can also be queried without an index. With Supabase, a collection can be exposed through a public-schema view and accessed from supabase-js, while proposed preprocessing transforms and an asynchronous client remain under debate.

## Context

The stated goal is to make Postgres with pgvector look and feel like a dedicated vector store while supporting ease of use, interactivity, exploratory data analysis, and search workloads. Vecs is also intended to remain useful for people who want either a visible SQL layer or a higher-level interface that hides database details.

## Approach / What changed

Vecs provides a Python client for creating and indexing pgvector-backed tables, inserting or updating records, querying by supported distance measures, and filtering JSONB metadata through a lightweight DSL. Supabase deployments can expose a collection through a public-schema view. Optional preprocessing pipelines and an async client are proposed future directions, not currently functional features.

## Takeaways

- get\_or\_create\_collection creates a table in the vecs schema with an id text primary key, a vector column sized to the declared dimension, and a non-null JSONB metadata column.
- Collection.upsert adds a record when its user-defined identifier is new and updates the existing record when that identifier already exists.
- The proposed transformation pipeline and asynchronous client are mock code only and remain subjects of debate in the referenced feature requests.

**Tags:** [Open Source](https://yomu.fyi/topic/open-source), [Postgres](https://yomu.fyi/topic/postgres), [Python](https://yomu.fyi/topic/python), [Search](https://yomu.fyi/topic/search)

- Source: [Supabase](https://supabase.com/blog/vecs)
- Source URL: https://supabase.com/blog/vecs
- Ingested by Yomu: 2026-08-29T01:18:15.690Z

[Read original post](https://supabase.com/blog/vecs)
