Templates / Chat with PDF docs using AI (quoting sources)

Chat with PDF docs using AI (quoting sources)

Ready for 3.0

by David Roberts ✓ · 117,084 views · created 2024-03-05 · Document Extraction, AI RAG

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-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What 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).

  1. Set file URL in Google Drive (Edit Fields (Set)): sets 1 field: file_url
  2. Set max chunks to send to model (Edit Fields (Set)): sets 1 field: chunks
  3. Download file (Google Drive): download
  4. Get top chunks matching query (Pinecone Vector Store): searches the Pinecone vector store, with embeddings: Embeddings OpenAI
  5. Pinecone Vector Store: stores documents in the Pinecone vector store, with embeddings: Embeddings OpenAI; document loader: Default Data Loader
  6. Prepare chunks (Code): runs custom JavaScript code
  7. Answer the query based on chunks (Information Extractor): extracts structured fields from text with AI, with model: OpenAI Chat Model
  8. Compose citations (Edit Fields (Set)): sets 1 field: citations
  9. Generate response (Edit Fields (Set)): sets 1 field: text

Services it uses

Pinecone Vector StoreOpenAI Chat ModelGoogle DriveEmbeddings OpenAI

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)

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…

Excerpt from David Roberts's description on n8n.io.

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.