๐Ÿ’ฌ Create a voice & text Telegram assistant with Lookio RAG and GPT-4.1

โšก 287 views ยท ๐Ÿ’ฌ Support Chatbots

Description

Create a Telegram bot that answers questions using Retrieval-Augmented Generation (RAG) powered by Lookio and an LLM agent (GPT-4.1).

This template handles both text and voice messages (voice transcribed via a Mistral model by default), routes queries through an agent that can call a Lookio tool to fetch knowledge from your uploaded documents, and returns concise, Telegram-friendly replies. A security switch lets you restrict use to a single Telegram username for private testing, or remove the filter to make the bot public.

Who is this for?

What it does / What problem does this solve?

How it works

  1. Trigger: Telegram Trigger receives incoming messages (text or voice).
  2. Route: Message Router detects voice vs text. Voice files are fetched with Get Audio File.
  3. Transcribe: Mistral transcribe receives the audio file and returns a transcript; the transcript or text is normalized into preset_user_message and consolidated in Consolidate user message.
  4. Agent: AI Agent (GPT-4.1-mini configured) runs with a system prompt that instructs it to call the Query knowledge base tool when domain knowledge is required.
  5. Respond: The agent output is sent back to the user via Telegram answer.

How to set up

  1. Create a Lookio assistant: Sign up to Lookio, the API-first RAG platform, upload documents, and create an assistant.
  2. Add credentials in n8n: Configure Telegram API, OpenAI (or your LLM provider), and Mistral Cloud credentials in n8n.
  3. Configure Lookio tool: In the Query knowledge base node, replace <your-lookio-api-key> and <your-assistant-id> placeholders with your Lookio API Key and Assistant ID.
  4. Set Telegram privacy (optional): Edit the Myself? If node and replace <Replace with your Telegram username> with your username to restrict access. Remove the node to allow public use.
  5. Adjust transcription (optional): Swap the Mistral transcribe HTTP node for another provider (OpenAI, Whisper, etc.) and update its prompt to include your jargon list.
  6. Connect LLM: In OpenAI Chat Model node, add your OpenAI API key (or configure another LLM node) and ensure the AI Agent node references this model.
  7. Activate workflow: Activate the workflow and test by messaging your bot in Telegram.

Requirements

How to take it further

๐Ÿ”— Nodes Used

HTTP Request, Telegram, Telegram Trigger, AI Agent, OpenAI Chat Model, Simple Memory

๐Ÿ“ฅ Import

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

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