Skip to main content

Pdf RAG agent with Telegram chat & auto-ingestion from Google Drive

Workflow preview

Workflow preview
100%
Pdf RAG agent with Telegram chat & auto-ingestion from Google Drive preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

How it works This workflow creates an intelligent document assistant called "Mookie" that can answer questions based on your uploaded documents. Here's how it operates: Document Ingestion: The syst...

Best for

  • Internal Wiki automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.documentdefaultdataloader, @n8n/n8n-nodes-langchain.lmchatazureopenai, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.httprequest, @n8n/n8n-nodes-langchain.embeddingsmistralcloud, @n8n/n8n-nodes-langchain.vectorstorepgvector, n8n-nodes-base.splitinbatches, n8n-nodes-base.googledrive

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Meelioo.

Original n8n.io source

1.1 Workflow description

Title
Pdf RAG agent with Telegram chat & auto-ingestion from Google Drive
Workflow name
Pdf RAG agent with Telegram chat & auto-ingestion from Google Drive

How it works

This workflow creates an intelligent document assistant called "Mookie" that can answer questions based on your uploaded documents. Here's how it operates:

  • Document Ingestion: The system can automatically load PDF files from Google Drive or accept PDFs uploaded directly through Telegram, then processes and stores them in a PostgreSQL vector database using Mistral embeddings
  • Smart Retrieval: When users ask questions via Telegram or a web chat interface, the AI agent searches through the stored documents to find relevant information using vector similarity matching
  • Contextual Responses: Using GPT-4 and the retrieved document context, Mookie provides accurate answers based solely on the ingested documents, avoiding hallucination by refusing to answer questions not covered in the stored materials
  • Memory & Conversation: The system maintains conversation history for each user, allowing for natural follow-up questions and contextual discussions

Set up steps

Estimated setup time: 30-45 minutes You'll need to configure several external services and credentials:

  • Set up a PostgreSQL database with PGVector extension for document storage
  • Create accounts and API keys for Azure OpenAI (GPT-4), Mistral Cloud (embeddings), and Google Drive access
    • Connect your own LLM's if you don't have these credentials.
  • Configure a Telegram bot and obtain API credentials for chat functionality
  • Update webhook URLs throughout the workflow to match your n8n instance
  • Test the document ingestion pipeline with sample PDFs
  • Verify the chat interfaces (both Telegram and web) are responding correctly

>The workflow includes approval mechanisms for PDF ingestion and handles both automated bulk processing from Google Drive and real-time document uploads through Telegram. Read the sticky notes provided in the template code for clear instructions.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Default Data Loader

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1.1

Block 2 - Azure OpenAI Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatAzureOpenAi - lmChatAzureOpenAi
Config choices
Version 1

Block 3 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 4 - Send PDF File

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 5 - Embeddings Mistral Cloud

Type / Role
@n8n/n8n-nodes-langchain.embeddingsMistralCloud - embeddingsMistralCloud
Config choices
Version 1

Block 6 - Postgres PGVector Store

Type / Role
@n8n/n8n-nodes-langchain.vectorStorePGVector - vectorStorePGVector
Config choices
Version 1.3

Block 7 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 8 - List All File Names

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 9 - Download Corresponding File

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 10 - Run Ingestion

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 11 - PDF Ingest Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 1

Block 12 - Token Splitter

Type / Role
@n8n/n8n-nodes-langchain.textSplitterTokenSplitter - textSplitterTokenSplitter
Config choices
Version 1

Block 13 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Postgres PGVector Store2

Type / Role
@n8n/n8n-nodes-langchain.vectorStorePGVector - vectorStorePGVector
Config choices
Version 1.3

Block 16 - Embeddings Mistral Cloud2

Type / Role
@n8n/n8n-nodes-langchain.embeddingsMistralCloud - embeddingsMistralCloud
Config choices
Version 1

Block 17 - Telegram Trigger

Type / Role
n8n-nodes-base.telegramTrigger - telegramTrigger
Config choices
Version 1.2

Block 18 - Azure OpenAI Chat Model3

Type / Role
@n8n/n8n-nodes-langchain.lmChatAzureOpenAi - lmChatAzureOpenAi
Config choices
Version 1

Block 19 - AI Agent2

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 20 - Postgres PGVector Store3

Type / Role
@n8n/n8n-nodes-langchain.vectorStorePGVector - vectorStorePGVector
Config choices
Version 1.3

Block 21 - Embeddings Mistral Cloud3

Type / Role
@n8n/n8n-nodes-langchain.embeddingsMistralCloud - embeddingsMistralCloud
Config choices
Version 1

Block 22 - Send a Text Message

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 23 - Simple Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 24 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Showing the first 24 of 38 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Pdf RAG agent with Telegram chat & auto-ingestion from Google Drive
Complexity advanced
Nodes 38
Categories Internal Wiki, AI RAG
Author Meelioo
Published 23 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8860/8860.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Pdf RAG agent with Telegram chat & auto-ingestion from Google Drive do?

How it works This workflow creates an intelligent document assistant called "Mookie" that can answer questions based on your uploaded documents. Here's how it operates: Document Ingestion: The syst...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Internal Wiki, AI RAG use case.