Project · Shipped · Open-source n8n template

rag-plug&play: any document, now a chatbot

Built with n8n, OpenAI, Supabase and Postgres

Results

No code

an n8n template you import

OpenAI

embeddings + chat model

Supabase

vector store

Postgres

chat memory

The problem

General chatbots don't know your documents, and building a bot that answers from them usually means wiring up loaders, embeddings and a vector store by hand.

How it works

Point it at a file in Google Drive: it's split into chunks, embedded with OpenAI and stored in Supabase. Then chat — an AI agent searches those vectors, remembers the conversation in Postgres and answers from your file. The sample bot knows a simplified Rules of Golf.

1 · Add knowledge

Google Drive

your document

Data loader

split into chunks

OpenAI

embeddings

Supabase

vector store

2 · Ask

Chat message

your question

AI agent

OpenAI chat model

Supabase + Postgres

search docs · remember chat

Answer

grounded in your doc

Demo

Index the PDF once, then ask. Each answer cites the rule it came from, and the follow-up question ("And if it were match play?") uses chat memory to fill in the context. Open as GIF ↗

What I learned

Building it end to end showed me which parts of RAG are simple and where the real product decisions sit.

  • The plumbing breaks in boring places. Most of my debugging was setup, not AI: a trailing slash in the Supabase host URL, and knowing what to change in the SQL to use a table other than the default.
  • Embeddings are cheap. OpenAI's text-embedding-3-small costs about $0.02 per million tokens, so indexing a whole rulebook costs almost nothing.
  • Plain vector search is only the starting point. For a real product I'd push for hybrid search (meaning plus exact keywords), metadata filters, and a golden dataset of questions with known answers to test against before shipping.
  • RAG isn't always the answer. For one short rulebook, a long-context model could read the whole thing. RAG earns its place when the documents are many or keep changing.

Try it

View on GitHub ↗ Get the n8n template ↗
← All projects Get in touch →