Create a RAG-powered Telegram bot with Lookio in n8n

Workflow automation
Open Template

Instantly turn your internal documents into an interactive Telegram assistant. This n8n workflow template provides the fastest way to deploy a Retrieval-Augmented Generation (RAG) chatbot that answers questions with information sourced directly from your private knowledge base, powered by Lookio.

The bot handles both text and voice messages, includes a privacy filter for secure testing, and uses a sophisticated AI agent to deliver accurate, concise replies. It’s the perfect solution for making your team’s knowledge accessible anywhere, anytime.

Key features of the Lookio-powered Telegram bot

This n8n template is designed to provide a production-ready RAG chatbot with minimal setup, leveraging the power of your Lookio assistants.

  • Grounded, accurate answers: By using Lookio as its core tool, the bot’s responses are grounded in your trusted documents, not generic web knowledge. This minimizes AI hallucinations and ensures factual reliability.
  • Voice and text support: The workflow transparently accepts Telegram voice messages, transcribes them using a service like Mistral, and processes the request just like typed text.
  • Secure and controllable: A pre-configured switch lets you restrict bot access to a specific Telegram username for safe internal testing. Remove the filter to make the bot publicly available.
  • Simple agent architecture: The template uses a modern AI agent that intelligently decides when to call on your Lookio assistant, separating its reasoning capabilities from knowledge retrieval for more efficient and accurate responses.

Common use cases for a knowledge base bot

Deploying this workflow can solve critical information-access challenges for various teams.

  • Internal teams & knowledge workers: Provide a self-serve assistant on Telegram for quick lookups of company processes, technical documentation, or project guidelines.
  • Support and operations: Give your team on-demand answers from your internal knowledge base without needing to search through entire documents or wikis.
  • Developers and automation engineers: Use this template as a powerful starting point for integrating advanced agents, transcription services, and Lookio’s RAG API into your n8n projects.

How the n8n workflow functions

The workflow automates the entire process from receiving a message to sending a knowledge-backed reply.

  1. Trigger and route: The workflow activates when a new message (text or voice) is received on Telegram. A router detects the message type.
  2. Transcribe: If the message is a voice note, it’s sent to a transcription service (Mistral by default) and converted to text.
  3. Agent and tool: The user’s query is passed to an AI agent. The agent is instructed to use its Lookio tool to find answers within your knowledge base.
  4. Respond: The agent formulates a final answer based on the information retrieved from Lookio and sends it back to the user on Telegram.

Setup guide and requirements

You can get your AI-powered Telegram bot running in just a few minutes.

  • You’ll need:
    • A Telegram Bot token.
    • A Lookio account to create your assistant and get your API Key. You can sign up for free at /.
    • An LLM provider account (like OpenAI).
    • A transcription provider account (like Mistral) for voice support.
  • Quick setup:
    1. Add your API keys and credentials to the designated Telegram, Lookio, LLM, and transcription nodes within the n8n workflow.
    2. (Optional) Set your personal Telegram username in the If node to restrict access during testing.
    3. Activate the workflow and start a conversation with your bot.

Taking your Telegram bot to the next level

This template is a powerful foundation. You can easily extend its functionality:

  • Add source links: Modify the agent to include citations or direct links to the source documents retrieved by Lookio.
  • Use rich replies: Send Telegram media like images, files, or inline keyboards for more interactive conversations.
  • Create a multi-user access list: Replace the single-user filter with a dynamic lookup from an Airtable base or Google Sheet to manage access for your entire team.
  • Log and analyze conversations: Connect the workflow to a database or spreadsheet to log queries and agent responses for monitoring, quality checks, and continuous improvement.

More templates

Interactive Employee Handbook and HR Support Bot

Assistant prompt

Automated Legal Contract Review and Clause Extraction

Assistant prompt

n8n template to run bulk RAG queries from CSV with Lookio

Workflow automation

100 welcome credits - no credit card required

Ready to unlock your company's knowledge?