Mindket

Telegram bot that answers questions from a PDF in Pinecone

Newversion 1 · updated

Overview

An n8n workflow with two jobs on one Telegram bot. A PDF that you send is cut into pieces and stored in Pinecone, and a question that you send is answered from those pieces by a model on Groq.

Telegram bot that answers questions from a PDF in 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 into a new workflow there
  • Your own n8n server: the same file and steps, once the server has a public HTTPS address
  • Another model: swap Groq Chat Model for any other chat model node of n8n
  • Another store: swap the two Pinecone nodes for another vector store node, and keep the same embeddings model in both

Platform

Connects 4 apps

How it works

Trigger

A Telegram message

It starts each time someone sends a message to your bot, and there is no form:

  • A PDF file, to store it
  • Or a text question, to get an answer

Actions

  1. A message with a file is downloaded from Telegram and marked as a PDF
  2. The text is cut into pieces of 3000 characters, turned into numbers with OpenAI and stored in a Pinecone index
  3. The bot tells the sender how many pages were saved
  4. A text message is turned into numbers, and the closest stored pieces are fetched from Pinecone
  5. A model on Groq writes the answer from those pieces, and it is sent back to the chat

Result

A page count after a file, or an answer built from your stored PDFs after a question

Integrations

What you need before you start.

Telegram

Chat app

Delivers each message and file to the workflow and sends the replies.

NeedsA bot token from BotFather, as a Telegram credential

Pinecone

Vector store

Keeps the pieces of your PDFs and finds the ones that fit a question.

NeedsA Pinecone API key and an index with 1536 dimensions

OpenAI

Embeddings

Turns the pieces and the questions into numbers.

NeedsAn OpenAI API key and some credit

Groq

AI model

Writes the answers from the pieces that fit.

NeedsA Groq API key

Workflow check

Checked by Mindket on 13 Nov 2026

Steps
11 steps, starting on a Telegram event
AI
2 steps call an AI model: Pinecone Vector Store and Question and Answer Chain
Sign-ins
Signs in to: Telegram, Pinecone, OpenAI and Groq
API keys
No API key is left in the file
Step types
Mindket’s checker reads all 8 of its step types

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

About

What it is

This n8n workflow turns a Telegram bot into a reader of your PDFs. When a message holds a file, the workflow downloads it, cuts the text into pieces, turns each piece into numbers with OpenAI and stores them in a Pinecone index. When a message is a question, it finds the stored pieces that fit and a model on Groq writes the answer from them. Eighteen nodes do the work, beside two sticky notes.

Who it suits

Students, researchers and small teams who want to ask questions of a manual, a contract or a paper from their phone. You need accounts at Pinecone, OpenAI and Groq. Skip it if your files are not PDFs with real text, because scanned pictures give it nothing to store.

Who uses it, and how
IndustryWho uses itHow they use itExample
EducationStudentsAsk a question of a paper or a set of lecture notesA student sends a reading list as a PDF and asks which chapter covers sampling.
LegalSmall firmsFind a clause in a long contractAn assistant asks how long the notice period is, and the bot answers from the contract.
OperationsOffice teamsLook things up in a policy or a manualA new hire asks how many leave days they get and reads the answer in the chat.
ResearchAnalystsPull a figure out of a reportAn analyst sends a market report and asks for the growth rate that it states.

You need some n8n: import a file, add five credentials, make an index in Pinecone and fill in one name.

Where to use it

Any n8n with a public HTTPS address can run it, because Telegram sends each message to that address.

  • n8n Cloud: import the file into a new workflow there
  • Your own n8n server: the same file and steps, once the server has a public HTTPS address
  • Another model: swap Groq Chat Model for any other chat model node of n8n
  • Another store: swap the two Pinecone nodes for another vector store node, and keep the same embeddings model in both

Setup

Download saves a zip with workflow.json and Mindket’s setup notes in your downloads folder. You need a Telegram bot token, a Pinecone index and keys for OpenAI and Groq.

What you need first
NeedDetail
n8nOn n8n Cloud or on a server with a public HTTPS address
TelegramA bot and its token, which you get from BotFather inside Telegram
PineconeAn index with 1536 dimensions and the cosine metric, and an API key
OpenAIAn API key for the embeddings, with some credit
GroqAn API key for the answers
  1. In n8n, create a workflow, open its menu, choose Import from File and pick workflow.json.
  2. In Pinecone Vector Store and Pinecone Vector Store1, replace YOUR_PINECONE_INDEX with the name of your index and add a Pinecone credential.
  3. In Embeddings OpenAI and Embeddings, add an OpenAI credential. Keep the same model in both.
  4. In Groq Chat Model, add a Groq credential.
  5. In the four Telegram nodes, add a Telegram credential with your bot token.
  6. Press Test workflow and send a small PDF to your bot. The bot answers with the number of pages that it saved.
  7. Press Test workflow again and send a question about that PDF. The answer arrives in the same chat.
  8. Turn the workflow on, so that the bot keeps answering when you are away.

How to use it

Once the workflow is on, it answers by itself. A message with a file adds that file to the index and gets a page count back. A text message gets an answer made from everything stored so far.

What to change for a different result
To changeWhere
The modelThe model name in Groq Chat Model
The size of the piecesChunk Size and Chunk Overlap in Recursive Character Text Splitter
How many pieces the model seesThe limit in Vector Store Retriever
The question textThe text in Question and Answer Chain
Who may use the botRestrict to User IDs in Telegram Trigger

Example

A student studies for an exam in statistics.

The student sends the course notes as a PDF and the bot answers “42 pages saved”. Later the student asks “What does the course say about the central limit theorem?”. The workflow finds the pieces that fit and the model answers from them in a few sentences. If the notes do not hold the answer, the model should say so. Check the answers against the file before you rely on them, because they come from a model.

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 such as Pinecone keeps pieces of text as lists of numbers, so that a question can find the pieces with the closest meaning. This workflow stores your PDFs there and then answers from them. Press Test workflow and send a small PDF first.

For experts. The file path and the question path share one index without a namespace, so every file ends up in one pool.

Where to look closer
NodeWhat it doesWhat to know
Check If is a documentTests whether the message has a documentAnything else goes to the question path
Change to application/pdfMarks the downloaded file as a PDFThe loader picks its reader from the type, so every file is read as a PDF
Pinecone Vector StoreInserts the piecesClear Namespace is off, so a repeated file is stored twice
Embeddings OpenAI and EmbeddingsTurn text into numbersBoth name text-embedding-3-small, and the index holds 1536 numbers for each piece
Vector Store RetrieverFetches the closest piecesIt keeps its default of four
Question and Answer ChainGives the pieces and the question to the modelThe prompt adds a line that tells it to use the retriever
Groq Chat ModelWrites the answerIt names openai/gpt-oss-120b

Good to know

The original copy named a model that Groq no longer lists, and it left the embeddings model to a version default.

  • Model: the original copy asked for llama-3.1-70b-versatile. Groq’s models page, read on 12 November 2026, lists openai/gpt-oss-120b as a production model and does not list that name, so this copy uses openai/gpt-oss-120b
  • Embeddings: the original copy was on node version 1, where an unset model means text-embedding-ada-002. This copy is on version 1.2 and names text-embedding-3-small. The two models give different vectors, so fill a new index
  • Index: the original copy pointed at its author’s index, and this copy names YOUR_PINECONE_INDEX
  • One pool: the index has no namespace, so anyone who can write to the bot can ask about any file that anyone sent. Restrict to User IDs in Telegram Trigger limits it, and works on node version 1.2 and later
  • Repeats: sending the same PDF twice stores its pieces twice
  • Size: Telegram lets a bot download files up to 20 MB
  • PDF only: the code marks every file as a PDF, so a Word file fails, and a scanned PDF has no text to store
  • Your data: the text of every PDF goes to OpenAI and to your Pinecone index, and each question with its pieces goes to Groq
  • Not run: Mindket did not call any of the services to test this file. It ran in a test runner with stand-in answers, with a text file in place of a PDF, so the page count was not tried
  • Credentials: the JSON holds none

README and files

README

Telegram bot that answers questions from a PDF in Pinecone

An n8n workflow with two jobs on one Telegram bot. Send the bot a PDF, and it cuts the text into pieces and stores them in a
Pinecone index. Send it a question, and it finds the pieces that fit, hands them to a model on Groq and sends back the answer.

What is inside

  • workflow.json: the workflow as n8n exports it, 18 nodes and two sticky notes. It holds no credential.
  • README.md: these notes.

What we changed from the original copy

  • Groq Chat Model asked for llama-3.1-70b-versatile. Groq's models page, read on 12 November 2026, lists
    openai/gpt-oss-120b as a production model and does not list that name, so this copy uses openai/gpt-oss-120b.
  • Both embeddings nodes left the model unset on node version 1, which means text-embedding-ada-002. They are now on
    version 1.2 and name text-embedding-3-small. Both vectors have 1536 numbers, but the two models give different
    vectors, so fill a new index and do not reuse one that the original copy filled.
  • Both Pinecone nodes pointed at an index named telegram, which was the author's. They now name YOUR_PINECONE_INDEX, and the node that
    searches has its mode set to retrieve on purpose.
  • Telegram Trigger is now on node version 1.2, which can limit who may use the bot. See Good to know.
  • The comments in Change to application/pdf were in Portuguese. They are in English now, and the code does the same work.
  • The two sticky notes are rewritten in plain words. The time zone and the caller policy of the author's n8n are removed from
    the settings.
  • Every credential reference is removed, so you pick your own.

