Mindket

PDF chat that cites its sources from Pinecone

Newversion 1 · updated

Overview

An n8n workflow that answers questions about a PDF and shows where each answer came from. Each reply ends with the file name and line range of every Pinecone piece the OpenAI model used.

PDF chat that cites its sources from Pinecone is an n8n workflow in the Research category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

At a glance

Runs in
  • n8n Cloud: import the file, load the PDF once and open the chat
  • Your own n8n server: the same steps
  • Another file source: replace Download file with a node that fetches a PDF from elsewhere
  • Another look for citations: change the expression in Compose citations

Platform

Connects 3 apps

How it works

Trigger

Chat message

Two things start it. Pressing Execute workflow loads the PDF into Pinecone. A message in n8n’s chat asks a question, and the trigger reads:

  • Your question

Actions

  1. The workflow downloads the PDF, cuts it into pieces of 3,000 characters and stores them in Pinecone with the file name and link
  2. Your question is turned into a vector, and Pinecone returns the four closest pieces
  3. The pieces are numbered and handed to an OpenAI model together with your question
  4. The model returns an answer and the numbers of the pieces it used
  5. Each number becomes the file name and line range of that piece
  6. The answer and the citations go back to the chat as one text

Result

A chat reply with the answer and a citation for each piece used, made of the file name and a line range

Integrations

What you need before you start.

Google Drive

File source

Holds the PDF the workflow downloads.

NeedsGoogle account linked through n8n’s Google sign-in, and the share link of the PDF

Pinecone

Vector store

Stores the pieces of the PDF with their file name and finds the closest ones to a question.

NeedsPinecone API key and an index with 1536 dimensions

OpenAI

Embeddings and answers

Turns text into vectors and writes the answer and the list of pieces it used.

NeedsOpenAI API key

Workflow check

Checked by Mindket on 13 Nov 2026

Steps
12 steps, starting on a chat message or by hand
AI
3 steps call an AI model: Get top chunks matching query, Answer the query based on chunks and Add to Pinecone vector store
Sign-ins
Signs in to: Pinecone, OpenAI and Google Drive
API keys
No API key is left in the file
Step types
Mindket’s checker reads all 7 of its step types

Read from the workflow’s file, not from a run.

About

What it is

This n8n workflow answers questions about a PDF and says where each answer came from. One run loads the PDF from Google Drive into Pinecone. In the chat, an OpenAI model answers from the four closest pieces and reports which ones it used. The workflow turns those into a file name and a line range. Eighteen nodes do the work, plus four sticky notes.

Who it suits

People who need to check an answer against its source, such as researchers, editors and reviewers. It is made for people who already use n8n, OpenAI and Pinecone. Skip it if you want plain answers, since every reply here ends with a line of citations.

Who uses it, and how
IndustryWho uses itHow they use itExample
ResearchAnalystsAsk a paper a question and see which lines back the answerAn analyst asks what a study found and reads the cited lines.
LegalParalegalsFind a clause and where it sitsA paralegal asks about termination and gets the lines to open.
PublishingEditorsCheck a fact in a manuscriptAn editor asks where a date appears and follows the citation.
SupportSupport teamsAnswer from a manual and show the sourceAn agent asks how to reset a device and sends the cited lines with the reply.

You need some n8n: import a file, add three credentials and make a Pinecone index.

Where to use it

Any n8n that can reach Google, OpenAI and Pinecone will run it. The chat is n8n’s own, so it needs no other app.

  • n8n Cloud: import the file, load the PDF once and open the chat
  • Your own n8n server: the same steps
  • Another file source: replace Download file with a node that fetches a PDF from elsewhere
  • Another look for citations: change the expression in Compose citations

Setup

Download saves a zip with workflow.json and Mindket’s setup notes in your downloads folder. Setup is three credentials, a Drive link and one Pinecone index.

What you need first
NeedDetail
n8nOn n8n Cloud or on a server of your own
OpenAIAn API key
GoogleAn account that can open your PDF, linked through n8n’s Google sign-in
PineconeAn account, an API key and an index with 1536 dimensions
  1. In n8n, create a workflow, open its menu, choose Import from File and pick workflow.json.
  2. Add an OpenAI credential and select it in OpenAI Chat Model, Embeddings OpenAI and Embeddings OpenAI2.
  3. Add a Google Drive OAuth2 credential and select it in Download file.
  4. In Set file URL in Google Drive, replace the whole value with the share link of your PDF.
  5. In Pinecone, make an index with 1536 dimensions. Add a Pinecone credential, then select it and the index in Add to Pinecone vector store and Get top chunks matching query.
  6. Press Execute workflow to load the PDF, then open the chat and ask a question.

How to use it

Press Execute workflow once to load the PDF, then open the chat and ask. A reply is the answer, followed by a line such as [report.pdf, lines 12-30] for each piece used. Load only once, since a second load adds the same pieces again.

