# n8n PDF RAG Workflow

> Architect and troubleshoot n8n PDF RAG workflows with custom chunking and in-memory vector retrieval.

n8n PDF RAG Workflow is a free AI agent skill on Agensi by kawthar, in Workflow Automation. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [kawthar](https://www.agensi.io/creators/kawthar)
- Category: [Workflow Automation](https://www.agensi.io/skills/workflow-automation)
- Version: 1.0
- Last updated: 2026-11-26
- Security: scan passed (2026-11-26); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/n8n-pdf-rag-workflow
- Tags: automation, n8n, rag, llm-ops, ollama

## About this skill

Building a PDF-based RAG pipeline in n8n often fails due to misconfigured sub-node connectors, losing data on restarts, or incorrect routing between ingestion and retrieval branches. This skill provides the precise architecture and configuration steps to deploy a functional in-memory PDF RAG workflow.

### What it does
- **Multi-branch routing** creates logic to separate PDF file ingestion from text-based question answering using n8n IF nodes.
- **Custom text chunking** configures Recursive Character Text Splitters with specific 600/80 parameters for optimal retrieval.
- **Vector store integration** maps binary data loaders to in-memory vector stores using shared memory keys.
- **Agentic retrieval** connects AI Agents to Query Data Tools using the `retrieve-as-tool` mode for grounded responses.
- **Model configuration** specifies embedding and chat model setups using Ollama-based local LLMs like Llama 3.2.

### How it works
1. Initialize a Chat Trigger with file uploads enabled and route the payload through an IF node to detect binary data.
2. Build the ingestion branch by connecting the Default Data Loader to a Vector Store sub-node using custom text splitting.
3. Configure the retrieval branch by attaching an AI Agent to a Query Data Tool sharing the same vector memory key.
4. Verify sub-node connections for embeddings and language models to ensure the tool executes correctly.

### Frameworks & tools
This skill focuses on n8n workflow automation, specifically utilizing the AI Agent, Vector Store (In-Memory), Default Data Loader, and Ollama integration for local embedding (`nomic-embed-text`) and chat (`llama3.2`).

### Why this beats prompting it yourself
Generic AI prompts often confuse n8n execution arrows with sub-node connectors, leading to invalid workflow JSON. This skill enforces specific chunking sizes and memory key consistency that prevents the "missing context" errors common in DIY RAG setups.

### Use cases
- Build a private document assistant that processes local PDFs without external APIs.
- Fix broken n8n workflows where the agent fails to query the vector store.
- Scaffold a reusable RAG template for team-wide document analysis.
- Transition from simple chat bots to tool-augmented agents that cite local files.

### Known limitations
The vector store is in-memory only, meaning data is lost upon n8n service restarts. It requires manual re-upload of PDFs for new sessions unless swapped for a persistent database.

## Requires

- n8n
- Ollama
- nomic-embed-text
- llama3.2

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the n8n PDF RAG Workflow skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What specific technical problems does this n8n PDF RAG skill solve?

This skill solves common n8n errors like disconnected sub-nodes, inconsistent memory keys, and failed binary-to-text conversion during PDF ingestion. It provides a blueprint for a functional RAG pipeline that actually retrieves data instead of hallucinating.

### Can I use this workflow with OpenAI instead of local Ollama models?

While optimized for Ollama (Llama 3.2 and Nomic embeddings) to ensure privacy, the architecture is model-agnostic. You can easily swap the Ollama nodes for OpenAI, Anthropic, or Mistral if you prefer cloud-based LLMs.

### What assets are included in the download?

The purchase includes the complete n8n workflow JSON file, a configuration guide for the vector memory keys, and specific parameters for the text splitter nodes to ensure optimal document chunking.

### Will the uploaded PDF data stay indexed forever?

This workflow uses the In-Memory Vector Store for high speed and zero-cost setup; however, data is cleared when the n8n instance restarts. The architecture is designed so you can later swap the In-Memory node for a persistent database like Pinecone or Qdrant if needed.

### What are the minimum software requirements to run this skill?

You will need an active n8n instance (v1.1.0 or higher recommended) with the LangChain/AI nodes enabled. If you plan to run it locally as described, you should also have Ollama installed and the required models pulled.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
