Chat with PDF docs using AI (quoting sources)

Go to Workflow
95,385 views
Built by David Roberts David Roberts
Created on June 05, 2026

Description

This workflow allows you to ask questions about a PDF document. The answers are provided by an AI model of your choice, and the answer includes a citation pointing to the information it used.

You can use n8n’s built-in chat interface to ask the questions, or you could customise this workflow to use another one (e.g. Slack, Teams, etc.)

Example

The workflow is set up with the Bitcoin whitepaper. So you could ask things like:

Question: “Which email provider does the creator of Bitcoin use?“
Answer: “GMX [Bitcoin whitepaper.pdf, lines 1-35]”

Requirements

A Pinecone account (they have a free tier at the time of writing that is easily enough for this workflow)
Access to a large language model (e.g. an OpenAI account)

Customizing this workflow

The workflow only reads in one document, but you could customise it to read in all the documents in a folder (or more).

The workflow is set up to use GPT 3.5, but you could swap that out for any other model (including self-hosted ones).

Nodes Used (9)

Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm
Code
n8n-nodes-base.code
Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader
Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi
Google Drive
n8n-nodes-base.googleDrive
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
Pinecone Vector Store
@n8n/n8n-nodes-langchain.vectorStorePinecone
Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter
Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured