Starbase / 02 RecipeAgents

RecipeAgents / Guides

Agent recipe guide

n8n RAG chatbot: answer from your own docs

An n8n RAG chatbot is two workflows, not one. The first loads your documents into a vector store: Default Data Loader, a text splitter, an embeddings model and a Vector Store node in Insert Documents mode. The second answers questions: Chat Trigger, AI Agent, a chat model, and the same vector store attached as a tool with the same embeddings model. That's the pattern in n8n's own RAG docs, read Nov 2, 2026, and every top tutorial repeats it.

What they mostly skip is what goes wrong after the demo: the Simple Vector Store forgetting everything, re-runs filling the store with copies, and a similarity cut-off that throws away good answers. Below we cover those, checked against the current n8n docs, plus what the 503 public n8n templates with a vector store actually use. We don't have a RAG download in our recipe library yet, so this page is the build guide, not a file.

Step by step

  1. Pick a real vector store before you start: Supabase, Pinecone, Qdrant or Postgres PGVector. Use the Simple Vector Store only to try the idea (see the caveats below).
  2. Ingestion workflow: a trigger (a form upload or a Google Drive trigger), then the Vector Store node in Insert Documents mode, with a Default Data Loader, a Recursive Character Text Splitter and an embeddings model attached underneath it.
  3. Decide how a changed document gets replaced before you load anything: clear and reload (Pinecone's Clear Namespace, the Simple Vector Store's Clear Store) or update by ID (the Supabase node's Update Documents mode).
  4. Chat workflow: Chat Trigger, then an AI Agent with a chat model, Simple Memory for the conversation, and the same Vector Store node in Retrieve Documents (As Tool for AI Agent) mode.
  5. Attach the same embeddings model to both workflows. Give the tool a name and a description that says what's in the store and when to search it.
  6. Tell the agent in its system message to answer only from what the tool returns and to say so when it finds nothing. Then test it with ten real questions, including two the documents can't answer.
SPONSOR SLOT · AVAILABLEFeature your product here

What 503 public RAG templates use

In our study of 13,574 public n8n templates (snapshot 2026-10-20), 503 templates contain a vector store node. That's 6.7% of the 7,487 templates with an AI step. Most are recent: 480 of the 503 were created in 2025 or later.

PieceMost usedTemplates (of 503)
Vector storePinecone167 (33.2%)
Supabase121 (24.1%)
Qdrant104 (20.7%)
Simple (in-memory)59 (11.7%)
Postgres PGVector25 (5.0%)
EmbeddingsOpenAI348 (69.2%)
Google Gemini86 (17.1%)
Ollama (local)29 (5.8%)
Answers throughAI Agent node411 (81.7%)
Q&A chain or Vector Store Retriever32 (6.4%)
Chat entryn8n Chat Trigger179 (35.6%)
Telegram or WhatsApp trigger77 (15.3%)

Three numbers matter more than the brands. 260 of the 503 (51.7%) add chat memory, so about half the bots forget the previous question. 37 (7.4%) use a reranker, which re-sorts the chunks the store returns before the model sees them. And 10 (2.0%) have an Error Trigger, so if your ingestion run fails on a broken PDF, almost no template will tell you. A template can hold several stores or models, so the shares overlap; these are totals only.

Caveat 1: the Simple Vector Store is for testing

n8n's Simple Vector Store docs (read Nov 2, 2026) say to use it for development only, and give three reasons. The data lives in memory and is lost when n8n restarts. Its memory keys are global, so any user on the same instance can read the store by picking the key, whatever the workflow's access settings. And on n8n Cloud it's capped at 100 MB (about 8,000 documents, per the docs) and a store unused for 7 days is removed. Self-hosted, both limits are off by default and set with N8N_VECTOR_STORE_MAX_MEMORY and N8N_VECTOR_STORE_TTL_HOURS.

In practice: a demo bot on Cloud that nobody asks for a week comes back empty, and answers from the model's own knowledge without telling you. 59 of the 503 public templates use it, so check before you import one.

Caveat 2: re-running ingestion

Insert Documents adds chunks; the docs describe no duplicate check. If you re-run the ingestion workflow after editing a document, the old chunks stay next to the new ones and the bot can quote last month's policy. Pick one approach up front. Pinecone's Insert Documents mode has Clear Namespace, which deletes everything in the namespace before inserting, so use one namespace per source and reload it whole. The Supabase Vector Store node has an Update Documents mode that updates an item by its ID. For a small handbook, clearing and reloading the whole thing on a schedule is the simplest version that stays correct.

Caveat 3: don't copy a similarity cut-off between embedding models

A builder on the n8n forum, in Built a RAG system in n8n + Supabase (June 2026), set a relevance cut-off of 0.72 and found the bot refusing good answers: with Gemini embeddings, relevant chunks scored about 0.51 to 0.65. A reply in the same thread says Gemini's scores run lower than OpenAI's and recommends calibrating around 0.5 to 0.6.

So don't take a threshold from a tutorial built on another embeddings model. Before you add one, run the vector store node in Get Many mode with a few real questions; per the Supabase node docs it returns the matching documents with their similarity score. Write down where the right chunks land and set your cut-off just under that. If you switch embeddings model, re-embed everything and measure again: the n8n docs say to use the same model for inserting and querying.

Agent tool or Q&A chain?

With the store attached as a tool, the agent decides whether to search at all. If the tool description is vague, it can answer from the model instead of your documents. A Question and Answer Chain with a Vector Store Retriever always retrieves first, which suits a bot that must answer only from your docs and needs no other tools. In the public templates the agent version is far more common (411 vs 32). n8n's RAG docs also suggest putting the Vector Store Question Answer Tool between the agent and the store to save tokens on an expensive main model.

For a support bot built on this, see AI customer support agent for small business (Guardrails and human review for tool calls) and the draft support replies from your docs recipe. For a chat bot with memory you can download, see the Telegram AI agent with memory. Every chat message is one execution on n8n Cloud; see n8n pricing.

Before you use it

Every recipe on RecipeAgents follows the same shape: a trigger, the tools, the steps, and the exact prompt. Start with the human-approval version. Once you have watched a few dozen runs and trust the output, decide which steps can run on their own. Model and tool names change often, so check current pricing and features in each tool before you build.

Frequently asked questions

Can n8n do RAG?
Yes. n8n has vector store nodes (Simple, Supabase, Pinecone, Qdrant, PGVector, MongoDB Atlas and others), embeddings nodes, a Default Data Loader with text splitters, and retrieval through an AI Agent tool or a Question and Answer Chain.
Which vector store should I use with n8n?
For anything you keep, a persistent store. In the 503 public templates with a vector store, Pinecone appears in 167, Supabase in 121 and Qdrant in 104. Supabase or PGVector suit you if you already run Postgres. The Simple Vector Store is for testing only.
Why does my n8n RAG bot ignore my documents?
Usually one of three things: the tool description doesn't tell the agent when to search, the chat workflow uses a different embeddings model from the one used at insert, or a Simple Vector Store was emptied by a restart or, on Cloud, after 7 days unused.
Do I need memory for a RAG chatbot?
Only for follow-up questions. The vector store holds your documents; memory holds the conversation. About half the public RAG templates (260 of 503) add both.

From our sister sites

More guides

Back to all of RecipeAgents

Newsletter

One small automation every Friday

Each Friday email has one recipe, the prompt for it, and the way it broke when we wrote it up. It's free, and every email has an unsubscribe link.