π Pdf RAG agent with Telegram chat & auto-ingestion from Google Drive
β‘ 1,076 views Β· π Internal Wiki & Knowledge Base
Description
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.
π Nodes Used
HTTP Request, Webhook, Telegram, Telegram Trigger, Google Drive, AI Agent
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File