Document Q&A with RAG: Query PDF content using Weaviate and OpenAI
Ready for 3.0What this workflow does
This AI workflow has 13 nodes and runs when someone submits an n8n form (“Upload your file here”) (plus 1 other trigger). Along the way it connects Weaviate Vector Store, Embeddings OpenAI and OpenAI Chat Model.
How it runs
Trigger: When someone submits an n8n form (“Upload your file here”) (plus 1 other trigger).
- Extract from File: extracts data from a file (pdf)
- Question and Answer Chain: answers questions over your documents (RAG), with model: OpenAI Chat Model; retriever: Vector Store Retriever
- Edit Fields (Edit Fields (Set)): sets 1 field: text
- Weaviate Vector Store: stores documents in the Weaviate vector store, with embeddings: Embeddings OpenAI; document loader: Default Data Loader
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (11)
- Weaviate Vector Store
@n8n/n8n-nodes-langchain.vectorStoreWeaviate - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi - Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - Extract from File
n8n-nodes-base.extractFromFile - Edit Fields (Set)
n8n-nodes-base.set - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - Question and Answer Chain
@n8n/n8n-nodes-langchain.chainRetrievalQa - Vector Store Retriever
@n8n/n8n-nodes-langchain.retrieverVectorStore - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - n8n Form Trigger
n8n-nodes-base.formTrigger
From the author
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…