Before you start

  • An n8n instance with a public HTTPS address. Telegram delivers updates by an HTTPS POST to the webhook address.
  • A Telegram bot and its token. You make one by chatting with BotFather inside Telegram.
  • A Pinecone account and an index with 1536 dimensions. Pinecone's guide says to set the dimension and the metric to match your
    embedding model, and OpenAI's guide gives 1536 for text-embedding-3-small. Pick the cosine metric.
  • An OpenAI API key for the embeddings, and a Groq API key for the answers.

Set it up

  1. In n8n, create a workflow, open its menu and choose Import from File. Pick workflow.json.
  2. In Pinecone Vector Store and in Pinecone Vector Store1, replace YOUR_PINECONE_INDEX with the name of your index and
    add a Pinecone credential with your API key.
  3. In Embeddings OpenAI and in Embeddings, add an OpenAI credential with your API key. Keep the same model in both.
  4. In Groq Chat Model, add a Groq credential with your API key.
  5. In Telegram Trigger, Telegram get File, Telegram Response and Telegram Response about Database, add a Telegram
    credential with your bot token.
  6. Press Test workflow and send a small PDF to your bot. The bot answers with the number of pages that it saved.
  7. Press Test workflow again and send a question about that PDF. The answer arrives in the same chat.
  8. Turn the workflow on, so that the bot keeps answering when you are away.

How a run goes

  1. Telegram Trigger starts the run when someone sends a message to your bot.
  2. Check If is a document looks for a file in the message. A file goes the upper way, and anything else goes to the question path.
  3. File path: Telegram get File downloads the file, and Change to application/pdf marks it as a PDF.
  4. Pinecone Vector Store inserts it. Default Data Loader reads the PDF, Recursive Character Text Splitter cuts it into
    pieces of 3000 characters with 200 characters of overlap, and Embeddings OpenAI turns each piece into numbers.
  5. Limit to 1 keeps one item, and Telegram Response about Database tells the sender how many pages were saved.
  6. Question path: Question and Answer Chain takes the text of the message. Vector Store Retriever asks
    Pinecone Vector Store1 for the closest pieces, with Embeddings turning the question into numbers.
  7. Groq Chat Model writes the answer from those pieces, and Telegram Response sends it to the chat.
  8. A failed send goes to a Stop and Error node, so the run shows as failed in n8n.

Change the look

  • The model: the model name in Groq Chat Model.
  • The size of the pieces: Chunk Size and Chunk Overlap in Recursive Character Text Splitter.
  • How many pieces the model sees: the limit in Vector Store Retriever, which keeps its default of four.
  • The wording of the question: the text in Question and Answer Chain.
  • Who may use the bot: see the first item under Good to know.

Good to know

  • Every PDF goes into one pool. The index has no namespace, so anyone who can write to the bot can ask about any file that
    anyone sent. To limit it, open Telegram Trigger, add the field Restrict to User IDs under Additional Fields and list the
    Telegram user numbers that may use it. It is enforced on node version 1.2 and later.
  • Sending the same PDF twice stores its pieces twice. The option Clear Namespace is off, and it only works when you name a
    namespace.
  • Telegram lets a bot download files up to 20 MB, so a larger PDF fails at Telegram get File.
  • The code marks every file as a PDF, so a Word file or a picture fails. A PDF made of scanned pictures has no text to store.
  • A message that is neither a file nor text, such as a photo, stops at the chain with an empty text error.
  • openai/gpt-oss-120b is a reasoning model, so an answer can take a little longer than with a plain chat model.
  • Replies go out in Telegram's Markdown mode, which is the n8n default. A lone _ or * in an answer can make Telegram
    refuse the message.
  • Your data: the text of every PDF goes to OpenAI for the embeddings and is stored in your Pinecone index. Each question and
    the pieces that fit it go to Groq.
  • Not run: we did not call any of the services to test this file. We ran it in a test runner with stand-in answers. The
    question path ran from the message to the reply. The file path ran with a text file in place of a PDF, because the
    runner cannot read PDFs, so the page count in the last message was not tried.
  • Credentials: the JSON holds none.
Files
NOTICE.md  555 B
README.md  6 KB
workflow.json  12 KB

3 files, 19 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

Huashu Design

alchaincyf · Skill

Turns a one-line request in your AI agent into a finished design: a launch animation, a clickable app prototype, an editable slide deck, an infographic or a se…

New29.4k

Guizang PPT Skill

op7418 · Skill

Skill that makes single-file HTML slide decks, slide illustrations and platform covers in two visual styles, with a presenter mode for rehearsal. For speakers…

New29.8k

Claude Code Skills & Plugins

alirezarezvani · Skill

Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…

New29.8k

Similar in Research

See all in Research

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

ReFoCo

yuji-nozawa · Kit

Pretrained vision transformer checkpoints in three sizes from a research paper on training attention heads to focus on image regions. For researchers who extra…

New