Build a RAG system with automatic citations using Qdrant, Gemini & OpenAI
Ready for 3.0What this workflow does
This AI workflow has 24 nodes and runs manually, when you click “Execute workflow” (plus 1 other trigger). Along the way it connects Embeddings OpenAI, Qdrant Vector Store, Google Gemini Chat Model and Google Drive. It also calls qdranturl over HTTP.
How it runs
Trigger: Manually, when you click “Execute workflow” (plus 1 other trigger).
- Clear collection (HTTP Request): calls an HTTP API (POST)
- chatInput (Edit Fields (Set)): sets 1 field: chatInput
- Get folder (Google Drive): work with file folder
- Question and Answer Chain: answers questions over your documents (RAG), with model: Google Gemini Chat Model; retriever: Vector Store Retriever
- Retrive sources (Qdrant Vector Store): searches the Qdrant vector store, with embeddings: Embeddings OpenAI
- Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
- Merge: merges the data from its input branches
- Aggregate: combines items into one
- Get file (Google Drive): download
- Response (Code): runs custom JavaScript code
…plus 4 more steps. See the full node list below.
Services it uses
HTTP calls to: qdranturl
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (17)
- Manual Trigger
n8n-nodes-base.manualTrigger - Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Qdrant Vector Store
@n8n/n8n-nodes-langchain.vectorStoreQdrant - HTTP Request
n8n-nodes-base.httpRequest - Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Wait
n8n-nodes-base.wait - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - Question and Answer Chain
@n8n/n8n-nodes-langchain.chainRetrievalQa - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Vector Store Retriever
@n8n/n8n-nodes-langchain.retrieverVectorStore - Merge
n8n-nodes-base.merge - Aggregate
n8n-nodes-base.aggregate - Google Drive
n8n-nodes-base.googleDrive - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code
From the author
This workflow implements a Retrieval-Augmented Generation (RAG) system that: Stores vectorized documents in Qdrant, Retrieves relevant content based on user input, Generates AI answers using Google Gemini, Automatically cites the document sources (from Google…