Build a RAG knowledge assistant with Google Drive, OpenAI, and Pinecone
Ready for 3.0What this workflow does
This AI workflow has 20 nodes and runs on Google Drive events (file updated) (plus 1 other trigger). Along the way it connects Google Drive, Embeddings OpenAI, Pinecone Vector Store and OpenAI Chat Model and 1 more.
How it runs
Trigger: On Google Drive events (file updated) (plus 1 other trigger).
- Extract File Metadata (Edit Fields (Set)): sets 7 fields: fileId, fileName, mimeType…
- Validate & Normalize Query (Code): runs custom JavaScript code
- Validate File (If): checks a condition and branches into true / false
- Query Valid? (If): checks a condition and branches into true / false
- Download File from Drive (Google Drive): download
- AI Agent: runs an AI agent, with model: Primary LLM (Agent Brain); 1 tool (Vector Search QA Tool); memory: Conversation Memory Buffer
- Respond to Webhook: sends the response back to the webhook caller
- Ingest into Pinecone Vector DB (Pinecone Vector Store): stores documents in the Pinecone vector store, with embeddings: Generate Embeddings (Ingest); document loader: Parse Document Content
- Format RAG Response (Edit Fields (Set)): sets 5 fields: success, question, answer…
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (15)
- AI Agent
@n8n/n8n-nodes-langchain.agent - Respond to Webhook
n8n-nodes-base.respondToWebhook - Google Drive Trigger
n8n-nodes-base.googleDriveTrigger - Edit Fields (Set)
n8n-nodes-base.set - Google Drive
n8n-nodes-base.googleDrive - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi - Pinecone Vector Store
@n8n/n8n-nodes-langchain.vectorStorePinecone - Webhook
n8n-nodes-base.webhook - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - Vector Store Question Answer Tool
@n8n/n8n-nodes-langchain.toolVectorStore - If
n8n-nodes-base.if - Code
n8n-nodes-base.code
From the author
Quick Overview This workflow syncs documents from a Google Drive folder into a Pinecone vector index using OpenAI embeddings, then exposes a webhook chat endpoint where an OpenAI-powered agent answers questions by retrieving relevant context from Pinecone.…