> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 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`.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    subgraph "Implicit Mentions"
        A[💬 User taps Reply<br/>on bot message] --> B{🔍 mention_only?}
        B -->|Yes| C[🧠 Admit as<br/>implicit mention]
        C --> D[🤖 Agent replies]
    end

    classDef input fill:#6366F1,stroke:#7C90A0,color:#fff
    classDef check fill:#F59E0B,stroke:#7C90A0,color:#fff
    classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
    classDef output fill:#10B981,stroke:#7C90A0,color:#fff

    class A input
    class B check
    class C process
    class D output
```

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 theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# 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 theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
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 theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
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.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
sequenceDiagram
    participant User
    participant Group as 📱 Group Chat
    participant Bot
    participant Admission as 🚪 resolve_ingress_admission

    User->>Bot: @bot what's the weather?
    Bot-->>Group: It's sunny.
    User->>Group: (Tap Reply on bot msg) and tomorrow?
    Group->>Admission: MentionFacts(reply_to_bot=True)
    Admission-->>Bot: admit=True (implicit mention)
    Bot-->>Group: Tomorrow is cloudy.
```

> [!NOTE]
>
> **Reply also carries context.** In addition to admitting the message under `mention_only`, the referenced message's text is folded into the agent turn as a compact quoted block — so "do the second one" resolves to the right option. See [Quoted Reply Context](https://praison.ai/docs/features/bot-quoted-reply-context.md).

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

| Signal | Meaning | Default |
| - | - | - |
| `reply` | The message replies to a previous bot message | ✅ on |
| `quote` | The message quotes/forwards a previous bot message | ❌ off |
| `thread` | The message is in a thread the bot participates in | ❌ off |

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
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

| Option | Type | Default | Description |
| - | - | - | - |
| `implicit_mentions` | `list[str]` | `["reply"]` | Which non-`@mention` signals admit a message under `mention_only` / `observe`. Values: `"reply"`, `"quote"`, `"thread"`. Empty list = strict `@`-only. |

> **[Bot Gateway](https://praison.ai/docs/features/bot-gateway.md#channel-security)**
>
> 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`.

| Platform | `reply` | `quote` | `thread` |
| - | :-: | :-: | :-: |
| 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.

> [!NOTE]
>
> Enabling `implicit_mentions: ["reply", "quote"]` on an adapter that doesn't report those signals has no effect — the adapter simply never sets the fact.

***

## Common Patterns

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

```yaml theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
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 theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
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 theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
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

> **[Bot Gateway](https://praison.ai/docs/features/bot-gateway.md)**
>
> Where `implicit_mentions` and `group_policy` live in YAML

> **[Observe Mode](https://praison.ai/docs/features/bot-observe-mode.md)**
>
> The same reply-to-bot rule applies under `observe`

> **[Bot Security & DM Policy](https://praison.ai/docs/best-practices/bot-security.md)**
>
> The mention gate is not an authentication gate

> **[Bot Platform Plugins](https://praison.ai/docs/features/bot-platform-plugins.md)**
>
> How adapters compute MentionFacts for the admission primitive

> **[Quoted Reply Context](https://praison.ai/docs/features/bot-quoted-reply-context.md)**
>
> The same reply gesture also surfaces the referenced content to the agent


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.