What to change for a different result
To changeWhere
Which PDF it loadsThe link in Set file URL in Google Drive
How many pieces the model seesThe chunks value in Set max chunks to send to model
How big a piece isThe chunk size and the overlap in Recursive Character Text Splitter
The look of a citationThe expression in Compose citations
The modelOpenAI Chat Model

Example

You load a contract and ask when either side may end it.

The chat replies with the answer and a citation such as the file name and a line range for each piece used. Open the cited lines before you rely on the answer, since a model chose them.

For newcomers and experts

If you are new. n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. A vector store keeps text as lists of numbers that stand for meaning, so it can find the pieces closest to a question. A model then writes the answer and says which pieces it used.

For experts. Loading runs Set file URL in Google Drive, Download file, Add in metadata and Add to Pinecone vector store. Asking runs Set max chunks to send to model and Get top chunks matching query. Prepare chunks then numbers the pieces. Answer the query based on chunks returns an answer and chunk numbers through a Structured Output Parser. Compose citations and Generate response build the reply.

Where to look closer
NodeWhat it doesWhat to know
Get top chunks matching queryFinds the closest pieces in PineconeIt embeds the question with Embeddings OpenAI2
Prepare chunksNumbers the pieces from 0 and joins them into one blockThe model cites those numbers
Answer the query based on chunksAsks the model for an answer and the numbers it usedThe parser forces that shape
Compose citationsTurns each number into a file name and a line rangeMindket’s copy fixes the lookup and skips a number with no piece
Generate responseJoins the answer and the citationsThe text goes back to the chat
Add to Pinecone vector storeStores the pieces with the file name and linkIt never clears anything, so a second load adds copies

Good to know

The original copy failed whenever the model cited more than one piece, and loading twice adds every piece again.

  • Citation fix: Compose citations asked for one entry named by the whole list of numbers. That worked for one citation and failed for two or more. Mindket’s copy reads one entry per number and skips a number with no piece
  • Copies: each load adds the pieces again, and a question may then return the same text twice. Empty the index, or use a namespace, before you load again
  • Models: OpenAI’s deprecations page, read on 12 November 2026, lists gpt-5-mini, the chat node’s default, for shutdown on 11 December 2026 with gpt-5.6-terra as the replacement. The chain has no tools, so Mindket’s copy uses it. The embeddings nodes used text-embedding-ada-002 by default. They now use text-embedding-3-small, which has the same size, 1536. Load again if your index holds vectors from the old model
  • Citations come from the model: it reports the numbers of the pieces it says it used, and nothing checks that
  • Your data: the text of the PDF goes to OpenAI and Pinecone, and each question goes to OpenAI
  • Not run: nothing here was run against Google, OpenAI or Pinecone. The notes come from n8n’s source and the vendors’ pages
  • Credentials: the JSON holds none

README and files

README

PDF chat that cites its sources from Pinecone

An n8n workflow that answers questions about a PDF and names where each answer came from. One run loads a PDF from Google Drive
into Pinecone. In the chat, each reply ends with a citation for every piece the model used.

What is inside

  • workflow.json: the workflow as n8n exports it, 22 nodes, four of them sticky notes. It holds no credential. Of the notes,
    two are coloured frames that group the nodes, one holds try-it steps and one is a short hint.
  • README.md: these notes.

What we changed from the original copy

  • The Google Drive, OpenAI and Pinecone nodes were linked to credentials in their author's n8n. The links are gone, so select your
    own.
  • The Drive link in Set file URL in Google Drive pointed at one public file and had a space in front of it. It is now a
    placeholder, <GOOGLE_DRIVE_FILE_ID>, that you replace with your own link. The try-it note and the small note beside the node
    were reworded to match.
  • Compose citations read [$json.citations], which asks for the entry at a position named by the whole list of numbers. With one
    cited chunk it worked, and with two or more it found nothing and the run failed. It now reads the entry for each number in turn,
    and it skips a number that has no chunk.
  • The Structured Output Parser's schema now lists answer and citations as required, so a reply without citations fails at the
    parser, not later.
  • OpenAI Chat Model had no model set, so it used n8n's default, gpt-5-mini. It is now set to gpt-5.6-terra.
  • Both embeddings nodes had no model set, so they used text-embedding-ada-002. They are now set to text-embedding-3-small, which
    makes vectors of the same size, 1536.
  • The Chat Trigger's webhook id is gone, and n8n makes a new one when you import the file.
  • Nothing else.

Before you start

  • An n8n instance, on n8n Cloud or on your own server.
  • An OpenAI API key.
  • A Google account that can open your PDF, linked to n8n through its Google sign-in.
  • A Pinecone account, an API key, and an index with 1536 dimensions.

