๐Ÿ’ฌ Telegram AI chatbot with document-based answers using OpenAI and PGVector RAG

โšก 1,011 views ยท ๐Ÿ’ฌ Support Chatbots

Description

๐Ÿค– AI Q&A Chatbot Workflow โ€“ Build Your Own AI Agent Trained on Private Documents

This powerful AI automation add-on upgrades your Telegram Bot Starter Template by integrating a fully functional AI chatbot and a context-aware AI agent that answers user questions using your internal documents.

Unlike generic bots, this chatbot uses your own data to respond with deeply personalized, context-relevant information โ€” perfect for support, onboarding, internal knowledge access, and client-facing interactions.

It connects to any PostgreSQL database โ€” including Neon.tech, Supabase, or a self-hosted Postgres setup โ€” allowing you to build custom AI-powered FAQ assistants, internal support bots, or knowledge-based customer service tools.


๐Ÿง  Why It Works: Contextual Retrieval

The secret is Contextual Retrieval โ€” a powerful technique where your documents are stored in a way that preserves meaning and context. This allows the AI to fetch highly relevant, source-backed responses, eliminating hallucinations and guesswork.

> Data is embedded, chunked, and saved in a vector database (Postgres + PGVector), enabling smart semantic search tailored to your needs.

๐Ÿ“– Learn more about this approach in this article by Anthropic โ†’


โœจ Key Features


๐Ÿ‘ค Who Can Use This Workflow?


โš™๏ธ Setup Instructions

Youโ€™ll find step-by-step instructions inside the workflow.

Quick Setup Overview:

  1. Import the workflow into n8n (cloud or self-hosted)
  2. Add your Telegram Bot credentials
  3. Connect your PostgreSQL DB (Neon, Supabase, etc.)
  4. Set up document ingestion from Google Drive
  5. Activate the workflow and start chatting

๐Ÿงฉ Extensibility

This workflow is modular and ready to expand. Build powerful assistants by connecting additional workflows:


๐Ÿง  More Smart AI Agents

Explore more AI workflows and agents on my Gumroad โ†’

๐Ÿ“จ Submit your idea here for a custom AI agent โ†’

๐Ÿ”— Nodes Used

Postgres, Google Drive, Google Drive Trigger, Execute Workflow Trigger, AI Agent, Basic LLM Chain

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup