Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Supabase 11 min read Announcement mediumAdept

postgres.new: In-browser Postgres with an AI interface

database.build (formerly postgres.new) runs unlimited Postgres databases entirely in the browser via PGlite, a WASM build of Postgres, paired with GPT-4o that has full autonomy over the disposable database. The LLM imports CSVs, generates Chart.js charts, builds ER diagrams from real DDL, and does in-browser semantic search using pgvector and Transformers.js. SQL errors are fed back to the model so it can self-correct, and embeddings are stored in a meta table and referenced by ID to avoid sending large vectors to the model. PGlite relies on Postgres's single-user mode plus wire protocol support, a /dev/blob virtual device for COPY, and IndexedDB/OPFS persistence. A new TypeScript library, pg-gateway, handles the startup/auth handshake so standard Postgres clients can connect to PGlite deployments.

Related posts

  • database.build v2: Bring-your-own-LLM

    Supabase mediumAdept

    database.build, Supabase's in-browser Postgres sandbox built on PGlite, now lets users bring any OpenAI-compatible LLM, with no login and no rate limits. Requests go straight from the browser to the provider. This works because most LLM APIs send CORS headers, and a service worker intercepts the Vercel AI SDK's /api/chat route, reading its BYO-LLM config from IndexedDB. Models need reliable tool calling, SQL knowledge and Chart.js knowledge, so gpt-4o is recommended; local Ollama models still struggle with tool calls, and Ollama buffers tool-call streams. The release also adds one-click deploys to Supabase by piping server-side pg_dump over Live Share into pg_restore, and replaces the tar.gz export with a WASM pg_dump. Serverless PGlite was shelved because of its memory use and single-connection limit in multi-tenant setups and unreliable s3fs storage.

  • Web-based AI SQL Playground and connecting to Postgres from the browser

    Neon mediumAdept

    Neon's Postgres AI Playground connects to a Postgres database directly from the browser and uses OpenAI's gpt-3.5-turbo to turn natural-language prompts into SQL. Browsers can't open TCP connections, so the Neon serverless driver tunnels the Postgres wire protocol through a WebSocket-to-TCP proxy. The proxy is open source and can be self-hosted to reach other Postgres providers. A Vercel edge function rate-limits requests with Upstash Redis, injects the user's schema (pulled from information_schema.columns and flattened to a compact text form) into the prompt, and streams the model's response back to the editor.

  • In-Browser Semantic AI Search with PGlite and Transformers.js

    Supabase mediumAdept

    A fully local, in-browser semantic search can be built by combining PGlite (Postgres compiled to run in the browser, persisted to IndexedDB) with the pgvector extension and Transformers.js running the Supabase/gte-small embedding model. The tutorial sets up a React/Vite app, creates an embeddings table with a 384-dimension vector column and an HNSW index using inner product ops, and seeds it with precomputed embeddings. Queries then embed the user's search text in the browser and run inner product search against the local database. Suggested use cases include e-commerce product search and similar-product suggestions without a server roundtrip.

  • Live Share: Connect to in-browser PGlite with any Postgres client

    Supabase mediumAdept

    database.build (formerly postgres.new) adds Live Share, which exposes an in-browser PGlite (WASM Postgres) database via a unique connection string usable from psql, pg_dump, ORMs or IDEs. A WebSocket-to-TCP proxy keeps a persistent WebSocket as a reverse tunnel to the browser, while pg-gateway terminates client TCP connections, handles startup, auth and the Postgres SSLRequest upgrade, and reads the TLS SNI server name to route each connection, since Postgres has no HOST header and off-the-shelf proxies can't do SNI routing behind its STARTTLS-style handshake. PGlite's single-connection limit breaks clients that open parallel connections (Prisma shadow DBs, DBeaver defaults), COPY FROM STDIN is unsupported, and multiplexing was rejected due to shared transaction and extended-query state.

  • ChatGPT plugins now support Postgres & Supabase

    Supabase mediumAdept

    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.

The quest for software engineering knowledge.

Look:
Layout: