Build a Company Document RAG Chatbot with Google Drive and Gemini
Input: Google Drive folder with company documents; Processing: n8n auto-indexes into Pinecone, Chat Trigger receives questions, AI Agent retrieves and generates answers; Output: Context-aware document Q&A chat
- Who
- Teams needing a quick internal document-based Q&A assistant
- You get
- Employees upload or update documents in Google Drive and the system auto-indexes them; answers are generated from retrieved document content with conversation context
- You need
- n8n · google-drive · pinecone · gemini
Constraints
Prerequisites: n8n instance (self-hosted or cloud), Google Cloud project with Vertex AI API enabled, Google AI Studio API Key, Pinecone account with an index named company-files, and a dedicated Google Drive folder. Costs: Google AI API and Pinecone billed per their pricing; n8n per instance plan. Boundaries: Triggers poll every minute (not real-time); index dimensions and metric must match the embedding model; no access control is configured—anyone with access to the Chat Trigger can ask questions.
What they did
Author mihailtd published an n8n workflow template that: detects new or updated documents in a Google Drive folder, automatically downloads, splits, embeds, and indexes them into Pinecone; and provides a Chat Trigger where employees ask questions, an AI Agent retrieves from the vector store, and Gemini generates answers with Window Buffer Memory for short-term conversation context.
How it went
The template has approximately 349,000 views on n8n.io (author_report). No specific accuracy or user satisfaction metrics are provided by the source.
Worth knowing
1. Google Drive Triggers use polling (everyMinute), not real-time push; large files or bulk updates may cause delays. 2. Index dimensions must match text-embedding-004 output or Pinecone writes will fail. 3. The source uses gemini-2.0-flash-exp (experimental); available versions may change as Google updates models. 4. No access control is configured—production use requires additional restrictions on Chat Trigger access. 5. This site has not tested the workflow; reproduction=not_tested.
n8n workflow template
Structure checked · Not run-testedUse “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.
Setup and test checklist
Credentials to connect
- Pinecone Vector Store node: connect pineconeApi credentials.
- Embeddings Google Gemini node: connect Google Gemini/PaLM API credentials.
- Pinecone Vector Store (Retrieval) node: connect pineconeApi credentials.
- Embeddings Google Gemini (retrieval) node: connect Google Gemini/PaLM API credentials.
- Download File From Google Drive node: connect Google Drive OAuth2 credentials.
- Google Drive File Updated node: connect Google Drive OAuth2 credentials.
- Google Drive File Created node: connect Google Drive OAuth2 credentials.
- Google Gemini Chat Model node: connect Google Gemini/PaLM API credentials.
- Google Gemini Chat Model (retrieval) node: connect Google Gemini/PaLM API credentials.
Configuration to replace
- Source template is n8n public workflow #2753 (~18 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
- Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.
Test input and expected output
- Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
- Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.
Template changes
- Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
- No business-logic edits; verify keys, quotas and privacy compliance before use.
Template retrieved: 2026-10-25
Steps
Prepare external accounts and credentials
Complete three account setups outside n8n, then add the corresponding credentials in n8n. 1. Google Cloud: Create a project and enable the Vertex AI API. 2. Google AI Studio: Obtain an API Key for Gemini model calls. 3. Pinecone: Sign up, get your API Key, and create an index named company-files (choose dimensions and metric compatible with your embedding model). 4. Google Drive: Create a dedicated folder for company documents. 5. n8n Credentials: Add three credentials: - Google Drive OAuth2 - Google Gemini (PaLM) API (enter your Google AI API Key) - Pinecone API (enter your Pinecone API Key)
Import the workflow and configure triggers and vector store
Import this workflow from the n8n template library (ID 2753) or via workflow.json. Then configure two node groups: - Both Google Drive Trigger nodes (File Created / Updated): set folderToWatch to your dedicated Google Drive folder. - Both Pinecone Vector Store nodes (insert and retrieval): set pineconeIndex to company-files. Leave other node parameters at their template defaults to run.
Configure the AI Agent system message
Open the AI Agent node and enter the following prompt in Options > System Message. This prompt controls how the bot retrieves documents and answers employee questions.
Execution prompt · Source text。AI Agent node Options > System Message field
You are a helpful HR assistant designed to answer employee questions based on company policies. Retrieve relevant information from the provided internal documents and provide a concise, accurate, and informative answer to the employee's question. Use the tool called "company_documents_tool" to retrieve any information from the company's documents. If the answer cannot be found in the provided documents, respond with "I cannot find the answer in the available resources."
Verify auto-indexing and Q&A
Activate the workflow and run two checks: 1. Auto-indexing: Upload a new document (or update an existing one) to the target Google Drive folder. Wait about 1 minute (poll interval), then check the Pinecone console to confirm the company-files index contains new text chunks. 2. Q&A test: Open the Chat Trigger chat interface and ask a document-related question (e.g., "What is our annual leave policy?"). Expect the AI Agent to call company_documents_tool to query Pinecone, then the Google Gemini Chat Model to generate an answer grounded in the documents. Window Buffer Memory retains recent conversation context for multi-turn follow-ups.
Prompt you can copy
Setup guidance · Editorial suggestion。Give to setup assistant; confirm inputs and permissions first
This block is the prompt. Ads are never placed here.
You are assisting someone to set up this n8n RAG chatbot. Confirm they have completed: 1) Google Cloud / Google AI / Pinecone accounts and credentials; 2) workflow import and node configuration; 3) AI Agent systemMessage filled in. If stuck on credentials, guide them to check OAuth callback URLs and API Key permission scopes.
Before starting, confirm you have n8n instance admin rights, Google Cloud project owner access, and Pinecone project write access.
Source
RAG chatbot for company documents using Google Drive and Gemini · mihailtd · n8n.io · 2025-01-20
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.