AutomationMart
Home/Browse/Build a PDF-based RAG system with OpenAI, Pinecone and Cohere reranking
n8n

Build a PDF-based RAG system with OpenAI, Pinecone and Cohere reranking

n8nn8n11 modulesv1.0
OpenAIGoogle DriveDropbox

This workflow contains community nodes that are only compatible with the self-hosted version of n8n. This workflow provides a complete, ready-to-use template for a Retrieval-Augmented Generation (RAG) system. It allows you to build a powerful AI chatbot that can answer questions based on the content of PDF documents you provide, using a modern and powerful stack for optimal performance. Good to know Costs: This workflow uses paid services (OpenAI, Pinecone, Cohere). Costs will

At a glance

Build a PDF-based RAG system with OpenAI, Pinecone and Cohere reranking is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects OpenAI, Google Drive, Dropbox. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
OpenAI, Google Drive, Dropbox
Modules
11
Price
Free
Version
v1.0
Build a PDF-based RAG system with OpenAI, Pinecone and Cohere reranking workflow diagram

About this workflow

This workflow contains community nodes that are only compatible with the self-hosted version of n8n. This workflow provides a complete, ready-to-use template for a Retrieval-Augmented Generation (RAG) system. It allows you to build a powerful AI chatbot that can answer questions based on the content of PDF documents you provide, using a modern and powerful stack for optimal performance. Good to know Costs: This workflow uses paid services (OpenAI, Pinecone, Cohere). Costs will be incurred based on your usage. Please review the pricing pages for each service to understand the potential expenses. Video Tutorial (Bahasa Indonesia): For a step-by-step guide on how this workflow functions, you can watch the accompanying video tutorial here: N8N Tutorial: Membangun Chatbot RAG dengan Pinecone, OpenAI, & Cohere How it works This workflow operates in two distinct stages: 1. Data Ingestion & Indexing: It begins when a .pdf file is uploaded via the n8n Form Trigger. The Default Data Loader node processes the PDF, and the Recursive Character Text Splitter breaks down the content into smaller, manageable chunks. The Embeddings OpenAI node converts these text chunks into vector embeddings (numerical representations). Finally, the Pinecone Vector Store node takes these embeddings and stores (upserts) them into your specified Pinecone index, creating a searchable knowledge base. 2. Conversational AI Agent: A user sends a message through the Chat Trigger. The AI Agent receives the message and uses its VectorDB tool to search the Pinecone index for relevant information. The Reranker Cohere node refines these search results, ensuring only the most relevant context is selected. The user's original question and the refined context are sent to the OpenAI Chat Model (gpt-4.1), which generates a helpful, context-aware answer. The Simple Memory node maintains conversation history, allowing for natural, multi-turn dialogues. How to use Using this workflow is a two-step process: 1. Populate the Knowledge Base: First, you need to add documents. Trigger the workflow by using the Form Trigger and uploading a PDF file. Wait for the execution to complete. You can do this for multiple documents. 2. Start Chatting: Once your data has been ingested, open the Chat Trigger's interface and start asking questions related to the content of your uploaded documents. The Form Trigger is just an example. Feel free to replace it with other triggers, such as a node that watches a Google Drive or Dropbox folder for new files. Requirements To run this workflow, you will need active accounts and API keys for the following services. OpenAI Account & API Key: Function: Powers text embedding and the final chat generation. Required for the Embeddings OpenAI and OpenAI Chat Model nodes. Pinecone Account & API Key: Function: Used to store and retrieve your vector knowledge base. Required for the Pinecone Vector Store and VectorDB nodes. You also need to provide your Pinecone Environment. Cohere Account & API Key: Function: Improves the accuracy of your chatbot by re-ranking search results for relevance. Required for the Reranker Cohere node. Customising this workflow This template is a great starting point. Here are a few ways you can customize it: Change the AI Personality: Edit the System Message in the AI Agent node to change the bot's behavior, tone, or instructions. Use Different Models: You can easily swap the OpenAI model for another one (e.g., gpt-3.5-turbo for lower costs) in the OpenAI Chat Model node. Adjust Retrieval: In the VectorDB tool node, you can modify the Top K parameter to retrieve more or fewer document chunks to use as context. Automate Ingestion: Replace the manual Form Trigger with an automated one, like a node that triggers whenever a new file is added to a specific cloud storage folder.

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

