Hermes Agent Telegram threads give every Telegram thread or forum topic its own Hermes session, so a "Website" topic and a "Research" topic never share history, context or a running turn.
📺 Watch: Hermes Agent Just Launched Its Official Mobile App!
🔥 Get the Agent OS as a free bonus: AI Profit Boardroom members get the full Agent OS zip, prompt libraries, daily tutorials and weekly live coaching calls. → Get inside
This tutorial covers the four ways Hermes does that: threaded DMs, config-driven DM topics, the user-driven /topic mode and supergroup forum topics. Then it covers filtering topics and running several profiles in one group. Every setting comes from the official Hermes Telegram page.
Haven't connected a bot yet? Make one in BotFather, add the token to Hermes, and follow the Hermes Agent Telegram setup guide first. Everything below assumes the bot already answers you.
Julian Goldie walks through his own agent setups, with step-by-step trainings and four live coaching calls a week, inside the AI Profit Boardroom. If you'd like to plan your topic layout with someone first, book a free AI strategy session.
Why one Telegram chat turns into a mess
By default, a Telegram DM with Hermes is one session. The sessions docs key it on your chat ID alone, so every question you ask piles into the same history.
Ask about a client invoice, then a blog draft, then a server error, and the agent carries all three in one context window.
Topics fix that. Each topic has its own thread ID, and Hermes adds that thread ID to the session key. New topic, new session, clean context.
Step 1: Turn on Threaded Mode in BotFather
DM topics need one switch that most people miss, because it isn't in the old text menu.
- Search for botfather in Telegram and tap Open to load the BotFather Mini App. The classic /mybots menu doesn't show this setting.
- Go to My bots, pick your bot, then Bot Settings and Threads Settings.
- Turn on Threaded Mode. Leave users allowed to create topics.
Skip this and Hermes logs "The chat is not a forum" on startup and creates no topics. There is no Topics toggle inside the DM itself, whatever older guides say.
📺 Watch: Hermes3D Is INSANE: AI Agents Now Have a 3D Office
Step 2: Pick how DM threads should behave
Once Threaded Mode is on, Telegram stamps a thread ID on DM messages, and by default each thread becomes its own session. That is the per_thread setting.
Some clients open a new thread for every question. If your DM keeps splitting into parallel sessions you never asked for, set platforms.telegram.extra.dm_threads to shared in config.yaml.
Shared mode makes the whole DM one session with one history and one turn at a time. Replies still land in the thread each message came from. The v0.23.2 release notes list this as opt-in shared Telegram DM threads.
Step 3: Create fixed workspaces with dm_topics
If you know your lanes in advance, declare them. Under platforms.telegram.extra.dm_topics you add your Telegram user ID as chat_id, then a list of topics.
- name is the only required field, for example General, Website or Research.
- icon_color and icon_custom_emoji_id set the topic icon.
- skill auto-loads a skill when a new session starts in that topic. The docs example binds arxiv to Research.
- thread_id fills itself in. Don't type it.
On the next gateway start, Hermes calls createForumTopic for each topic that has no thread ID yet, then saves the ID back into config.yaml. Restarts reuse it, so you don't get duplicate topics.
Want the main chat kept quiet? Set ignore_root_dm to true. Normal messages in the root DM are ignored for anyone with topics configured, while /start, /help and /status still work.
📺 Watch: Hermes AI Agents Just Went Portable
Step 4: Let users make their own topics with /topic
The second DM option needs no config at all. Send /topic in the root DM. Hermes checks your BotFather settings with getMe and, if anything is off, sends a screenshot of the Threads Settings page showing what to switch.
Once it's on, the root DM becomes a lobby. Tap All Messages, send anything, and Telegram creates a new topic that Hermes answers inside. Each one is a separate session with its own history, model state and tool runs.
A few controls matter day to day:
- /topic inside a topic shows which session it is bound to.
- /topic followed by a session ID restores an older Telegram session into the current topic. It must be your own session and not bound elsewhere.
- /new inside a topic resets that topic only.
- /topic off in the root DM switches the mode off and clears the bindings. Your Telegram topics stay; they just stop acting as separate sessions.
Topics rename themselves to the session title after the first exchange. Set disable_topic_auto_rename to true if you name them by hand. Since v0.23.0, dm_topic_auto_transfer can also open a fresh topic for any message typed in the root DM, per the v0.23.0 notes.
Hermes Agent Telegram threads in a forum group
Supergroups with Topics mode on get per-topic sessions with no setup. The session key ends in the group's chat ID plus the topic's thread ID, and by default everyone in that topic shares one session. Set thread_sessions_per_user to true to split it per person.
To bind skills to group topics, use platforms.telegram.extra.group_topics. Here you type the thread IDs yourself, because an admin creates the topics in Telegram. Open a topic in Telegram Web and the last number in a t.me/c link is its thread ID. The supergroup's chat ID is the group number with -100 in front.
Then decide where the bot may speak:
- telegram.allowed_topics is a whitelist. Messages from other topics are ignored, and the General topic counts as topic 1. DMs are never filtered.
- telegram.ignored_threads keeps Hermes silent in named topics, checked before mentions.
- telegram.free_response_topics lets one topic skip require_mention, so the bot answers without an @mention there.
| Mode | Where | Who creates topics | Main setting |
|---|---|---|---|
| Threaded DM | Bot DM | Telegram client | dm_threads (per_thread or shared) |
| Declared DM topics | Bot DM | Hermes, from config | extra.dm_topics |
| Multi-session DM | Bot DM | The user | /topic command |
| Forum topics | Supergroup | Group admin | extra.group_topics plus allowed_topics |
Several Hermes profiles in one group
A topic separates sessions. It does not separate the agent. Inside one profile, every topic shares the same memory, skills, SOUL.md, model default and bot token.
If you want a research agent and an ops agent in the same group, give each its own profile, its own bot token and its own gateway. The Hermes FAQ is clear that two profiles can't share one token, because Telegram rejects concurrent polling.
The Telegram docs recommend require_mention true and exclusive_bot_mentions true for multi-bot groups. A message starting with one bot's handle then goes to that bot only. Add telegram.bots_require_mention if two bots keep answering each other.
There is also a shared-bot route. With multiplexing on, gateway.profile_routes can send a chat to a different profile, and its match fields include the thread ID as well as the chat ID. The multi-profile gateway guide has the full rules.
What topics can't do yet
People often ask to give each topic its own model, toolset or project folder. That isn't in the config today. GitHub issues for per-topic model overrides and a bound working directory are still open.
Binding a topic to a separate runtime, such as a direct Codex or Claude Code session, is also an open feature request (issue 5394), not something built in yet.
Need one of those for your business now? A free AI strategy session can map the closest setup.
What works now: run /model inside a topic. A plain /model switch is session-only, so it changes that topic and leaves the others alone. /model reset puts it back.
Cron can post into a topic too. A delivery target written as the chat ID, a colon and the thread ID lands in that exact topic, and TELEGRAM_CRON_THREAD_ID points cron at a DM topic when the root DM is a lobby.
My verdict on Telegram topics in Hermes
For one person, start with /topic. It takes one command, no config, and you get as many clean sessions as you like. Add dm_topics later for the two or three lanes you use every day, with a skill bound to each.
For a team, use a forum supergroup, map skills with group_topics, and fence the bot in with allowed_topics. When different jobs need different memory, that's a new profile, not a new topic.
Julian's Agent OS guide shows how gateways, skills and profiles fit together, and Goldie Bench compares the models you might switch to with /model. Members of the AI Profit Boardroom get the installable Agent OS. To map your own lanes, book a free AI strategy session.
FAQ
Why doesn't Hermes create my DM topics?
Threaded Mode is off. Turn it on in the BotFather Mini App under Threads Settings. The gateway log shows "The chat is not a forum" until you do.
Does each Telegram topic remember its own conversation?
Yes. Each topic gets its own session, history and context window. Memory files and skills still belong to the profile, so all topics share those.
How do I stop my DM splitting into lots of sessions?
Set dm_threads to shared under platforms.telegram.extra. The DM becomes one session, and replies still go back to the right thread.
Can I keep the bot out of some group topics?
Yes. List the allowed ones in telegram.allowed_topics, or list the quiet ones in telegram.ignored_threads.
Can two profiles use the same Telegram bot?
Not as two separate gateways. Give each profile its own token, or use one multiplexed gateway with profile_routes.
Can a topic run a different model?
Only per session for now: run /model in that topic. A config-level model per topic is an open GitHub request.
Turn on Threaded Mode, pick /topic or dm_topics, fence your groups with allowed_topics, and Hermes Agent Telegram threads will keep every job in its own clean session.











