Skip to content
FlowHubFluxonLab
A
AI Automationfree

RAG:Context-Aware Chunking | Google Drive to Pinecone via OpenRouter & Gemini

by Udit Rawatadapted from n8n official workflow galleryUpdated Aug 2026
RequiresAAI AgentCCodeDDefault Data LoaderEmbeddings Google GeminiEmbeddings Google GeminiGoogle DriveGoogle DrivePinecone Vector StorePinecone Vector StoreRecursive Character Text SplitterRecursive Character Text Splitter
Share Post Share
MaWhen clicking ‘Test workflow’When clicking ‘…SILoop Over ItemsOpenRouter Chat ModelOpenRouter Chat…VSPinecone Vector StorePinecone Vector…EGEmbeddings Google GeminiEmbeddings Goog…DDDefault Data LoaderDefault Data Lo…TSRecursive Character Text SplitterRecursive Chara…Get Document From Google DriveGet Document Fr…EFExtract Text Data From Google DocumentExtract Text Da…CoSplit Document Text Into SectionsSplit Document …SOPrepare Sections For LoopingPrepare Section…AgAI Agent - Prepare ContextAI Agent - Prep…SeConcatenate the context and section textConcatenate the…12345678910111213
1/5
STEPS · 13
Run manually by an operator

Workflow based on the following article. https://www.anthropic.com/news/contextual-retrieval 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.

Tags

n8nreference-onlyagentdocument-default-data-loaderembeddings-google-geminigoogle-drivetext-splitter-recursive-character-text-splittervector-store-pinecone
Connects
AAI AgentCCodeDDefault Data LoaderembeddingsgooglegeminiEmbeddings Google GeminigoogledriveGoogle DrivepineconevectorstorePinecone Vector Store
CategoryAI Automation
Triggermanual
Complexitycomplex
Nodes13
AddedFeb 9, 2025

Related workflows

See all AI Automation
ACDgmail
free

AI: Summarize podcast episode and enhance using Wikipedia

The workflow automates the process of creating a summarized and enriched podcast digest, which is then sent via email. Note that to use this template, you need to be on n8n version 1.19.4 or later.

by n8n Team
ABembeddingsgooglegeminiW
free

Handle WhatsApp support chats with OpenRouter, Pinecone, and Gemini

Quick overview This template implements a WhatsApp support suite that logs inbound events to a dashboard API, routes conversations through an OpenRouter-powered AI agent with Pinecone RAG and memory, exposes a webhook for human outbound replies, and provides a webhook to summarize recent chats for handoff. How it works Triggers on WhatsApp Cloud API events and routes status updates (sent/delivered/read) to a dashboard API endpoint for storage. For inbound messages, looks up the contact in the dashboard API and normalizes the message into a consistent schema (sender, type, timestamp, and best-effort content). If the message contains media (image/video/audio/document), fetches the WhatsApp media URL, downloads the file, uploads it to the dashboard’s media endpoint, and attaches the resulting media URL and MIME type. Stores inbound messages and reactions in the dashboard API, then checks via the cases endpoint whether the sender already has an open case. If the inbound message is text and no open case is found, queries Pinecone as a tool (using Google Gemini embeddings), uses an OpenRouter chat model with conversation memory to draft a reply or create a new case via the dashboard API,

by Salman Mehboob
DhtmlWopenaichatmodel
free

Scrape and summarize webpages with AI

This workflow integrates both web scraping and NLP functionalities. It uses HTML parsing to extract links, HTTP requests to fetch essay content, and AI-based summarization using GPT-4o. It's an excellent example of an end-to-end automated task that is not only efficient but also provides real value by summarizing valuable content. Note that to use this template, you need to be on n8n version 1.50.0 or later.

by n8n Team