ai-agents

Let Hermes learn your Telegram forum topic names

John Dwyer | Digital Strategist 4 min read

Telegram forum groups split the chat into topics, a bit like channels inside one group. Hermes knows which topic a message came from. It does not know what that topic is called, unless you typed the name into your config by hand. There is a reason for that. Telegram has no way for a bot to ask for a list of topics. A bot only ever hears a topic’s name at the moment the topic is made or renamed, and Hermes only listens for that in one-to-one chats, not in groups. This plugin listens for it in your groups, saves the name, and hands it to Hermes.

Code and install: github.com/Smshd-Avo/hermes-telegram-topic-titles

Is this your problem?

  • Your group topics show up with no name on the Hermes side, so labels and skill bindings have nothing to match on.
  • You typed the topic names into your config by hand, and they are already out of date.
  • A topic made after the bot joined the group has no name until you go and add it.
  • Someone renames a topic and your config keeps the old name.

What we built

Telegram sends a small status message when a topic is created, and another when it is renamed. Hermes reads the first one, but only for topics inside a one-to-one chat with the bot. For a group forum it reads names from your group_topics config and nowhere else. The plugin fills that gap. It watches both status messages in the groups you list, saves what it learns, and merges the result into the same group_topics list Hermes already reads. Names go to disk, so they are there from the first message after a restart.

Those status messages are housekeeping, not chat. The plugin reads them and the agent never sees them. We had this as a patch to the Telegram adapter, which clashed with every update, so we rebuilt it on Hermes’s public plugin hooks and it now survives hermes update. Upstream is working on the same feature in PR #36772, open since June.

How to install

hermes plugins install Smshd-Avo/hermes-telegram-topic-titles
hermes plugins enable hermes-telegram-topic-titles

Then list the groups it is allowed to learn from:

plugins:
  entries:
    hermes-telegram-topic-titles:
      settings:
        chats:
          - "-1001234567890"

Leave that list empty and the plugin loads, writes a warning to the log, and learns nothing. That is on purpose. Your bot may sit in groups that have nothing to do with Hermes, and their topic names should stay out of Hermes.

Good to know

  • It cannot fill in the past. A topic made before you installed the plugin stays nameless until someone renames it. Put the ones you care about into the static group_topics config and let the plugin pick up the rest.
  • A name the plugin learns beats a name you typed for the same topic. That is the point of it. Everything else on your entry is kept, including skill.
  • The plugin writes into a public part of the adapter that is not a documented hook, because Hermes has no hook for topic names yet. If Hermes changes how it reads group_topics, the plugin will need a small update. It logs a line and keeps its saved names rather than falling over.

The code is on GitHub at Smshd-Avo/hermes-telegram-topic-titles. MIT licensed, free to use.

Book your discovery call

Pick a time that suits you and we will have a straight conversation about where your business is at and whether we can help. No obligation, no pitch.

  • No obligation A straight chat about where your business is at. No pitch deck, no pressure to sign anything.
  • Fifteen focused minutes We keep it tight and respect your time, so you get value even from a short call.
  • Clear next steps You leave with at least one practical idea you can act on, whether or not we work together.

Your consultation will be with

John Dwyer, Smashed Avo John Dwyer Founder, Smashed Avo Digital

Not ready for a call?

Write to John instead. A line or two on what is going on is enough.

Write to us

Prefer to contact us directly?

Call, email or use the contact page.