🔍 Build a self-updating RAG system with OpenAI, Google Gemini, Qdrant and Google Drive

⚡ 1,404 views · 🔍 AI RAG & Knowledge Retrieval

Description

This workflow implements a Retrieval-Augmented Generation (RAG) system that integrates Google Drive and Qdrant.

This setup creates a powerful, self-updating knowledge base that provides accurate, context-aware answers to user queries.


Key Advantages


How It Works

This workflow implements a Retrieval-Augmented Generation (RAG) system that automatically processes, stores, and retrieves document information for AI-powered question answering. Here’s how it functions:

  1. Document Processing & Vectorization:

    • The system monitors a specified Google Drive folder for new or updated files.
    • When a file is added or modified, it is downloaded and split into manageable chunks using a Recursive Character Text Splitter.
    • Each chunk is converted into vector embeddings using OpenAI’s embedding model.
    • These vectors, along with metadata (file ID, file name), are stored in a Qdrant vector database.
  2. Automatic Updates:

    • The workflow includes a mechanism to delete old vectors associated with an updated file before inserting the new ones, ensuring the knowledge base remains current.
  3. Query Handling & Response Generation:

    • When a user sends a chat message (via a chat trigger), the system:
      • Retrieves the most relevant document chunks from Qdrant based on the query’s semantic similarity.
      • Uses a Google Gemini language model to generate a context-aware answer grounded in the retrieved documents.
    • This provides accurate, source-based responses instead of relying solely on the AI’s internal knowledge.
  4. Initial Setup & Maintenance:

    • The workflow can be triggered manually to create the Qdrant collection or clear all existing data.
    • It processes all existing files in the Drive folder during initial setup, populating the vector store.

Set Up Steps

To configure this workflow, follow these steps:

STEP 1: Create Qdrant Collection

STEP 2: Configure Google Drive Access

STEP 3: Set Up AI Models

STEP 4: Configure Metadata

STEP 5: Test the RAG System


Need help customizing?

Contact me for consulting and support or add me on Linkedin.

đź”— Nodes Used

HTTP Request, Google Drive, Google Drive Trigger, Question and Answer Chain, Embeddings OpenAI, Vector Store Retriever

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup