Build hybrid RAG search over PDFs with Qdrant and Ollama
Quick overview This workflow ingests a local PDF into Qdrant with Ollama embeddings, then supports hybrid retrieval by querying Qdrant with both dense vectors and BM25 sparse vectors from an n8n chat trigger.
How it works Starts manually to read a PDF from disk and extract its text content. Checks whether the Qdrant collection exists and creates it with a 768-dimension dense vector and a BM25-based sparse vector field if needed. Splits the extracted text into chunks, adds metadata, generates dense embeddings with Ollama (nomic-embed-text), and inserts the documents into the Qdrant vector store. Scrolls all stored points from Qdrant, builds a per-point BM25 sparse vector payload from each point’s content, and updates Qdrant vectors without overwriting existing fields. Triggers on an incoming chat message, generates an embedding for the query via Ollama’s embeddings HTTP API, and runs a Qdrant hybrid search that fuses dense and BM25 results using RRF.
Setup Configure Qdrant credentials (REST API and Vector Store) and ensure the workflow points to the correct Qdrant URL/collection name (default: collection "testing"). Set up Ollama credentials and ensure the nomic-embed-text:latest model is available, and update the embeddings endpoint URL if your Ollama host is not http://host.docker.internal:11434. Place the source PDF on the n8n host and update the file path in the disk read step (default: /tmp/n8n_Self_Hosted_Enterprise_Terms_and_Conditions.pdf). Enable the chat trigger and use its webhook/chat entry point to send queries into the workflow.
Related Templates
Restore your workflows from GitHub
This workflow restores all n8n instance workflows from GitHub backups using the n8n API node. It complements the Backup ...
Build a Restaurant Voice Assistant with VAPI and PostgreSQL for Bookings & Orders
This n8n template demonstrates how to create a comprehensive voice-powered restaurant assistant that handles table reser...
Extract Named Entities from Web Pages with Google Natural Language API
Who is this for? Content strategists analyzing web page semantic content SEO professionals conducting entity-based anal...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments