---
title: "ChatGPT plugins now support Postgres & Supabase"
description: "Retrieval plugins let ChatGPT access relevant content from private datasets by chunking documents, generating embeddings with OpenAI’s text-embedding-ada-002, and querying a vector database. The article describes Postgres and Supabase datastore implementations using pgvector, with a shared documents schema and a match_page_sections function that filters by source, author, document, and date before ranking vectors with inner product distance. It then gives a local example: downloading the Postgres 15 documentation as a PDF, uploading it through the plugin’s /upsert-file endpoint, and configuring environment variables for Supabase or Postgres. The example produced 7,904 document records, and an optional IVFFlat index can trade exact nearest-neighbor search for approximate search; after registering the local plugin in ChatGPT, users can ask questions answered from the documentation."
---

# ChatGPT plugins now support Postgres & Supabase

[Supabase](https://yomu.fyi/company/supabase) · egor\_romanov,paul\_copplestone · May 25, 2023

**Type:** Tutorial

## Summary

Retrieval plugins let ChatGPT access relevant content from private datasets by chunking documents, generating embeddings with OpenAI’s text-embedding-ada-002, and querying a vector database. The article describes Postgres and Supabase datastore implementations using pgvector, with a shared documents schema and a match\_page\_sections function that filters by source, author, document, and date before ranking vectors with inner product distance. It then gives a local example: downloading the Postgres 15 documentation as a PDF, uploading it through the plugin’s /upsert-file endpoint, and configuring environment variables for Supabase or Postgres. The example produced 7,904 document records, and an optional IVFFlat index can trade exact nearest-neighbor search for approximate search; after registering the local plugin in ChatGPT, users can ask questions answered from the documentation.

## Context

ChatGPT needs a way to answer questions using private or external datasets. Retrieval plugins provide access to sources such as PDFs, Confluence, and Notion knowledge bases by retrieving relevant information during conversations.

## Approach / What changed

The implementation adds Postgres and Supabase as vector datastore options for the ChatGPT Retrieval Plugin using pgvector. Postgres connects through psycopg2, while Supabase uses PostgREST. The tutorial creates the shared documents schema and match\_page\_sections function, configures the plugin, uploads the Postgres documentation, and registers the local plugin with ChatGPT.

## Takeaways

- The Postgres datastore uses psycopg2 for direct database access, while the Supabase datastore uses PostgREST, which supports Row Level Security and use of the data beyond ChatGPT.
- The shared match\_page\_sections function filters records by source, author, document, and date, then finds nearest embeddings with the inner product distance function and returns a similarity score.
- Uploading the Postgres documentation created 7,904 document records. An IVFFlat index can speed searches, but changes exact nearest-neighbor search to approximate nearest-neighbor search.

**Tags:** [LLMs](https://yomu.fyi/topic/llm), [Performance](https://yomu.fyi/topic/performance), [Postgres](https://yomu.fyi/topic/postgres), [Python](https://yomu.fyi/topic/python), [Search](https://yomu.fyi/topic/search)

- Source: [Supabase](https://supabase.com/blog/chatgpt-plugins-support-postgres)
- Source URL: https://supabase.com/blog/chatgpt-plugins-support-postgres
- Ingested by Yomu: 2026-08-29T01:18:11.412Z

[Read original post](https://supabase.com/blog/chatgpt-plugins-support-postgres)