Set it up

  1. In n8n, create a workflow, open its menu and choose Import from File. Pick workflow.json.
  2. Add an OpenAI credential. Select it in OpenAI Chat Model, Embeddings OpenAI and Embeddings OpenAI2.
  3. Add a Google Drive OAuth2 credential and select it in Download file.
  4. In Set file URL in Google Drive, replace the whole value with the share link of your PDF. In Drive, open the PDF, choose Share
    and copy the link.
  5. Make an index with 1536 dimensions in Pinecone. Add a Pinecone credential in n8n, then select the credential and the index in
    Add to Pinecone vector store and in Get top chunks matching query. Both nodes must use the same index.
  6. Press Execute workflow to load the PDF. Check in Pinecone that the index now holds records.
  7. Open the chat from the button at the bottom of the canvas and ask a question about the PDF.

How a run goes

Loading, started by hand:

  1. Set file URL in Google Drive holds the link in a field named file_url, and Download file fetches that file.
  2. Add in metadata copies the file name, its extension and the link onto the item.
  3. Add to Pinecone vector store takes the file through Default Data Loader as binary data. The loader keeps the file name and
    the link as metadata. Recursive Character Text Splitter cuts the text into pieces of 3,000 characters that overlap by 200.
    Embeddings OpenAI turns each piece into a vector.

Asking, started from the chat:

  1. Set max chunks to send to model adds a field chunks with the value 4.
  2. Get top chunks matching query embeds your question with Embeddings OpenAI2 and asks Pinecone for that many pieces.
  3. Prepare chunks numbers the pieces from 0 and joins them into one block of text, headed --- CHUNK 0 --- and so on.
  4. Answer the query based on chunks gives the block and your question to OpenAI Chat Model. The Structured Output Parser makes the
    model reply with an answer and a list of the chunk numbers it used.
  5. Compose citations turns each number into the file name and the line range of that piece, such as [report.pdf, lines 12-30].
  6. Generate response joins the answer and the citations into the text that comes back in the chat.

Change the look

  • Which PDF it loads: the link in Set file URL in Google Drive.
  • How many pieces the model sees: the chunks value in Set max chunks to send to model.
  • How big a piece is: the chunk size and the overlap in Recursive Character Text Splitter. Load again after a change.
  • The wording of the instructions: the prompt text in Answer the query based on chunks.
  • The look of a citation: the expression in Compose citations.
  • The model: the model field of OpenAI Chat Model.

Good to know

  • Copies: the insert node does not clear anything. Each time you load, the pieces are added again, and a question may then return
    the same text twice. Empty the index, or use a namespace, before you load again.
  • Models: OpenAI's deprecations page, read on 12 November 2026, lists gpt-5-mini for shutdown on 11 December 2026 with
    gpt-5.6-terra as the replacement. The chain has no tools, so Mindket's copy uses gpt-5.6-terra. The page does not list
    text-embedding-ada-002. The new embeddings model gives vectors that do not mix with the old one's, so load again if your index
    already holds vectors from the old model.
  • Citations come from the model: it reports the numbers of the chunks it says it used, and nothing checks that. Read the cited
    lines before you rely on a quote.
  • Line numbers: they are the ones the text splitter records for each piece, so they count inside the text it was given.
  • Your data: the text of the PDF goes to OpenAI and to Pinecone, and each question goes to OpenAI.
  • Not run: nothing here was run against Google, OpenAI or Pinecone. These notes come from n8n's source and the vendors' pages, read
    on 12 November 2026.
Files
NOTICE.md  638 B
README.md  6 KB
workflow.json  15 KB

3 files, 21 KB, downloaded as a zip.

What’s new

  • Version 1 · 2026-11-12

Reviews

No ratings yet

Write a review

No reviews yet.

More from Mindket

See all from Mindket

Bonsai-27B-GGUF

lmstudio-community · Kit

A GGUF conversion of the 27B Bonsai model for LM Studio, with a 3.80 GB Q1_0 language file and a 0.93 GB BF16 vision projector. Tested for text, vision and par…

New

Runs DeepSeek-V4.1-Flash-1017 as a 2.9 bits-per-weight EXL3 quantization, a 196 GiB copy for people serving large models on their own hardware. Perplexity stay…

New

MusicGen Small

facebook · Kit

Generates short music clips from a text description or an audio prompt, in the small checkpoint of facebook's MusicGen. It suits developers and music hobbyists…

New

Similar in Research

See all in Research

Merlin-Cancer-Super

AbdomenAtlas · Kit

Detects and outlines tumors in 9 organs on CT scans, trained with the R-Super method that learns from radiology reports. A research model for medical imaging g…

New

EarthJev

dBenf · Kit

Answers typed questions about satellite image patches from all 12 Sentinel-2 bands, returning a probability for each option without writing text. A Qwen3.5-0.8…

New

getting-over-it-rl-jax

zimmerk4 · Kit

Plays the full game Getting Over It from the bottom to the end with a small trained policy network that learned inside a JAX physics simulator. For reinforceme…

New