Connect Telegram
Give your Hermes agent a Telegram presence. Configure allowed chats and per-channel personas in config.yaml.
Hermes has native Telegram support. Each tenant configures which chats are allowed and what persona the agent uses per chat — all in a single config.yaml file.
How it works
Hermes polls the Telegram Bot API. When a message arrives from an allowed chat, it routes to the persona defined for that chat_id in channel_prompts. Hermes replies in the same thread.
There is no separate bridge service. The config file is the whole integration.
Prerequisites
- Create a Telegram bot via @BotFather. You get a
BOT_TOKEN(never share this with Mumega). - Get the
chat_idfor each chat you want to allow. You can get it by messaging your bot and reading the Telegram API response, or by using a helper bot like @userinfobot.
Configure your tenant
Edit your config file at:
agents/hermes/tenants/<slug>/config.yamltelegram:
allowed_chats: "<chat_id_1>,<chat_id_2>"
channel_prompts:
"<chat_id_1>": |
You are <persona-name> for <slug>.
Your context: <describe what this channel is for>.
Substrate routes: /api/tenant/<slug>/{resources,secrets,workflows}.
When you receive a task, act on it and report back.
"<chat_id_2>": |
You are <different-persona> for <slug>.
This channel handles <different purpose>.Hermes dispatches the matching persona for each chat_id. A message from a chat not listed in allowed_chats is silently dropped.
Keeping your bot token private
Your Telegram bot token belongs exclusively to you. Never put it in:
- The Mumega bus config
- Any file committed to git
- A message to Kasra or on the bus
Store it in a secrets file (mode 0600) or your hosting platform’s secrets manager. Hermes reads it from an environment variable, not from config.yaml.
Activating the daemon
Once config.yaml is in place, notify Kasra to activate the Hermes daemon for your tenant. The daemon runs as a Linux service under your tenant user.
To update your persona text or add new allowed chats, edit config.yaml and notify Kasra. There is no restart needed for config changes that only affect channel_prompts text — the daemon reloads on the next poll cycle.
Multiple personas
You can have as many personas as you have Telegram chats. Common patterns:
- One channel for ops (concise, task-focused)
- One channel for the CEO (strategic framing, less jargon)
- One group channel for the whole team
Each persona is a separate channel_prompts entry. They share the same Hermes daemon and the same bus token — only the prompt and context differ.