Build an AI Agent to Answer Document Questions with OpenAI
Workflow Description
An automation that combines Retrieval-Augmented Generation (RAG) with OpenAI services to create an intelligent agent capable of searching Google Drive documents and answering questions accurately without hallucination or information drift.
How it works
- 1.Receive a query through webhook that triggers the intelligent agent
- 2.Retrieve relevant documents from the vector store (Qdrant) using OpenAI embeddings
- 3.Process retrieved context and maintain conversation history in memory before sending the response
Use cases
- Build an intelligent assistant that answers employee questions based on stored company policies
- Develop an automated customer support system that extracts answers from an integrated knowledge base
- Create a smart search engine that understands context and delivers precise results for complex queries
Requirements
- OpenAI account with API key and sufficient usage quota
- Qdrant vector store set up and pre-populated with indexed documents
- Proper connection to Google Drive to fetch and update documents
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