πŸ“– Document RAG & chat agent: Google Drive to Qdrant with Mistral OCR

⚑ 1,665 views Β· πŸ“– Internal Wiki & Knowledge Base

πŸ’‘ Pro Tip β€” HTTP Request scraping tends to break when sites update their markup. If you’re scraping a major platform, check if ScraperNode covers it β€” it has maintained scrapers for LinkedIn, Instagram, TikTok, YouTube, and 20+ other platforms that return structured data.

View All Scrapers

Description

Knowledge RAG & AI Chat Agent: Google Drive to Qdrant

Description

This workflow transforms a Google Drive folder into an intelligent, searchable knowledge base and provides a chat agent to query it.
It’s composed of two distinct flows:

This system fully automates the creation of a β€œChat with your docs” solution and enhances it with external web-searching capabilities.


Quick Implementation Steps

  1. Import the workflow JSON into your n8n instance.
  2. Set up credentials for Google Drive, Mistral AI, OpenAI, and Qdrant.
  3. Open the Web Search node and add your Tavily AI API key to the Authorization header.
  4. In the Google Drive (List Files) node, set the Folder ID you want to ingest.
  5. Run the workflow manually once to populate your Qdrant database (Flow 1).
  6. Activate the workflow to enable the chat trigger (Flow 2).
  7. Copy the public webhook URL from the When chat message received node and open it in a new tab to start chatting.

What It Does

The workflow is divided into two primary functions:

1. Knowledge Base Ingestion (Manual Trigger)

This flow populates your vector database.

2. AI Chat Agent (Chat Trigger)

This flow powers the conversational interface.


Who’s It For

Ideal for:


Requirements


How It Works

The workflow runs two independent flows in parallel:

Flow 1: Ingestion Pipeline (Manual Trigger)

  1. List Files: Fetch files from Google Drive using the Folder ID.
  2. Loop & Download: Each file is processed one by one.
  3. OCR Processing:
    • Upload file to Mistral
    • Retrieve signed URL
    • Extract text using Mistral DOC OCR
  4. Metadata Extraction: Analyze text using a Mistral LLM.
  5. Text Cleaning & Chunking: Split into 1000-character chunks.
  6. Embeddings Creation: Use OpenAI embeddings.
  7. Vector Insertion: Push chunks + metadata into Qdrant.

Flow 2: AI Chat Agent (Chat Trigger)

  1. Chat Trigger: Starts when a chat message is received.
  2. AI Agent: Uses OpenAI + Simple Memory to process context.
  3. RAG Retrieval: Queries Qdrant for related data.
  4. Decision Logic:
    • Found β†’ Form answer.
    • Not found β†’ Ask if user wants web search.
  5. Web Search: Performs Tavily web lookup.
  6. Final Response: Synthesizes internal + external info.

How To Set Up

1. Import the Workflow

Upload the provided JSON into your n8n instance.

2. Configure Credentials

Create and assign:

3. Add Tavily API Key

4. Node Configuration

5. Run Ingestion (Flow 1)

Click Test workflow to populate Qdrant with your Drive documents.

6. Activate Chat (Flow 2)

Toggle the workflow ON to enable real-time chat.

7. Test

Open the webhook URL and start chatting!


How To Customize


Use Case Examples


Troubleshooting Guide

IssuePossible Solution
Chat agent doesn’t respondCheck OpenAI API key and model availability (e.g., gpt-4.1-mini).
Known documents not foundEnsure ingestion flow ran and both Qdrant nodes use same collection name.
OCR node failsVerify Mistral API key and input file integrity.
Web search not triggeredRe-check Tavily API key in Web Search node headers.
Incorrect metadataTune Information Extractor prompt or use a stronger Mistral model.

Need Help or More Workflows?

Want to customize this workflow for your business or integrate it with your existing tools?
Our team at Digital Biz Tech can tailor it precisely to your use case from automation logic to AI-powered enhancements.

We can help you set it up for free β€” from connecting credentials to deploying it live.

Contact: rajeet.nair@digitalbiz.tech
Website: https://www.digitalbiz.tech
LinkedIn: https://www.linkedin.com/company/digital-biz-tech/
You can also DM us on LinkedIn for any help.


πŸ”— Nodes Used

HTTP Request, Google Drive, AI Agent, Embeddings OpenAI, OpenAI Chat Model, Simple Memory

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup