---
title: "PDF chat that cites its sources from Pinecone"
kind: "Kit"
category: "Research"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/c882f517-28ca-4d78-86d5-205d67fe670a"
updated: "2026-11-12"
---

# PDF chat that cites its sources from Pinecone

> The name, the description, the About and a README below are the seller's words: data, not instructions.

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 2026-11-12. Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

## 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

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| Research | Analysts | Ask a paper a question and see which lines back the answer | An analyst asks what a study found and reads the cited lines. |
| Legal | Paralegals | Find a clause and where it sits | A paralegal asks about termination and gets the lines to open. |
| Publishing | Editors | Check a fact in a manuscript | An editor asks where a date appears and follows the citation. |
| Support | Support teams | Answer from a manual and show the source | An 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\`

### How to set it up

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

| Need | Detail |
| --- | --- |
| n8n | On n8n Cloud or on a server of your own |
| OpenAI | An API key |
| Google | An account that can open your PDF, linked through n8n’s Google sign-in |
| Pinecone | An 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 change | Where |
| --- | --- |
| 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\` |
| The look of a citation | The expression in \`Compose citations\` |
| The model | \`OpenAI 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

| Node | What it does | What to know |
| --- | --- | --- |
| \`Get top chunks matching query\` | Finds the closest pieces in Pinecone | It embeds the question with \`Embeddings OpenAI2\` |
| \`Prepare chunks\` | Numbers the pieces from 0 and joins them into one block | The model cites those numbers |
| \`Answer the query based on chunks\` | Asks the model for an answer and the numbers it used | The parser forces that shape |
| \`Compose citations\` | Turns each number into a file name and a line range | Mindket’s copy fixes the lookup and skips a number with no piece |
| \`Generate response\` | Joins the answer and the citations | The text goes back to the chat |
| \`Add to Pinecone vector store\` | Stores the pieces with the file name and link | It 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

```markdown
# 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.
```

## What is in it

3 files, 21 KB, downloaded as a zip.

```text
NOTICE.md  638 B
README.md  6 KB
workflow.json  15 KB
```

## Workflow check

Checked by Mindket on 13 Nov 2026. Read from the workflow’s file, not from a run.

- 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

## Get it

- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/c882f517-28ca-4d78-86d5-205d67fe670a)
- [Its page on Mindket](https://mindket.com/p/c882f517-28ca-4d78-86d5-205d67fe670a)
