Chat with PDFs on Telegram using Google Gemini and Pinecone
Ready for 3.0What this workflow does
This AI workflow has 18 nodes and runs on Telegram events (message). Along the way it connects Pinecone Vector Store, Telegram, Embeddings Google Gemini and Google Gemini Chat Model.
How it runs
Trigger: On Telegram events (message).
- Verify Document Presence (If): checks a condition and branches into true / false
- Retrieve Telegram File (Telegram): work with file
- QA Chain Processing (Question and Answer Chain): answers questions over your documents (RAG), with model: Utilize Google Gemini Chat; retriever: Retrieve from Vector Store
- Convert Metadata to PDF (Code): runs custom JavaScript code
- Send Telegram Response (Telegram): uses Telegram
- Manage Pinecone Store (Pinecone Vector Store): stores documents in the Pinecone vector store, with embeddings: Generate Google Gemini Embeddings; document loader: Load Default Document Data
- Trigger Error Handling (Stop and Error): stops the run with an error
- Restrict to 10 Items (Limit): keeps the first few items
- Respond via Telegram (Database) (Telegram): uses Telegram
- Handle Database Error (Stop and Error): stops the run with an error
Services it uses
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 (13)
- Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - Stop and Error
n8n-nodes-base.stopAndError - Question and Answer Chain
@n8n/n8n-nodes-langchain.chainRetrievalQa - Vector Store Retriever
@n8n/n8n-nodes-langchain.retrieverVectorStore - Pinecone Vector Store
@n8n/n8n-nodes-langchain.vectorStorePinecone - If
n8n-nodes-base.if - Code
n8n-nodes-base.code - Telegram
n8n-nodes-base.telegram - Limit
n8n-nodes-base.limit - Embeddings Google Gemini
@n8n/n8n-nodes-langchain.embeddingsGoogleGemini - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Telegram Trigger
n8n-nodes-base.telegramTrigger
From the author
Quick overview This workflow lets users upload PDFs or ask questions in Telegram, indexes PDF content in Pinecone using Google Gemini embeddings, and answers follow-up questions with a Google Gemini chat model using retrieval-augmented generation formatted…