Build a dual-stage RAG chat assistant with Google Drive, Ollama, Pinecone and Gemini
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
Nodes used (16)
- Manual Trigger
n8n-nodes-base.manualTrigger - Google Drive Trigger
n8n-nodes-base.googleDriveTrigger - Google Drive
n8n-nodes-base.googleDrive - If
n8n-nodes-base.if - Extract from File
n8n-nodes-base.extractFromFile - Merge
n8n-nodes-base.merge - Pinecone Vector Store
@n8n/n8n-nodes-langchain.vectorStorePinecone - Embeddings Ollama
@n8n/n8n-nodes-langchain.embeddingsOllama - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - Code
n8n-nodes-base.code - Edit Fields (Set)
n8n-nodes-base.set - AI Agent
@n8n/n8n-nodes-langchain.agent - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - Vector Store Question Answer Tool
@n8n/n8n-nodes-langchain.toolVectorStore
What it does
Quick overview This template builds a dual-stage RAG system that ingests PDFs/text from Google Drive into a Pinecone knowledge-base index with Ollama embeddings, and serves chat queries via a Pinecone semantic cache that falls back to a Google Gemini AI Agent with vector retrieval. How it works 1. Triggers on a Google Drive folder update (or manually) to list and download files from a specified Drive folder. 2. Detects whether each file is a PDF or plain text and extracts the document text accordingly. 3. Splits extracted content into overlapping chunks, embeds them with Ollama (nomic-embed-text), and inserts the vectors into a Pinecone index for the knowledge base. 4. Triggers when a chat message is received and embeds the user query with Ollama to search the Pinecone semantic-cache index for the closest prior answer. 5. Returns the cached answer immediately when the best match score is at least 0.88. 6. On a cache miss, uses a Google Gemini AI Agent with conversation memory and a Pinecone vector-store retrieval tool to generate a grounded answer from the knowledge-base index. 7. Stores the new query-and-answer pair back into the Pinecone semantic-cache index for faster responses to future similar questions. Setup 1. Create two Pinecone indexes using cosine similarity and 768 dimensions: one for the knowledge base (e.g. nomic-embed-text) and one for the semantic cache (e.g. rag-semantic-cache). 2. Set up Pinecone credentials in n8n and select the correct index names in the Pinecone vector store nodes. 3. Run Ollama and pull the nomic-embed-text model, then configure Ollama credentials/base URL in n8n. 4. Add Google Drive OAuth2 credentials and replace YOURGOOGLEDRIVEFOLDERID with the folder you want to ingest. 5. Add a Google Gemini API key and confirm the model name (for example models/gemini-1.5-flash) in both Gemini chat model nodes. 6. If you use the chat trigger via webhook, copy the chat/webhook URL from n8n and configure your client to send messages to it.