Problem
Users running Hermes in a Telegram group with forum topics want different agent profiles (personality, model, system prompt, toolsets) per topic — without creating a separate bot for each profile.
Example: a team group where Topic A is handled by a coding assistant profile and Topic B by a research assistant profile, both using the same bot token.
Current behavior
The Telegram adapter handles forum topics (telegram.py:2088-2090 discovers topic creation), and sessions are already scoped per-chat. But there is no mechanism to map a message_thread_id (topic ID) to a specific agent profile. All topics use the same agent configuration.
Suggested design
Add a topic_profiles mapping in the Telegram platform config:
platforms:
telegram:
token: "BOT_TOKEN"
topic_profiles:
"12345": # message_thread_id for Topic A
personality: "coding-assistant"
model: "anthropic/claude-sonnet-4"
toolsets: ["terminal", "file", "web"]
"67890": # message_thread_id for Topic B
personality: "research-analyst"
model: "openrouter/google/gemini-3-flash"
toolsets: ["web"]
# Default profile for topics not in the map
personality: "general"
The gateway would resolve the profile at message intake time (_build_message_event or handle_message) and pass it through to the agent session.
Complexity
Medium. The gateway already has per-session agent caching (_agent_cache). The change is:
- Extract
message_thread_id from the Telegram update (already available)
- Look up the topic profile in config
- Pass profile overrides (model, personality, toolsets) to the agent constructor
Related
Problem
Users running Hermes in a Telegram group with forum topics want different agent profiles (personality, model, system prompt, toolsets) per topic — without creating a separate bot for each profile.
Example: a team group where Topic A is handled by a coding assistant profile and Topic B by a research assistant profile, both using the same bot token.
Current behavior
The Telegram adapter handles forum topics (
telegram.py:2088-2090discovers topic creation), and sessions are already scoped per-chat. But there is no mechanism to map amessage_thread_id(topic ID) to a specific agent profile. All topics use the same agent configuration.Suggested design
Add a
topic_profilesmapping in the Telegram platform config:The gateway would resolve the profile at message intake time (
_build_message_eventorhandle_message) and pass it through to the agent session.Complexity
Medium. The gateway already has per-session agent caching (
_agent_cache). The change is:message_thread_idfrom the Telegram update (already available)Related