Build and Update RAG System with Google Drive, Qdrant, and Gemini Chat
This workflow automates the creation and management of a Retrieval-Augmented Generation (RAG) system using Qdrant as a vector store and Google Drive as the document source. It enables full or incremental updates to documents in the Qdrant vector database and integrates with a chatbot using Google Gemini for question answering.
Here is a clear and professional description in English of the n8n workflow “Create a RAG with Qdrant and update single files”, including its benefits:
Benefits
Efficient RAG Setup** Seamlessly integrates OpenAI, Qdrant, and Google Drive to create a scalable RAG pipeline.
Single File Update** You can replace the vector representation of a single file without reprocessing the entire collection—ideal for maintaining document freshness.
Flexible File Source**
Works with Google Drive, allowing document management and updates from a familiar interface.
How It Works
This workflow is designed to create a Retrieval-Augmented Generation (RAG) system using Qdrant as a vector store and Google Drive as a document source. It consists of four main phases:
Collection Setup**:
Creates or clears a Qdrant collection to store vectorized documents.
Configures the collection with cosine distance metrics and other parameters.
Document Processing**:
Retrieves files from a specified Google Drive folder.
Downloads and processes each file (text extraction, chunking, and embedding using OpenAI).
Stores the embeddings in Qdrant for vector search.
Single-File Update**:
Allows updating or deleting a specific file in the Qdrant collection by referencing its Google Drive ID.
Re-embeds the file and updates the vector store.
RAG Querying**:
Uses a chat trigger to receive user questions.
Retrieves relevant documents from Qdrant using vector similarity.
Generates answers using Google Gemini as the language model.
Set Up Steps
Configure Qdrant:
Replace QDRANTURL and COLLECTION in the "Create collection" and "Clear collection" HTTP nodes.
Ensure Qdrant API credentials are correctly set in the credentials section.
Google Drive Integration:
Specify the Google Drive folder ID in the "Get files" node.
Ensure Google Drive OAuth credentials are configured.
OpenAI and Gemini Keys:
Add OpenAI API credentials for embeddings (used in "Embeddings OpenAI" nodes).
Configure Google Gemini credentials for the chat model.
Single-File Update:
Set the file_id in the "Edit Fields3" node to target a specific Google Drive file for updates.
Testing:
Trigger the workflow manually to populate the Qdrant collection.
Use the chat interface to test RAG responses.
Need help customizing?
Contact me for consulting and support or add me on Linkedin.
Tags
Related Templates
Use OpenRouter in n8n versions <1.78
What it is: In version 1.78, n8n introduced a dedicated node to use the OpenRouter service, which lets you to use a lot...
Task Deadline Reminders with Google Sheets, ChatGPT, and Gmail
Intro This template is for project managers, team leads, or anyone who wants to automatically remind teammates of tasks ...
🤖 Build Resilient AI Workflows with Automatic GPT and Gemini Failover Chain
This workflow contains community nodes that are only compatible with the self-hosted version of n8n. How it works This...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments