Create an intelligent RAG agent to answer questions from Google Drive documents using OpenAI
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.Receive user query through a webhook endpoint
- 2.Fetch and load documents from Google Drive, then split them into chunks
- 3.Convert text chunks into embeddings and store them in Qdrant vector store
- 4.Initialize an AI agent that searches vector store and queries OpenAI language model
- 5.Maintain conversation history in memory buffer for contextual responses
- 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
Details
How to Use
- 1.Click "Download Template"
- 2.Open your n8n dashboard
- 3.Go to Workflows > Import from File
- 4.Select downloaded file and configure credentials
Nodes Used (23)
AI Agent
Agent
Vector Store Tool
Tool Vector Store
Qdrant Vector Store
Vector Store Qdrant
Embeddings OpenAI
OpenAI
Sticky Note4
Sticky Note
Sticky Note
Sticky Note
When clicking ‘Test workflow’
Manual Trigger
Create collection
HTTP Request
Refresh collection
HTTP Request
Get folder
Google Drive
Download Files
Google Drive
Default Data Loader
Document Default Data Loader
Token Splitter
Text Splitter Token Splitter
Sticky Note3
Sticky Note
Qdrant Vector Store1
Vector Store Qdrant
Embeddings OpenAI1
OpenAI
Sticky Note5
Sticky Note
Respond to ElevenLabs
Webhook
OpenAI
OpenAI
Listen
Webhook
Window Buffer Memory
Memory Buffer Window
OpenAI Chat Model
OpenAI
Sticky Note6
Sticky Note