How to Connect Hermes Agent to Telegram and Manage Tasks from Your Phone
MarkdownStep-by-step setup: create a bot through BotFather, add the token and access list in Hermes Agent, and start the gateway. Voice messages, scheduled tasks, and phone control.
Read full article
You can message Hermes Agent or dictate tasks to it in Telegram from your phone when you’re away from your computer, and receive the result in the same chat. Scheduled task results arrive in the chat you designate as your home chat once.
If you don’t have Hermes yet, start with the guide on what this agent is and how to install it, then come back to connect Telegram.
Additional instructions are available in the Ailoot documentation.
What do you need to connect Hermes Agent to Telegram?
Key points
You need Hermes Agent installed with a model connected, and a Telegram account. Creating a bot in Telegram is free, and Hermes is an open-source project. Separate costs may apply to the model, cloud speech recognition, and a server if you decide to keep the bot running around the clock.
The hermes doctor command checks your Hermes installation and model connection. We’ll create the bot in the Telegram app, and you’ll need a computer to run commands in the terminal.
How do you create a bot through BotFather?
Key points
Open @BotFather in Telegram, send /newbot, choose a display name and a unique username that ends in bot. BotFather will reply with a token in the form 123456789:ABCdef... — this is the key to your bot. Save it and don’t show it to anyone.
Every Telegram bot has a token — a secret key for controlling the bot. It is issued by Telegram’s official bot, @BotFather.
Open @BotFather
Search for
@BotFatherin Telegram or open t.me/BotFather. The real BotFather has a blue verification checkmark. Start the conversation by tapping “Start.”Send the /newbot command
BotFather will ask for two names. The first is the display name; it can be anything, for example, “My Agent.” The second is the username: it must be unique and end in
bot, for example,moy_agent_bot.Get the token
BotFather will send a congratulatory message and a long string in the form
123456789:ABCdefGHIjklMNOpqrSTUvwxYZ. This is the bot token. Copy the entire string.
Attention
The token gives full control over the bot: whoever knows the token controls it. If the token leaks, revoke it immediately with the /revoke command in your conversation with BotFather and get a new one.
There’s also a quick way that doesn’t require a manual conversation with BotFather. In the Hermes web dashboard (hermes dashboard) and in the desktop app, on the “Messaging → Telegram” page, there’s a “Create with QR” button: scan the code with your phone, and Hermes creates a bot, detects your ID, saves the token in the settings, and restarts the gateway. The steps below cover the manual method; if you chose QR, go straight to checking the connection.
How do you find your Telegram ID, and why do you need it?
Key points
Find your numeric ID in the form 123456789. This is your account number; a username with an @ sign won’t work for the access list. Hermes uses the ID for the access list: without this list, the gateway won’t reply to anyone, including you.
A Telegram account has two identifiers: a public username with an @ sign and an internal numeric ID. Hermes uses the number.
The quick “Create with QR” method described above detects your ID automatically. Write it down next to your token.
How do you give the token to Hermes Agent and start the gateway?
Key points
Run the setup wizard with hermes gateway setup and select Telegram: it will ask for your token and ID, then save everything. The manual method uses two lines in the ~/.hermes/.env file. After that, start the gateway with hermes gateway, and the bot will be up in a few seconds.
| Setup wizard | Manually | |
|---|---|---|
| What you run | hermes gateway setup | An editor with the ~/.hermes/.env file |
| What you enter | Token and ID in response to the wizard’s prompts | Two variables by hand |
| Where it’s stored | The wizard saves it in the settings itself | The settings are entered directly in .env |
| Who it’s for | Everyone; recommended method | Those used to configs or setting up with a script |
Run the setup wizard
hermes gateway setupRun the command on the machine where Hermes is installed. The wizard will offer a list of messaging apps.
Select Telegram and enter your details
The wizard will ask for the bot token and the allowed IDs (you can enter several, separated by commas) and save everything in the settings itself.
Start the gateway
hermes gatewayThe gateway will start and connect to Telegram. After a few seconds, send your bot any message from the app: if Hermes replies, the connection is ready.
The manual method instead of using the wizard looks like this: open the ~/.hermes/.env file and add two lines, substituting the token from BotFather and your numeric ID:
TELEGRAM_BOT_TOKEN=123456789:ABCdefGHIjklMNOpqrSTUvwxYZ
TELEGRAM_ALLOWED_USERS=123456789
The second line authorizes those people in private chats and groups; separate group-chat authorization can also grant access. Separate multiple people with commas. After saving the file, start the gateway with the same hermes gateway command.
If the bot stays silent even in a private chat, check the gateway logs in the same terminal and first verify the token and your ID in the access list; other errors are covered in the table at the end of the article.
What can the Telegram bot do on your phone?
Key points
The Telegram bot reads text and voice messages, accepts files and pictures, asks for permission before dangerous commands right in the chat, and shows model choices as buttons. By default, notifications have a sound only for final responses, confirmation requests, and command confirmations.
There are five capabilities you’ll most often need on your phone.
Text and voice messages. Write a task in words or dictate a voice message — with speech recognition configured, Hermes will transcribe it and understand it. With a local provider, no keys are needed; everything is processed on the machine where the agent runs.
Files and pictures. You can forward a document, spreadsheet, or screenshot to the bot — the agent will receive it as an attachment. It can also send generated files back: ask for a report, and it will send it as a file in the chat.
Confirmations for dangerous actions. When the agent is about to do something risky, such as delete files, it first asks in the chat: reply “yes” or “y” and it does it; reply “no” or “n” and it cancels.
Buttons instead of typing back. When the agent needs clarification, it sends a question with inline option buttons — tap an option, and the agent continues working. The /model command without arguments shows a model selection menu with the same kind of buttons.
Quiet notifications. By default, your phone rings only for final responses, confirmation requests, and command confirmations. Service notifications such as “calling a tool” and “compressing context” arrive silently, so your phone doesn’t ring at every step. If you want sound notifications at every step, switch the mode in the settings.
How do you get background task results in the chat?
Key points
Scheduled tasks send their results to the home chat: open the conversation with the bot and send the /sethome command. Background tasks started from a topic return to that same topic. The key requirement is that the gateway must keep running; otherwise, the bot stays silent while the computer is off.
Home chat for scheduled tasks. Hermes supports scheduled tasks: “every morning at 7:43, put together a summary for me.” It sends the results to the home chat, which you designate once by sending the /sethome command directly in the conversation with the bot. As long as the gateway is running, summaries arrive automatically.
Background tasks. You can send a long task to run in the background and get on with your day: the bot will message you when it’s ready. A task started from a topic will return its answer to that same topic, so nothing gets lost.
Important limitation: the bot only replies while the gateway is running. If you turn off the computer running Hermes or put it to sleep, the bot won’t reply until the machine is running again. To keep the bot online all the time, move the agent to a server: we have a separate guide on how to keep Hermes Agent running around the clock. By default, the gateway polls Telegram for new messages; for cloud platforms that go to sleep without incoming traffic, the documentation offers a webhook mode, which reverses the connection direction so Telegram itself sends requests to the bot.
How do you keep strangers out of the bot?
Key points
TELEGRAM_ALLOWED_USERS authorizes listed sender IDs for private chats and groups. Group access can also be granted separately: TELEGRAM_GROUP_ALLOWED_CHATS authorizes every member of each listed group. Keep the token secret; mention filters control when the bot responds, not who has access.
Your bot can be found in Telegram search by its username, so protection relies on two things: the access list and keeping the token secret.
First, configure sender access with TELEGRAM_ALLOWED_USERS. For groups, also inspect TELEGRAM_GROUP_ALLOWED_CHATS: listing a chat there permits any of its members, even when their sender ID is absent from the personal allowlist. An empty personal list alone therefore does not prove that every group is closed.
Second, there’s the token. It must not end up in screenshots, forwarded messages, or repositories. If the token leaks, revoke it with the /revoke command in BotFather. Then enter the new token in the settings and restart the gateway.
A separate note about groups: sender authorization and chat authorization are different. A member of a group permitted through TELEGRAM_GROUP_ALLOWED_CHATS can use the bot even if their ID is not in TELEGRAM_ALLOWED_USERS. If access must remain individual, do not grant the entire group access; configure and verify sender restrictions for your installed version. If you want the bot to respond in a group only when called, there’s a telegram.require_mention setting — then it responds to an @ mention, a reply to its message, a command like /command@yourbot, and matches for your patterns in telegram.mention_patterns, while ignoring ordinary group messages.
Why is the bot silent in a group, and how do you fix it?
Key points
The cause is Telegram’s privacy mode: by default, a bot in a group sees only commands and replies to its own messages. Turn it off with @BotFather: /mybots → Bot Settings → Group Privacy → Turn off. Then you must remove the bot from the group and add it again — Telegram remembers the old setting. Alternatively, make the bot a group admin without disabling privacy mode.
New Telegram bots have privacy mode enabled by default; Hermes documentation describes it as the most common source of confusion with bots in groups. In this mode, the bot receives only messages that start with a / command, replies to its own messages, and service notifications. It simply doesn’t receive ordinary group messages — Telegram doesn’t send them to it, and no agent setting will fix that.
How to fix it:
- Open @BotFather and send
/mybots. - Select your bot.
- Open “Bot Settings” → “Group Privacy” → “Turn off.”
- Remove the bot from the group and add it again.
It’s easy to miss the fourth step, and then the bot “still stays silent.” Telegram remembers the privacy setting from when the bot joined the group, and doesn’t update it until the bot is removed from the group and added again.
If you don’t want to disable privacy globally, there’s a second option: make the bot a group administrator. Admin bots receive all messages in any privacy mode.
Common connection errors and what to do about them
Key points
First check whether the gateway is running and whether the token and ID in the access list are correct. For groups, check privacy mode; for voice recognition, check the STT provider; and for voice replies through Edge TTS, check for ffmpeg.
| Symptom | Cause | What to do |
|---|---|---|
| The bot doesn’t reply at all | Incorrect token or gateway isn’t running | Check the token in .env, restart hermes gateway, and check the logs in the same terminal |
| The bot replies “unauthorized” | Your ID isn’t in the access list | Verify your ID, add it to TELEGRAM_ALLOWED_USERS, and restart the gateway |
| Replies in private chat, silent in a group | Privacy mode | Select “Turn off” with BotFather, then remove the bot from the group and add it again, or make it an admin |
| Voice messages aren’t transcribed | Speech recognition isn’t configured | Local recognition is installed with the faster-whisper package; cloud options require their own key |
| A voice reply through Edge TTS arrives as a file instead of a regular voice message | ffmpeg is missing | Install ffmpeg — Edge TTS needs it to convert to Telegram voice message format |
| The token stopped working | The token was revoked | Get a new one through /revoke and /newbot (or /token) with BotFather, replace the value in .env, and restart the gateway |
What else do people ask about Hermes Agent in Telegram?
Key points
A server isn’t required, but the bot is active only while the gateway is running. Connecting it is free; you only pay for the model. Several people can connect through the ID list. The bot can’t see private chats. Files larger than 20 MB require additional setup.
Frequently asked questions
Do you need a server for the bot to work?
No, to get started, the computer with Hermes installed is enough. Just remember: the bot is active while the gateway is running. Turn off the computer or put it to sleep, and the bot goes silent until the machine is running again. When you want it to run around the clock, move the agent to a server — we have a separate guide about that.
How much does it cost to connect a bot?
Connecting it is free. Telegram doesn’t charge for bots, and Hermes Agent is an open-source project. Separate costs may apply to the model connected to your agent and to a server if you want it to run around the clock.
Can I connect my wife or team to the bot?
Yes. In the TELEGRAM_ALLOWED_USERS list, IDs are separated by commas, and everyone on the list can message the bot privately. And if you allow the chat itself through TELEGRAM_GROUP_ALLOWED_CHATS, any member of that group can use the bot — that’s how the allowed chats list works according to the documentation.
Can the bot see my private conversations?
No. The Bot API gives the bot only messages addressed to it in private chats, while Telegram privacy mode applies in groups, as discussed in the section about groups. The bot has no access to your conversations with other people.
Why did the bot refuse to accept a large voice message?
The public Bot API has a 20 MB file download limit; anything larger is rejected. Hermes documentation describes a workaround using a local Bot API server, which raises the limit to 2 GB. You only need this if you plan to accept files larger than 20 MB; a link to the documentation is in the “Sources” section at the end of the article.
Can I add new capabilities to the bot?
Yes. Hermes has skills and plugins — ready-made capabilities for the agent. How to install a plugin in this kind of AI agent bot is covered separately: how to install a plugin in an AI agent bot on Telegram.
Sources
- Hermes Agent: Telegram setup — the main source, checked on 12.09.2026
- Hermes Agent: messaging gateway
- Hermes Agent: installation
- Hermes Agent: quickstart
- Hermes Agent: scheduled tasks
- BotFather — Telegram’s official bot for creating bots
When you’re ready, get to know Ailoot.
More details
Questions about How to Connect Hermes Agent to Telegram and Manage Tasks from Your Phone
Does a personal allowlist block unlisted people inside an allowed group?
Not when the whole chat is authorized through TELEGRAM_GROUP_ALLOWED_CHATS: any member of that group is authorized. TELEGRAM_ALLOWED_USERS authorizes individual senders; inspect both settings before opening the bot to a group.
Does requiring an @ mention make a group private to selected users?
No. Mention and pattern settings determine which messages trigger a response. They do not undo authorization granted to every member of an allowed chat.