---
title: "Build your own ChatGPT-style doc search with Fresh, OpenAI, and Supabase"
description: "A Deno Fresh starter template builds a ChatGPT-style documentation search on Supabase Postgres with pgvector and OpenAI."
url: "https://swe.quest/articles/build-your-own-chatgpt-style-doc-search-with-fresh-openai-and-supabase-25f47f7089be5f99"
canonical: "https://deno.com/blog/build-chatgpt-doc-search-with-supabase-fresh"
source: "Deno"
published: "2023-05-11"
difficulty: "medium"
kind: "How-to"
reading_minutes: 4
tags: ["rag","vector-search","postgres","typescript","llms"]
---

# Build your own ChatGPT-style doc search with Fresh, OpenAI, and Supabase

A post on [Deno](https://swe.quest/sources/deno.md), published 2023-05-11, 4 min read, How-to. Original: [https://deno.com/blog/build-chatgpt-doc-search-with-supabase-fresh](https://deno.com/blog/build-chatgpt-doc-search-with-supabase-fresh)

## Summary

A Deno Fresh starter template builds a ChatGPT-style documentation search on Supabase Postgres with pgvector and OpenAI. A GitHub Action running Deno preprocesses .mdx docs, generates OpenAI embeddings and stores them in Postgres, using per-file checksums so only changed files are re-embedded. At query time an edge endpoint embeds the question, runs a pgvector similarity search, injects the matching doc sections into a text-davinci-003 completion prompt, and proxies the streamed SSE response to a Fresh island that reads it with EventSource.

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)
- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)

## Prerequisites

- text embeddings ([easy posts on RAG & retrieval](https://swe.quest/tags/rag.md?difficulty=easy))
- Postgres basics ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- GitHub Actions ([easy posts on CI/CD](https://swe.quest/tags/ci-cd.md?difficulty=easy))

## Keywords

Deno Fresh, Supabase, pgvector, OpenAI GPT-3, Deno Deploy, GitHub Actions, Server-Sent Events

## Related posts

- [Generate embeddings with Neon AI Gateway](https://swe.quest/articles/generate-embeddings-with-neon-ai-gateway-8da1f214a3b9e4fc.md): Neon · 2026-10-02 · Medium · 7 min read · RAG & retrieval, Vector search, PostgreSQL, LLMs
  Neon AI Gateway now serves embedding models on its OpenAI-compatible /v1/embeddings endpoint using the same branch-scoped credential as chat, accepting up to 150 inputs per request.
- [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.
- [Build Your Own AI-Driven Code Analysis Chatbot for Developers with the GenAI Stack](https://swe.quest/articles/build-your-own-ai-driven-code-analysis-chatbot-for-developers-with-the-genai-062f35bb279ec41b.md): Docker · 2024-06-06 · Medium · 10 min read · RAG & retrieval, LLMs, AI for coding, Containers, Python
  Code Explorer, a winning Docker AI/ML Hackathon project, is a RAG chatbot that answers questions about a local codebase by parsing source files, chunking them with LangChain's RecursiveCharacterTextSplitter (5000 characters with 500 overlap), and storing embeddings in a Neo4j vector store.
- [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.
- [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.

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)
