---
title: "postgres.new: In-browser Postgres with an AI interface"
description: "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."
url: "https://swe.quest/articles/postgres-new-in-browser-postgres-with-an-ai-interface-55583d716a34d5b8"
canonical: "https://supabase.com/blog/postgres-new"
source: "Supabase"
published: "2024-08-12"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 11
tags: ["postgres","webassembly","llms","ai-agents","browsers"]
---

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

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2024-08-12, 11 min read, Announcement. Original: [https://supabase.com/blog/postgres-new](https://supabase.com/blog/postgres-new)

## Summary

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.

Written by swe.quest, not by the author.

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

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [WebAssembly](https://swe.quest/tags/webassembly.md) (Languages)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Browsers](https://swe.quest/tags/browsers.md) (Web & mobile)

## Prerequisites

- PostgreSQL basics ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- WebAssembly basics ([easy posts on WebAssembly](https://swe.quest/tags/webassembly.md?difficulty=easy))
- LLM tool use ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))

## Keywords

PGlite, database.build, pgvector, pg-gateway, Transformers.js, ElectricSQL, Chart.js, GPT-4o

## Related posts

- [database.build v2: Bring-your-own-LLM](https://swe.quest/articles/database-build-v2-bring-your-own-llm-b2a3b83eee7ef5a0.md): Supabase · 2024-12-06 · Medium · 11 min read · PostgreSQL, LLMs, Browsers, WebAssembly
  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.
- [Web-based AI SQL Playground and connecting to Postgres from the browser](https://swe.quest/articles/web-based-ai-sql-playground-and-connecting-to-postgres-from-the-browser-fa7f4eccd9643a37.md): Neon · 2023-05-19 · Medium · 5 min read · PostgreSQL, LLMs, Serverless, JavaScript
  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.
- [In-Browser Semantic AI Search with PGlite and Transformers.js](https://swe.quest/articles/in-browser-semantic-ai-search-with-pglite-and-transformers-js-f90228d6e99e01b6.md): Supabase · 2024-08-29 · Medium · 7 min read · Vector search, PostgreSQL, Browsers, JavaScript, React
  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.
- [Live Share: Connect to in-browser PGlite with any Postgres client](https://swe.quest/articles/live-share-connect-to-in-browser-pglite-with-any-postgres-client-bc4a637942fe2ca5.md): Supabase · 2024-10-10 · Medium · 6 min read · PostgreSQL, Networking, Load balancing, WebAssembly, Browsers
  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.
- [ChatGPT plugins now support Postgres & Supabase](https://swe.quest/articles/chatgpt-plugins-now-support-postgres-supabase-db9d10a95a8d96b9.md): Supabase · 2023-05-25 · Medium · 7 min read · RAG & retrieval, Vector search, PostgreSQL, LLMs
  Supabase contributed Postgres and Supabase datastore providers to OpenAI's ChatGPT Retrieval Plugin, storing text-embedding-ada-002 embeddings in pgvector.

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)
