---
title: "ChatGPT plugins now support Postgres & Supabase"
description: "Supabase contributed Postgres and Supabase datastore providers to OpenAI's ChatGPT Retrieval Plugin, storing text-embedding-ada-002 embeddings in pgvector."
url: "https://swe.quest/articles/chatgpt-plugins-now-support-postgres-supabase-db9d10a95a8d96b9"
canonical: "https://supabase.com/blog/chatgpt-plugins-support-postgres"
source: "Supabase"
published: "2023-05-25"
difficulty: "medium"
kind: "How-to"
reading_minutes: 7
tags: ["rag","vector-search","postgres","llms"]
---

# ChatGPT plugins now support Postgres & Supabase

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2023-05-25, 7 min read, How-to. Original: [https://supabase.com/blog/chatgpt-plugins-support-postgres](https://supabase.com/blog/chatgpt-plugins-support-postgres)

## Summary

Supabase contributed Postgres and Supabase datastore providers to OpenAI's ChatGPT Retrieval Plugin, storing text-embedding-ada-002 embeddings in pgvector. The Postgres provider connects directly via psycopg2, while the Supabase provider goes through PostgREST to enable Row Level Security. Both share the same documents schema and use a plpgsql match function that filters by source, author and date and ranks results by inner product distance. A walkthrough ingests the PostgreSQL 15 docs (about 7,904 chunks), adds an approximate ivfflat index with lists ≈ rows/1000, and registers the local plugin with ChatGPT to answer documentation questions.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [RAG & retrieval](https://swe.quest/tags/rag.md) (AI & ML)
- [Vector search](https://swe.quest/tags/vector-search.md) (Data & databases)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)

## Prerequisites

- PostgreSQL basics ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- text embeddings ([easy posts on RAG & retrieval](https://swe.quest/tags/rag.md?difficulty=easy))
- Python tooling ([easy posts on Python](https://swe.quest/tags/python.md?difficulty=easy))

## Keywords

ChatGPT Retrieval Plugin, pgvector, Supabase, PostgREST, text-embedding-ada-002, ivfflat, psycopg2

## Related posts

- [Storing OpenAI embeddings in Postgres with pgvector](https://swe.quest/articles/storing-openai-embeddings-in-postgres-with-pgvector-19a5d03614f86fc6.md): Supabase · 2023-02-06 · Medium · 11 min read · Vector search, PostgreSQL, RAG & retrieval, LLMs
  pgvector adds a vector data type and distance operators (Euclidean \<-\>, negative inner product \<#\>, cosine \<=\>) to Postgres, so OpenAI text-embedding-ada-002 embeddings (1536 dimensions) can be stored and queried for similarity directly in the database.
- [Hugging Face is now supported in Supabase](https://swe.quest/articles/hugging-face-is-now-supported-in-supabase-b922ce506c4fa31d.md): Supabase · 2023-08-07 · Medium · 7 min read · Vector search, PostgreSQL, Serverless, Python, JavaScript
  Supabase adds first-class Hugging Face support for generating embeddings stored in pgvector, as an open-source, self-hostable alternative to OpenAI's text-embedding-ada-002.
- [Build an end-to-end RAG pipeline entirely in psql using pgrag and DeepSeek](https://swe.quest/articles/build-an-end-to-end-rag-pipeline-entirely-in-psql-using-pgrag-and-deepseek-250dc9ab3281f7d0.md): Neon · 2025-01-30 · Medium · 9 min read · RAG & retrieval, PostgreSQL, Vector search, LLMs
  pgrag, Neon's open-source Postgres extension, lets you build a complete RAG pipeline inside psql.
- [Supabase Vecs: a vector client for Postgres](https://swe.quest/articles/supabase-vecs-a-vector-client-for-postgres-06f6cf65595a4da8.md): Supabase · 2023-05-29 · Medium · 4 min read · Vector search, PostgreSQL, Python
  Vecs is a Python client that makes Postgres with the pgvector extension behave like a dedicated vector store, handling collection (table) creation, indexing, upserts, and similarity queries by cosine, L2, or max inner product with a jsonb-backed metadata filter DSL.
- [Building a RAG application with Llama 3.1 and pgvector](https://swe.quest/articles/building-a-rag-application-with-llama-3-1-and-pgvector-aa7660e0eb99da02.md): Neon · 2024-07-30 · Medium · 12 min read · RAG & retrieval, Vector search, PostgreSQL, LLMs, Python
  A small RAG pipeline built on Neon Postgres with pgvector as the vector store, OctoAI's gte-large embedding model producing 1024-dimensional vectors, and Llama 3.1 405B generating answers.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
