AutomationMart
Home/Browse/RAG: context-aware chunking | Google Drive to Pinecone via OpenRouter & Gemini
n8n

RAG: context-aware chunking | Google Drive to Pinecone via OpenRouter & Gemini

n8nn8n13 modulesv1.0
OpenAIGoogle DriveGemini

Workflow based on the following article. This n8n automation is designed to extract, process, and store content from documents into a Pinecone vector store using context-based chunking. The workflow enhances retrieval accuracy in RAG (Retrieval-Augmented Generation) setups by ensuring each chunk retains meaningful context. Workflow Breakdown: 🔹 Google Drive - Retrieve Document: The automation starts by fetching a source document from Google Drive. This document contains structured content, with

At a glance

RAG: context-aware chunking | Google Drive to Pinecone via OpenRouter & Gemini is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects OpenAI, Google Drive, Gemini. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
OpenAI, Google Drive, Gemini
Modules
13
Price
Free
Version
v1.0
RAG: context-aware chunking | Google Drive to Pinecone via OpenRouter & Gemini workflow diagram

About this workflow

Workflow based on the following article. This n8n automation is designed to extract, process, and store content from documents into a Pinecone vector store using context-based chunking. The workflow enhances retrieval accuracy in RAG (Retrieval-Augmented Generation) setups by ensuring each chunk retains meaningful context. Workflow Breakdown: 🔹 Google Drive - Retrieve Document: The automation starts by fetching a source document from Google Drive. This document contains structured content, with predefined boundary markers for easy segmentation. 🔹 Extract Text Content - Once retrieved, the document’s text is extracted for processing. Special section boundary markers are used to divide the text into logical sections. 🔹 Code Node - Create Context-Based Chunks: A custom code node processes the extracted text, identifying section boundaries and splitting the document into meaningful chunks. Each chunk is structured to retain its context within the entire document. 🔹 Loop Node - Process Each Chunk: The workflow loops through each chunk, ensuring they are processed individually while maintaining a connection to the overall document context. 🔹 Agent Node - Generate Context for Each Chunk: We use an Agent node powered by OpenAI’s GPT-4.0-mini via OpenRouter to generate contextual metadata for each chunk, ensuring better retrieval accuracy. 🔹 Prepend Context to Chunks & Create Embeddings - The generated context is prepended to the original chunk, creating context-rich embeddings that improve searchability. 🔹 Google Gemini - Text Embeddings: The processed text is passed through Google Gemini text-embedding-004, which converts the text into semantic vector representations. 🔹 Pinecone Vector Store - Store Embeddings: The final embeddings, along with the enriched chunk content and metadata, are stored in Pinecone, making them easily retrievable for RAG-based AI applications. Use Case: This automation enhances RAG retrieval by ensuring each chunk is contextually aware of the entire document, leading to more accurate AI responses. It’s perfect for applications that require semantic search, AI-powered knowledge management, or intelligent document retrieval. By implementing context-based chunking, this workflow ensures that LLMs retrieve the most relevant data, improving response quality and accuracy in AI-driven applications. [](

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

LinkedIn job search: auto-match resume with AI + cover letter & Telegram alerts

Overview This n8n templates helps you to authomatically search Linkeding jobs. It uses AI (Gemini or OpenAPI) to match your resume with each job description and write a sample cover letter for each job and update the job google sheet. You can receive daily matched linkedin job alerts by telegram. Prerequisites - AI API Key from one model like: - Google Gemini - OpenAI - Telegram Bot Token

Free

Automate solar lead qualification & follow-ups with Google Sheets and Gmail

Automate Solar Lead Qualification & Follow-ups with Google Sheets and Gmail Note: This template is designed for both self-hosted and cloud-based n8n instances. The workflow image above shows the complete automation flow. This n8n workflow automates the entire solar lead qualification process - from capturing lead information through a webhook, storing data in Google Sheets, evaluating qualification criteria, and sending personalized email follow-ups based on qualification status. Who is this for

Free

Generate comprehensive website audit report with GPT-4o-mini & Claude Sonnet 4.5

Webpage Audit AI Agent – Automate Your Website Review This workflow contains a virtual digital consultant team to professionally analyze Landing Page, generate Audit Report and sent it via Gmail. At the center is the Editor-in-Chief AI Agent, who acts as the lead strategist. When you submit a website URL, it is scraped and then sent to to a team of specialist AI Agents (each powered by GPT-4o-mini for speed) then after finishing their sub-porcess deliver outcome to the final Editor (Claude Sonn

Free

🤖💬 Conversational AI Chatbot with Google Gemini for Text & Image | Telegram

Conversational AI Chatbot with Google Gemini for Text & Image | Telegram Overview 📋 Flexible and scalable chatbot template, designed mainly for Spanish conversations but capable of handling English and other languages. Integrates Google Gemini API for text and image generation, and Telegram for messaging. Supports multiple output types with potential for video, audio, and more. --- How It Works Modular Architecture & Extensibility ⚙️ - Separate modules for data extraction,

Free

Create social media posts from new articles using OpenAI and Facebook Pages

This template generates engaging social media posts from new articles using ChatGPT and publish them on Facebook Pages, enhancing your online presence effortlessly.

Free

Qualify real estate leads via SMS with GPT-4o, Twilio, and Google Sheets

AI-Powered Real Estate Lead Qualifier (n8n Workflow) Description This n8n workflow automates lead engagement and qualification for real estate buyers. When someone submits a form on your real estate website, the system instantly responds via SMS, starting a conversation powered by an AI Agent. The AI asks pre-qualifying questions (like budget, location, and timeline), logs the entire conversation, and then summarizes and sends the lead info to a real estate agent. Chat history is stored

Free

AI image generation & editing with Google Gemini and Telegram Bot

Who is this for? Creators, designers, and developers exploring AI-powered image generation. Automation enthusiasts who want to integrate image creation into n8n workflows. Telegram bot builders looking to add visual AI capabilities. Marketers or freelancers automating creative content workflows. What problem is this workflow solving? Creating AI images usually requires multiple tools and manual setup. This workflow removes the complexity by: Connecting Nano Banana (

Free

Generate comprehensive research reports with Gemini AI and Tavily Search for Japanese users

This workflow contains community nodes that are only compatible with the self-hosted version of n8n. Automated Research Reports with AI and Tavily Search An intelligent research automation workflow designed for Japanese users that transforms user queries into comprehensive HTML reports via email. Using Google Gemini AI and Tavily search, this workflow generates optimized search queries, conducts multi-perspective research, and delivers structured analysis reports in Japanese. Who's it

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free