Chat with PDF docs using AI (quoting sources)
Ready for 3.0What this workflow does
This AI workflow has 16 nodes and runs manually, when you click “Execute workflow” (plus 1 other trigger). Along the way it connects Pinecone Vector Store, OpenAI Chat Model, Google Drive and Embeddings OpenAI.
How it runs
Trigger: Manually, when you click “Execute workflow” (plus 1 other trigger).
- Set file URL in Google Drive (Edit Fields (Set)): sets 1 field: file_url
- Set max chunks to send to model (Edit Fields (Set)): sets 1 field: chunks
- Download file (Google Drive): download
- Get top chunks matching query (Pinecone Vector Store): searches the Pinecone vector store, with embeddings: Embeddings OpenAI
- Pinecone Vector Store: stores documents in the Pinecone vector store, with embeddings: Embeddings OpenAI; document loader: Default Data Loader
- Prepare chunks (Code): runs custom JavaScript code
- Answer the query based on chunks (Information Extractor): extracts structured fields from text with AI, with model: OpenAI Chat Model
- Compose citations (Edit Fields (Set)): sets 1 field: citations
- Generate response (Edit Fields (Set)): sets 1 field: text
Services it uses
Other OpenAI + Google Drive templates (628) · Other OpenAI + Pinecone templates (128) · Other Google Drive + Pinecone templates (65)
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)
- Manual Trigger
n8n-nodes-base.manualTrigger - Pinecone Vector Store
@n8n/n8n-nodes-langchain.vectorStorePinecone - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Edit Fields (Set)
n8n-nodes-base.set - Google Drive
n8n-nodes-base.googleDrive - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi - Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - Code
n8n-nodes-base.code - Information Extractor
@n8n/n8n-nodes-langchain.informationExtractor
From the author
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…