This project provides a production-ready MVP for securely chatting with your documents using pgvector, targeting developers and power users who want to build RAG applications. It enables users to upload documents, chat with them via an interactive interface, and leverages OpenAI's GPT models for natural language processing.
How It Works
The application utilizes Supabase for backend services, including authentication, storage, and a PostgreSQL database enhanced with the pgvector
extension. Documents are uploaded to Supabase Storage, processed into sections, and their embeddings are generated using an Edge Function that calls Supabase's AI inference capabilities. A similarity search is performed against these embeddings to retrieve relevant document chunks, which are then fed into an OpenAI model via another Edge Function to generate context-aware responses.
Quick Start & Requirements
- Install: Clone the repository and checkout specific steps (
git checkout step-X
).
- Prerequisites: Unix-based OS (or WSL2), Docker, Node.js 18+.
- Setup: Follow the detailed workshop instructions and YouTube video for a step-by-step guide.
- Links: YouTube Video
Highlighted Details
- Leverages
pgvector
for efficient similarity search.
- Integrates Supabase Storage for secure document handling.
- Uses Supabase Edge Functions for backend AI processing and OpenAI API calls.
- Frontend embedding generation via Transformers.js in Web Workers.
- Supports 3rd-party authentication providers.
Maintenance & Community
- Developed by the Supabase community.
- Feedback and issues can be filed on the repository's issue board.
- Links to Supabase Vector resources are provided for further learning.
Licensing & Compatibility
- The repository itself is likely under a permissive open-source license (e.g., MIT, Apache), but specific license details are not explicitly stated in the provided text.
- Compatibility for commercial use is generally high, assuming the underlying Supabase services and OpenAI API usage align with their respective terms.
Limitations & Caveats
- The project is presented as a workshop, implying it's a guide to building rather than a standalone, pre-packaged application.
- Embedding generation failure in triggered Edge Functions can lead to missing embeddings; strategies for handling this in production are discussed.
- Transformers.js requires models to be in ONNX format, which may necessitate conversion for custom models.