Skip to main content

Document RAG & chat agent: Google Drive to Qdrant with Mistral OCR

Workflow preview

Workflow preview
100%
Document RAG & chat agent: Google Drive to Qdrant with Mistral OCR preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

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...

Best for

  • Internal Wiki automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.embeddingsopenai, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.toolhttprequest, @n8n/n8n-nodes-langchain.memorybufferwindow, @n8n/n8n-nodes-langchain.vectorstoreqdrant, @n8n/n8n-nodes-langchain.chattrigger, @n8n/n8n-nodes-langchain.documentdefaultdataloader, @n8n/n8n-nodes-langchain.textsplittercharactertextsplitter

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by DIGITAL BIZ TECH.

Original n8n.io source

1.1 Workflow description

Title
Document RAG & chat agent: Google Drive to Qdrant with Mistral OCR
Workflow name
Document RAG & chat agent: Google Drive to Qdrant with Mistral OCR

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:

  • An ingestion pipeline to process documents.
  • A live chat agent that uses RAG (Retrieval-Augmented Generation) and optional web search to answer user questions.

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.

  • Scans Google Drive: Lists all files from a specified folder.
  • Processes Files Individually: Downloads each file.
  • Extracts Text via OCR: Uses Mistral AI OCR API for text extraction from PDFs, images, etc.
  • Generates Smart Metadata: A Mistral LLM assigns metadata like document_type, project, and assigned_to.
  • Chunks & Embeds: Text is cleaned, chunked, and embedded via OpenAI’s text-embedding-3-small model.
  • Stores in Qdrant: Text chunks, embeddings, and metadata are stored in a Qdrant collection (docaiauto).

2. AI Chat Agent (Chat Trigger)

This flow powers the conversational interface.

  • Handles User Queries: Triggered when a user sends a chat message.
  • Internal RAG Retrieval: Searches Qdrant Vector Store first for answers.
  • Web Search Fallback: If unavailable internally, the agent offers to perform a Tavily AI web search.
  • Contextual Responses: Combines internal and external info for comprehensive answers.

Who's It For

Ideal for:

  • Teams building internal AI knowledge bases from Google Drive.
  • Developers creating AI-powered support, research, or onboarding bots.
  • Organizations implementing RAG pipelines.
  • Anyone making unstructured Google Drive documents searchable via chat.

Requirements

  • n8n instance (self-hosted or cloud).
  • Google Drive Credentials (to list and download files).
  • Mistral AI API Key (for OCR & metadata extraction).
  • OpenAI API Key (for embeddings and chat LLM).
  • Qdrant instance (cloud or self-hosted).
  • Tavily AI API Key (for web search).

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:

  • Google Drive → Google Drive nodes
  • Mistral AI → Upload, Signed URL, DOC OCR, Cloud Chat Model
  • OpenAI → Embeddings + Chat Model nodes
  • Qdrant → Vector Store nodes

3. Add Tavily API Key

  • Open Web Search node → Parameters → Headers
  • Add your key under Authorization (e.g., tvly-xxxx).

4. Node Configuration

  • Google Drive (List Files): Set Folder ID.
  • Qdrant Nodes: Ensure same collection name (docaiauto).

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

  • Change LLMs: Swap models in OpenAI or Mistral nodes (e.g., GPT-4o, Claude 3).
  • Modify Prompts: Edit the system message in ai chat agent to alter tone or logic.
  • Chunking Strategy: Adjust chunkSize and chunkOverlap in the Code node.
  • Different Sources: Replace Google Drive with AWS S3, Local Folder, etc.
  • Automate Updates: Add a Cron node for scheduled ingestion.
  • Validation: Add post-processing steps after metadata extraction.
  • Expand Tools: Add more functional nodes like Google Calendar or Calculator.

Use Case Examples

  • Internal HR Bot: Answer HR-related queries from stored policy docs.
  • Tech Support Assistant: Retrieve troubleshooting steps for products.
  • Research Assistant: Summarize and compare market reports.
  • Project Management Bot: Query document ownership or project status.

Troubleshooting Guide

Issue Possible Solution
Chat agent doesn’t respond Check OpenAI API key and model availability (e.g., gpt-4.1-mini).
Known documents not found Ensure ingestion flow ran and both Qdrant nodes use same collection name.
OCR node fails Verify Mistral API key and input file integrity.
Web search not triggered Re-check Tavily API key in Web Search node headers.
Incorrect metadata Tune 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: [email protected]
Website: https://www.digitalbiz.tech
LinkedIn: https://www.linkedin.com/company/digital-biz-tech/
You can also DM us on LinkedIn for any help.


1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Embeddings OpenAI1

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 2 - OpenAI Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 3 - Web Search

Type / Role
@n8n/n8n-nodes-langchain.toolHttpRequest - toolHttpRequest
Config choices
Version 1.1

Block 4 - Simple Memory1

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 5 - Qdrant Vector Store

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreQdrant - vectorStoreQdrant
Config choices
Version 1.1

Block 6 - When chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.1

Block 7 - Default Data Loader

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1

Block 8 - Character Text Splitter

Type / Role
@n8n/n8n-nodes-langchain.textSplitterCharacterTextSplitter - textSplitterCharacterTextSplitter
Config choices
Version 1

Block 9 - Google Drive

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 10 - Google Drive1

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 11 - Mistral Upload

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 12 - Mistral Signed URL

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 13 - Mistral DOC OCR

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 14 - When clicking ‘Test workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 15 - Embeddings OpenAI

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1

Block 16 - Qdrant Vector Store1

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreQdrant - vectorStoreQdrant
Config choices
Version 1.1

Block 17 - Mistral Cloud Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatMistralCloud - lmChatMistralCloud
Config choices
Version 1

Block 18 - ai chat agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.7

Block 19 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Showing the first 24 of 39 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Document RAG & chat agent: Google Drive to Qdrant with Mistral OCR
Complexity advanced
Nodes 39
Categories Internal Wiki, AI RAG
Author DIGITAL BIZ TECH
Published 24 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/10096/10096.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Document RAG & chat agent: Google Drive to Qdrant with Mistral OCR do?

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...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Internal Wiki, AI RAG use case.