Build a RAG Document Assistant with n8n, Qdrant & OpenAI
Upload files to Google Drive → auto-chunk, embed, and store → chat with source-cited answers
- Who
- Users who want to build a document Q&A system in n8n and already have Google Drive and API accounts
- You get
- After uploading files to a designated Google Drive folder, ask questions via a chat interface and receive answers grounded in document content with citations
- You need
- n8n · Qdrant
Constraints
Prerequisites: n8n instance, Google Cloud Console project (Drive API enabled with OAuth), Qdrant cluster (with API key), OpenAI API key. Supports Google Docs format; files are auto-converted to Markdown then chunked. Costs: OpenAI embedding and GPT-4o calls billed by token; Qdrant billed by cluster tier. Verify current pricing on each platform.
What they did
Author yulia published a complete single-vector RAG system template in the n8n official template library. The template uses a Google Drive trigger to detect new files, automatically downloads them as Markdown, recursively chunks the text, generates embeddings with OpenAI, and stores them in Qdrant. A Chat Trigger-driven RAG Agent using GPT-4o answers user questions, with a strict systemMessage that mandates document search first, source citation, and brief direct quotes for factual claims.
How it went
The author reports the template automatically processes documents, supports natural-language chat, and provides accurate, source-cited responses (author_report). Three sample files are provided for testing: German Data Protection law (BDSG), NIST Computer Security Incident Handling Guide, and Berkshire Hathaway 2024 shareholder letter.
Worth knowing
1. Google Docs format only; other formats may not convert correctly. 2. If the webhook does not detect copied files, try using the Move to feature from the opened shared files. 3. The Qdrant collection is created automatically after the first webhook trigger, but Qdrant API credentials must be configured beforehand. 4. The systemMessage strictly requires the AI to search documents even if the question seems answerable from general knowledge; it must state clearly if information is not found. 5. Memory node contextWindowLength=20 maintains recent conversation context. 6. Embedding batch size is 50. 7. This site has not tested the workflow; actual runs may require debugging for credentials, network, or quota issues.
Steps
Import the template
Copy or import template ID 11468 into your n8n instance. After import you will see two branches: the data loading pipeline (left) and the RAG AI Agent (right).
Configure Google Drive credentials
Create OAuth credentials in the Google Cloud Console and enable the Google Drive API. Add the credentials to the trigger node "Detect New Files". Detailed walk-through available in n8n docs.
Configure Qdrant credentials
Sign up for Qdrant, create a Cluster, and obtain the API key. Add the qdrantApi credentials to the "Insert into Vector Store" node. You can name your collection in this node (e.g., n8n-rag-tutorial).
Configure OpenAI credentials
Create or activate an API key on the OpenAI platform. Add it to both the "Generate Embeddings" node and the "Generate Response" node (GPT-4o chat model).
Prepare and upload files
Create a new folder in your Google Drive. Open the author's shared example folder and copy/move the example files (or your own Google Docs files) into your new folder. Note: the template supports Google Docs format; files are downloaded as HTML and converted to Markdown.
Safety tip: human confirmation before action
Safety tip (editorial safety note, not the template author's practice): before the workflow actually inserts file content into the Qdrant vector store, have a human confirm the target collection and files.
Activate the workflow and verify data ingestion
Activate the workflow. When new files appear in the watched folder, the webhook fires: download as Markdown → merge metadata → recursive split (chunkSize=1500, chunkOverlap=300) → OpenAI embeddings → store in Qdrant. Check the Executions tab for run logs.
Configure retrieval and chat
In the RAG Agent branch, confirm the "Search Documents" sub-node selects the correct Qdrant collection (default n8n-rag-tutorial). This node is exposed as a tool to the AI Agent with topK=10.
Start chatting and test
Open the chat interface and ask the RAG Agent questions. The agent retrieves relevant chunks from the vector store first, then GPT-4o (temperature=0.4) generates a cited response. Example questions to try:
Execution prompt · Source text。Chat interface user input; based on NIST.SP.800-61r2 sample file
What are the main steps in incident handling?
Execution prompt · Source text。Chat interface user input; based on Berkshire Hathaway 2024 letter sample file
What does Warren Buffett say about mistakes at Berkshire?
Execution prompt · Source text。Chat interface user input; based on BDSG sample file
What are the requirements for processing personal data?
Execution prompt · Source text。Chat interface user input; cross-document retrieval test
Do any documents mention data breach notification?
Prompt you can copy
Execution prompt · Source text。Send it in the n8n chat window (Chat Trigger)
This block is the prompt. Ads are never placed here.
What are the main steps in incident handling?
This is an n8n visual workflow with no single copyable main prompt. The core instruction is the AI Agent systemMessage, captured as a step prompt.
Source
Build a RAG agent with n8n, Qdrant & OpenAI · yulia · n8n.io · 2025-12-03T17:34:21.276Z
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.