AI Agents

Create an intelligent RAG agent to answer questions from Google Drive documents using OpenAI

23 nodes 290 147 Automatic trigger
Download

Workflow Description

An automation that retrieves documents from Google Drive, chunks them into manageable pieces, stores their embeddings in a vector database, then deploys an intelligent agent powered by OpenAI to answer user questions based solely on the document content.

How it works

  1. 1.Receive user query through a webhook endpoint
  2. 2.Fetch and load documents from Google Drive, then split them into chunks
  3. 3.Convert text chunks into embeddings and store them in Qdrant vector store
  4. 4.Initialize an AI agent that searches vector store and queries OpenAI language model
  5. 5.Maintain conversation history in memory buffer for contextual responses
  6. 6.Return the intelligent answer to the user via HTTP response

Use cases

  • Self-service customer support answering from company documentation
  • Intelligent legal document search system across contracts and regulations
  • Research assistant analyzing scientific papers and comprehensive reports
  • Internal knowledge base for employee questions on company policies and procedures

Requirements

  • Active OpenAI API account with valid authentication key
  • Running Qdrant vector database server or cloud-hosted instance
  • Read access to Google Drive folder containing documents to be indexed
  • HTTP webhook endpoint to receive and process user queries

Service Value

Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.

Apps Used

AI Agent Vector Store OpenAI Google Drive Document Default Data Loader Text Splitter Memory

Details

Trigger Automatic trigger
Nodes 23
Apps 7
Views 290
Downloads 147

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (23)

/

AI Agent

Agent

#1

Vector Store Tool

Tool Vector Store

#2

Qdrant Vector Store

Vector Store Qdrant

#3

Embeddings OpenAI

OpenAI

#4

Sticky Note4

Sticky Note

#5

Sticky Note

Sticky Note

#6

When clicking ‘Test workflow’

Manual Trigger

#7

Create collection

HTTP Request

#8

Refresh collection

HTTP Request

#9

Get folder

Google Drive

#10

Download Files

Google Drive

#11

Default Data Loader

Document Default Data Loader

#12

Token Splitter

Text Splitter Token Splitter

#13

Sticky Note3

Sticky Note

#14

Qdrant Vector Store1

Vector Store Qdrant

#15

Embeddings OpenAI1

OpenAI

#16

Sticky Note5

Sticky Note

#17

Respond to ElevenLabs

Webhook

#18

OpenAI

OpenAI

#19

Listen

Webhook

#20

Window Buffer Memory

Memory Buffer Window

#21

OpenAI Chat Model

OpenAI

#22

Sticky Note6

Sticky Note

#23