🔬 Index local documents for RAG using Ollama embeddings and Qdrant

⚡ 111 views · 🔬 Document Extraction & Analysis

Description

Quick overview

This workflow ingests a local document file, splits it into chunks, generates embeddings with Ollama (nomic-embed-text), and stores the vectors in a Qdrant collection for on-prem RAG indexing.

How it works

  1. Runs manually when you click Execute workflow in n8n.
  2. Reads a document from disk from the n8n host/container file system.
  3. Extracts text content from the file (configured for PDF extraction).
  4. Splits the extracted text into overlapping chunks using a recursive character splitter.
  5. Generates embeddings for each chunk with Ollama using the nomic-embed-text model.
  6. Inserts the chunk texts and their embeddings into a specified Qdrant collection.

Setup

  1. Self-host n8n with a mounted volume and update the file path to a container-accessible path in the Read/Write Files from Disk step.
  2. Run Ollama locally, pull the nomic-embed-text model, and add an Ollama credential in n8n pointing to your Ollama instance.
  3. Set up a Qdrant instance, create a Qdrant API credential in n8n (URL and API key), and set the target collection name (for example, handbook) in the Qdrant step.

Requirements

Customization

Additional info

Pairs with a companion template, “Local RAG Query Chatbot,” which queries the same Qdrant collection this workflow populates — run this Indexer first, then use that template to ask questions about the indexed content. Runs entirely on local models (Ollama + Qdrant), so there’s no per-query API cost once set up.

Known limitation: retrieval quality on the companion query template depends on the Vector Store Retriever’s Top K setting. With the default value, questions needing multiple facts at once may retrieve an incomplete set of chunks, and the assistant will correctly decline rather than guess. Increase Top K on the retriever node if you need broader recall.

đź”— Nodes Used

Recursive Character Text Splitter, Read/Write Files from Disk, Extract from File, Default Data Loader, Qdrant Vector Store, Embeddings Ollama

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup