#6079

Allow agents to observe group messages without always replying

Opendmerkertopened 25d ago

Problem / Motivation

In group chats, there is an important distinction between:

  1. receiving/observing a message,
  2. deciding whether the message is relevant to the agent,
  3. processing it with the main agent,
  4. deciding whether a response should actually be sent.

Today, group message handling is mainly based on whether a bot should be triggered by a message at all, for example through mention-based or open group handling.

For multi-agent group chats this is limiting.

Example:

A Telegram group contains several specialized agents:

  • a calendar / personal assistant
  • a project management agent
  • an information/archive agent

A user writes:

I will be on vacation next Thursday.

This information may be useful context for multiple agents, but only one of them may have something useful to say.

Ideally:

  • the calendar agent may handle the message and respond
  • the project management agent may observe it as useful context but remain silent
  • the archive agent may ignore it entirely

Without such a distinction, users either have to explicitly mention every relevant bot or allow multiple bots to respond to messages where they have nothing useful to contribute.

This becomes especially noisy in groups with multiple agents.

Proposed Solution

Introduce an optional contribution policy for incoming group messages that separates message observation from response delivery.

Conceptually, an incoming message could pass through the following stages:

Incoming group message
        |
        v
Contribution decision
        |
        +--> IGNORE
        |
        +--> OBSERVE / CONTEXT_ONLY
        |
        +--> HANDLE
                 |
                 v
             Main agent
                 |
                 v
          Delivery decision
                 |
          +------+------+
          |             |
       SUPPRESS       DELIVER

The exact API/configuration is open for discussion, but an opt-in policy could conceptually look like:

{
  "channels": {
    "telegram": {
      "groupPolicy": "open",
      "contributionPolicy": "relevant"
    }
  }

The important behavior would be:

  • IGNORE: do not invoke the main agent
  • OBSERVE / CONTEXT_ONLY: retain the message as conversation context without generating a response
  • HANDLE: invoke the normal agent
  • after agent execution, optionally allow the resulting response to be suppressed instead of requiring every successful agent run to produce a user-visible message The contribution and delivery decisions could use a lightweight configurable evaluator rather than the agent's main model. Explicit mentions should probably bypass the contribution gate and continue to trigger the addressed agent directly. Existing group behavior should remain unchanged unless the new policy is explicitly enabled.

Alternatives Considered

Mention-only group handling

This avoids unwanted responses, but the bot does not get useful context from messages where it was not explicitly mentioned.

It also requires the user to know in advance which agent may need a piece of information.

Open group handling

This gives agents access to the whole conversation, but can cause every agent to react to every message.

In a multi-agent group this quickly becomes noisy and can also cause unnecessary LLM calls.

Prompt the main agent to return something like NO_REPLY

This could suppress some responses, but the expensive main agent has already been invoked.

It also makes "no user-visible response" a special text convention instead of an explicit runtime behavior.

Only add a post-run delivery evaluator

This would solve unwanted responses, but would not avoid unnecessary main-agent invocations for clearly irrelevant messages.

A pre-run contribution decision and a post-run delivery decision solve different problems and could therefore be useful independently.

Related Component

Channel (WeChat, Feishu, Telegram, etc.)

Additional Context

A similar separation already exists conceptually in the heartbeat flow:

  • work is performed internally
  • the resulting response is evaluated
  • only relevant results are delivered to the user

The proposed group-chat behavior could reuse or generalize this idea, while additionally introducing a lightweight pre-run contribution decision to avoid unnecessary main-agent executions.

This would be particularly useful for groups containing multiple specialized bots, where all agents can share conversational context but should only speak when they have something relevant to contribute.

The evaluator implementation should not necessarily depend on a specific model or provider. A configurable model preset, deterministic policy, or another lightweight decision mechanism could be supported by the underlying abstraction.

Activity

1
balabommablock-cpu13d ago

Really like the observe/handle split. One thought from the product side: there might be a much smaller first step that already solves the vacation example.

Step 1: "listen, speak when mentioned". A group mode where unmentioned messages are kept as context with no model call at all, and the bot only runs when it's mentioned (or replied to). When the project agent is next asked "who's around next week?", it already knows about Thursday. No evaluator, no extra cost, no noise, and no new decision for the bot to get wrong.

Step 2, later: the relevance evaluator. That's where "speak up without being mentioned" comes in. It's genuinely useful, but it brings the hard questions: a cheap model guessing relevance, false positives in a busy group, and three bots each deciding they're the relevant one. Shipping step 1 first would show how much people actually want step 2.

Open questions I'd want settled before either step:

  1. Do people in the group know the bot is keeping what they say? Today mention-only means "the bot only sees what I send it". A listening bot changes that. A one-time notice in the group when the mode is turned on might be enough.
  2. How much is kept? A busy group can fill a context window fast. Last N messages, last N hours, or a running summary?
  3. How do observed messages reach the agent? Mixed into history as normal turns, or as one block like "since you last spoke: …"? The second is easier to bound and easier for the model to tell apart from messages addressed to it.
  4. Is "observe" per bot, or per group? In the example, the archive agent wants to ignore everything, and the project agent wants to listen. That suggests per bot, per group.

Happy to help sketch the config shape for step 1 if that direction sounds right.