hermes - 💡(How to fix) Fix Add opt-in proactive assist classifier for group chats

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fix / Workaround

  • _should_process_message() only dispatches group messages when they pass deterministic gates: allowed chat/topic, free-response chat, require_mention: false, reply-to-bot, explicit bot mention, guest-mode mention, or regex mention patterns.
  • _should_observe_unmentioned_group_message() can append skipped group chatter to the transcript when observe_unmentioned_group_messages and group_allowed_chats are configured, but explicitly does not dispatch a response.
  • There does not appear to be a configurable semantic relevance / "should the agent jump in?" classifier for unmentioned group messages.
  1. Platform adapter receives group message.
  2. Existing hard gates still apply first: auth, allowed users/chats/topics, ignored threads, bot privacy/delivery constraints.
  3. If message is directly addressed, dispatch as today.
  4. If not directly addressed but observation is allowed, append to observed context as today.
  5. If proactive assist is enabled for this chat/topic, run a small classifier against the current message plus bounded recent observed context.
  6. Dispatch only when classifier returns should_respond=true with confidence above threshold and rate limits permit.

Alternatives Considered

  • free_response_chats: too noisy; treats every message as a request.
  • mention_patterns: useful for wake words, but not semantic relevance.
  • observe_unmentioned_group_messages: good for context, but intentionally non-dispatching.
  • Relying on humans to always @mention the bot: safest, but misses useful assistant-in-the-room workflows.

Code Example

telegram:
  require_mention: true
  observe_unmentioned_group_messages: true
  group_allowed_chats:
    - "-1001234567890"
  proactive_assist:
    enabled: true
    chats:
      - "-1001234567890"
    confidence_threshold: 0.90
    max_responses_per_hour: 3
    cooldown_seconds: 300
    mode: classifier_only

---

{
  "should_respond": true,
  "confidence": 0.93,
  "reason": "User asked a direct answerable home status question",
  "category": "question|home_automation|technical_help|operational_alert|other",
  "suggested_prompt": "...optional cleaned prompt..."
}
RAW_BUFFERClick to expand / collapse

Feature Description

Add an opt-in proactive relevance classifier for messaging gateway group chats, starting with Telegram, so Hermes can observe ordinary group messages and decide whether the agent should contribute without requiring an explicit @mention/reply/command.

Motivation

Hermes already supports conservative group routing: require_mention, free_response_chats, mention_patterns, allowed chats/topics, and Telegram observe_unmentioned_group_messages for context-only storage. That covers explicit summons and situational awareness, but not the middle ground where a group asks an answerable question or raises an operational/home-automation issue without naming the bot.

Users want a mode where Hermes can behave like a useful participant in selected chats: mostly quiet, but able to contribute when a message is clearly actionable and the agent has relevant tools/context.

Current Behaviour / Gap

From local inspection of gateway/platforms/telegram.py:

  • _should_process_message() only dispatches group messages when they pass deterministic gates: allowed chat/topic, free-response chat, require_mention: false, reply-to-bot, explicit bot mention, guest-mode mention, or regex mention patterns.
  • _should_observe_unmentioned_group_message() can append skipped group chatter to the transcript when observe_unmentioned_group_messages and group_allowed_chats are configured, but explicitly does not dispatch a response.
  • There does not appear to be a configurable semantic relevance / "should the agent jump in?" classifier for unmentioned group messages.

Proposed Solution

Introduce an opt-in per-platform/per-chat proactive assist policy. Example shape:

telegram:
  require_mention: true
  observe_unmentioned_group_messages: true
  group_allowed_chats:
    - "-1001234567890"
  proactive_assist:
    enabled: true
    chats:
      - "-1001234567890"
    confidence_threshold: 0.90
    max_responses_per_hour: 3
    cooldown_seconds: 300
    mode: classifier_only

Potential flow:

  1. Platform adapter receives group message.
  2. Existing hard gates still apply first: auth, allowed users/chats/topics, ignored threads, bot privacy/delivery constraints.
  3. If message is directly addressed, dispatch as today.
  4. If not directly addressed but observation is allowed, append to observed context as today.
  5. If proactive assist is enabled for this chat/topic, run a small classifier against the current message plus bounded recent observed context.
  6. Dispatch only when classifier returns should_respond=true with confidence above threshold and rate limits permit.

Classifier decision schema could be deliberately small:

{
  "should_respond": true,
  "confidence": 0.93,
  "reason": "User asked a direct answerable home status question",
  "category": "question|home_automation|technical_help|operational_alert|other",
  "suggested_prompt": "...optional cleaned prompt..."
}

Safety / UX Requirements

  • Disabled by default.
  • Per-chat allowlist required; no global proactive mode by accident.
  • Respect existing sender/chat/topic auth gates.
  • Rate limit and cooldown to avoid bot spam.
  • Never bypass explicit mentions to other bots (exclusive_bot_mentions).
  • Log classifier decisions at debug/info level without dumping private content unnecessarily.
  • Include a prompt/policy that strongly biases toward silence on banter, private/emotional conversations, or low-confidence cases.
  • Ideally expose a dry-run / observe-only mode that logs "would respond" decisions without sending.

Alternatives Considered

  • free_response_chats: too noisy; treats every message as a request.
  • mention_patterns: useful for wake words, but not semantic relevance.
  • observe_unmentioned_group_messages: good for context, but intentionally non-dispatching.
  • Relying on humans to always @mention the bot: safest, but misses useful assistant-in-the-room workflows.

Acceptance Criteria

  • Users can enable proactive assist for a specific Telegram group/topic without changing behaviour elsewhere.
  • Unmentioned messages are ignored unless classifier confidence exceeds threshold and rate limits pass.
  • Direct mentions/replies/commands continue to behave exactly as today.
  • Tests cover: disabled default, allowed chat requirement, classifier yes/no, rate limit, ignored topics, exclusive other-bot mentions, and observed context integration.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING