Building RAG Pipelines with n8n: No-Code Knowledge Base Q&A
You want document Q&A without writing a retrieval stack. n8n plus Qdrant gets you there with drag-and-drop nodes: ingestion workflow, query workflow, the parameters that matter, and the failures you will actually hit.
📜 Table of Contents
📖 Keep reading
Building RAG Pipelines with n8n: No-Code Knowledge Base Q&A
n8n is the middle path for document Q&A: open source, self-hostable, 200-plus nodes, and a LangChain node pack that turns loading, splitting, embedding, retrieval and generation into wired nodes. Two workflows, one vector database.
Architecture: two workflows
| Stage | Node | Job |
|---|---|---|
| Load | Read/Write Files from Disk, HTTP Request | Read PDFs/Markdown or fetch pages |
| Split | Recursive Character Text Splitter | Cut documents into retrievable chunks |
| Embed | Embeddings OpenAI or Ollama | Text to vectors |
| Store | Qdrant Vector Store (Insert) | Write to the vector DB |
| Retrieve | Qdrant Vector Store (Retrieve) | Find similar chunks |
| Generate | Question and Answer Chain | Compose the answer |
Ingestion runs when documents change; query runs per question. Keeping them separate means a document refresh never touches the live path.
Stand it up
One compose file: n8nio/n8n on port 5678 with a persistent volume at /home/node/.n8n, plus qdrant/qdrant on 6333 with its storage volume. Set N8N_ENCRYPTION_KEY to a long random string — change it later and every stored credential becomes unreadable.
Ingestion parameters that matter
| Parameter | Starting point | Note |
|---|---|---|
| Chunk Size | 800 chars (Chinese) | 1000 for technical docs, 500 for Q&A-style |
| Overlap | 100-150 | About 15% of chunk size |
| Separators | blank line, newline, and Chinese sentence marks | Without Chinese punctuation, chunks become whole pages |
The separators row is the one that quietly breaks Chinese corpora: defaults assume English spacing, so Chinese text splits into oversized blocks and retrieval precision collapses. Add per-chunk metadata (filename, page) so answers can cite sources, and version the collection name (kb_v1, kb_v2) so a splitting change is reversible.
Query side
Chat Trigger or Webhook → Qdrant retrieve → Question and Answer Chain. Top K of 4-6; more pulls noise into context and raises cost. Set a similarity threshold around 0.5 and tune from your own data.
Put one constraint in the prompt: answer only from the retrieved context, and say the document does not cover it otherwise. Without that line the model fills gaps from training data — fluent answers unrelated to your corpus, the most common RAG failure.
How to know it works
Build 15-20 questions whose answers you can locate in specific passages. Measure retrieval hit rate first (target above 70%; if lower, fix chunking or embeddings before touching generation) and answer faithfulness second (every claim traceable to a retrieved chunk). Judging them separately stops the reflex of buying a bigger model when the real fault is retrieval.
Failures you will hit
Scanned PDFs have no text layer and need OCR first. Repeated headers and footers pollute every chunk with high-frequency noise. Bulk embedding of tens of thousands of chunks hits rate limits — batch in a few hundred with retries. And swapping embedding models without re-indexing leaves two incompatible vector spaces in one collection.
FAQ
Q: Any code? About 80% of setups need none; a Code node handles odd cleaning.
Q: Is n8n free? The community edition self-hosts at no cost; cloud and enterprise tiers are priced separately per n8n's site.
Q: Local models? Yes, via the Ollama node; speed depends on your GPU.
Note: node names and parameters vary by n8n version — check the official docs.
Written by our editorial team; tools listed here are tested or verified against public sources. Links point to official sites or GitHub repos for reference only — no paid placements.