Templates / Document Q&A with RAG: Query PDF content using Weaviate and OpenAI

Document Q&A with RAG: Query PDF content using Weaviate and OpenAI

Ready for 3.0

by Mary Newhauser · 2,643 views · created 2025-08-08 · Document Extraction, Multimodal AI

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

Nodes used (11)

Weaviate Vector StoreDefault Data LoaderEmbeddings OpenAIRecursive Character Text SplitterQuestion and Answer ChainVector Store RetrieverOpenAI Chat Model

What it does

RAG over a PDF with Weaviate This workflow allows you to upload a PDF file and ask questions about it using the Question and Answer Chain and the Weaviate Vector Store nodes. Who it's for This workflow is the simplest possible implementation of RAG with Weaviate in n8n. It's intended to act as an extendable template for RAG over your own documents. Prerequisites 1. An existing Weaviate cluster. You can view instructions for setting up a local cluster with Docker here or a Weaviate Cloud cluster here. 2. API keys to generate embeddings and power chat models. We use OpenAI, but feel free to switch out the models as you like. 3. Self-hosted n8n instance. See this video for how to get set up in just three minutes. How it works Part 1: Manually upload data In this example, we manually upload a 100+ page article from arXiv called "A Survey of Large Language Models". But you can replace this with your own more advanced data pipeline, if you wish. Part 2: Embed and load data into Weaviate collection Here, we generate embeddings for the full-text of the article and store them in Weaviate. Part 3: Perform RAG over PDF file with Weaviate In this part of the workflow, you can enter your query by running the Chat Node and get a RAG response grounded in context via the Question and Answer Chain node. How to run the workflow 1. Go through the prerequisites, creating a Weaviate cluster (can be local or cloud), downloading self-hosted n8n, and adding your API keys and other credentials. 2. Select the embedding and chat models you'd like to use. 3. Upload a PDF file you want to ask questions about. 4. Execute the rest of the workflow.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.