AI agent to chat with Supabase/PostgreSQL DB

Video Guide I prepared a detailed guide that showed the whole process of building a resume analyzer. []( Who is this for? This workflow is ideal for developers, data analysts, and business owners who want to enable conversational interactions with their database. It’s particularly useful for cases where users need to extract, analyze, or aggregate data without writing SQL queries manually. What problem does this workflow solve? Accessing and analyzing database data often requires SQL expertise o

Free

Update Google Sheets rows based on ChatGPT Assistant responses

Automatically update Google Sheets rows with AI-generated insights. Triggered by new data, ChatGPT Assistant processes messages and your spreadsheet updates efficiently.

Free

WooCommerce AI post-sales chatbot with GPT-4o, RAG, Google Drive and Telegram

This WooCommerce-integrated chatbot is designed to transform post-sales customer support by combining automation and artificial intelligence to deliver fast, secure, and personalized assistance. The chatbot retrieves real-time order information, including shipping details and tracking numbers, after verifying the customer's identity through a strict email-based authentication system. Beyond order management, the chatbot answers frequently asked questions about return policies, delivery times, a

Free

Automated HR screening with VAPI AI calls, Gemini analysis & Google Sheets

This workflow contains community nodes that are only compatible with the self-hosted version of n8n. This n8n template automates candidate outreach, call transcription, and structured feedback capture for HR teams and recruiters. It triggers on a new candidate row added in a Google Sheet, initiates a call using Vapi.ai, processes the transcript using Google Gemini, extracts key information like CTC, experience, and notice period, and then updates the same Google Sheet with parsed insights. This

Free

Iterative content refinement with GPT-4 multi-agent feedback system

Who's it for This workflow is designed for users who want to implement iterative AI-powered content improvement processes. It's ideal for content creators, marketers, product managers, and anyone who needs to refine ideas through multiple rounds of critique and enhancement until they meet quality standards. How it works The workflow creates a sophisticated feedback loop using three specialized AI agents that work together to continuously improve content. Starting with an initial i

Free

Automated Instagram reels workflow

This workflow automates the process of creating and posting Instagram Reels, combining Google Drive, AI, Airtable, and the Facebook Graph API. It supports two content creation paths: 1. Scheduled Random Video Selection & Posting Selects a random video from a Google Drive folder named "Random video mover" based on a schedule. Moves the video to a processing folder for posting. 2. Manual Upload Trigger & Posting Watches a specific Google Drive folder ("n8n reels automation on instagram"). Tr

Free

AI-powered Gmail MCP server

AI-Powered Gmail MCP Server for n8n Description This n8n workflow template leverages an external AI Model Control Plane (MCP) Server to automate various Gmail tasks, such as composing emails, replying to threads, and handling follow-ups using dynamically generated content. It uses the native n8n Gmail nodes available from v1.88.0 onwards. Who is this template for? Ideal for developers, automation engineers, and power users using self-hosted n8n (v1.88.0+) who want to integrate artificial intelli

Free

Collect YouTube channel stats & contact info with Google Sheets and SerpAPI

Workflow Overview This advanced n8n automation is a powerful channel research and intelligence gathering tool designed to transform raw YouTube channel data into actionable insights. By intelligently connecting multiple APIs and data sources, this workflow: 1. Discovers Channel Metrics: - Automatically retrieves channel statistics - Captures detailed performance indicators - Provides comprehensive channel intelligence 2. Performs Deep Analysis: - Extracts recent video performance data - Ca

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