Implicit Mentions

Reply to the bot to continue a mention_only group conversation without re-typing @bot

In a mention_only group, tapping Reply on the bot’s own message counts as addressing it — the follow-up is answered without re-typing @bot.

Diagram

Implicit Mentions

Yes

💬 User taps Reply
on bot message

🔍 mention_only?

🧠 Admit as
implicit mention

🤖 Agent replies

The “aha” scenario — Alice in a Telegram group set to group_policy: mention_only:

Alice:  @planning_bot what's on today?
Bot:    You have 3 meetings.
Alice:  (taps Reply on the bot's message) And tomorrow?
Bot:    Tomorrow you have 2 meetings and a demo.

Before this change the follow-up was silently dropped because there was no @planning_bot in the text. Now the natural “reply to the bot” continues the conversation.

Quick Start

  1. Default: reply-to-bot just works

    Set group_policy: mention_only — a reply to the bot is admitted with no extra config.

    yaml
    # gateway.yaml
    channels:
      telegram:
        token: ${TELEGRAM_BOT_TOKEN}
        group_policy: mention_only    # reply-to-bot counts by default
  2. Enable quote as an implicit mention

    Add quote when you also want a quoted/forwarded bot message to count.

    yaml
    channels:
      telegram:
        token: ${TELEGRAM_BOT_TOKEN}
        group_policy: mention_only
        implicit_mentions: ["reply", "quote"]
  3. Disable implicit mentions (strict @-only)

    An empty list requires a literal @bot on every message.

    yaml
    channels:
      telegram:
        token: ${TELEGRAM_BOT_TOKEN}
        group_policy: mention_only
        implicit_mentions: []         # strict: only @bot admits

How It Works

The adapter reports how the bot was addressed as structured facts; the admission primitive admits the message when an enabled implicit signal is present.

Diagram
🚪 resolve_ingress_admissionBot📱 Group ChatUser🚪 resolve_ingress_admissionBot📱 Group ChatUser@bot what’s the weather?It’s sunny.(Tap Reply on bot msg) and tomorrow?MentionFacts(reply_to_bot=True)admit=True (implicit mention)Tomorrow is cloudy.

An explicit @bot always counts. Each implicit signal counts only when its name is listed in implicit_mentions.

SignalMeaningDefault
replyThe message replies to a previous bot message✅ on
quoteThe message quotes/forwards a previous bot message❌ off
threadThe message is in a thread the bot participates in❌ off
python
from praisonaiagents.bots import (
    MentionFacts,
    resolve_ingress_admission,
    DEFAULT_IMPLICIT_MENTIONS,
)

# A reply to the bot in a mention_only group — admitted by default.
decision = resolve_ingress_admission(
    chat_type="group",
    sender_id="123",
    mention=MentionFacts(reply_to_bot=True),
    group_policy="mention_only",
)
print(decision.admit)                 # True
print(DEFAULT_IMPLICIT_MENTIONS)      # frozenset({'reply'})

Configuration Options

OptionTypeDefaultDescription
implicit_mentionslist[str]["reply"]Which non-@mention signals admit a message under mention_only / observe. Values: "reply", "quote", "thread". Empty list = strict @-only.
Bot Gateway

Where implicit_mentions lives in gateway.yaml, alongside group_policy


Supported Signals per Platform

Reply-to-bot detection is wired on Telegram, Discord and Slack. The same group_policy keys work under discord: and slack: entries in gateway.yaml.

Platformreplyquotethread
Telegram✅🔜🔜
Discord✅❌❌
Slack✅❌❌
WhatsApp❌❌❌

The same gesture works on Discord (native Reply to the bot’s message) and Slack (a reply in a thread whose parent message was posted by the bot). On Slack this counts as reply, not thread — other thread messages do not admit.


Common Patterns

Natural follow-up (default). A reply to the bot continues the conversation without @bot.

yaml
channels:
  telegram:
    token: ${TELEGRAM_BOT_TOKEN}
    group_policy: mention_only
    # implicit_mentions defaults to ["reply"]

Answer anywhere in this thread. Treat any message in a bot thread as addressing the bot.

yaml
channels:
  telegram:
    token: ${TELEGRAM_BOT_TOKEN}
    group_policy: mention_only
    implicit_mentions: ["reply", "thread"]

Audit-only channel (strict @). Require a literal @bot every time.

yaml
channels:
  telegram:
    token: ${TELEGRAM_BOT_TOKEN}
    group_policy: mention_only
    implicit_mentions: []

Best Practices

Keep reply on by default

A reply to the bot matches what users expect and does not widen the gate — the sender is still checked against allowed_users / allowlist first.

Enable quote sparingly

A quote can be a share of an old bot message the user never meant to re-invoke. Turn on quote only when you want shares to count.

thread needs a real thread model

thread is only useful on platforms with real threads (Telegram forum topics, Slack threads). Wire it only when the adapter reliably reports thread membership.

Implicit mentions are not an auth gate

implicit_mentions: [] combined with an empty allowed_users is the strictest noise setting, but it adds no security on top of an allow-list — it only affects which messages the bot answers, not who is allowed.


Related