Create a chat assistant that answers questions from your documents. It loads a file from Google Drive, stores it in a Supabase vector database, and uses an AI model to give clear answers. Great for support teams, training content, or policy help.
The chat starts when a message comes in. The system searches your Supabase table for the most relevant text chunks and feeds them to an AI chat model to write a helpful reply. Content is built from a Google Drive file, converted from EPUB, split into small parts, turned into embeddings, and saved in Supabase. It retrieves the top 10 matches using a custom match function. A response step formats the final text for easy output. You can also update records with upsert steps to keep the database current.
Setup needs pgvector enabled in Supabase, a table with an embedding column sized for your model, and a match_documents function. Use the same OpenAI embedding model for insert, upsert, and retrieval so dimensions match. Expect faster answers, fewer manual searches, and more capacity without adding staff. Ideal for knowledge bases, course material, and product documentation.