Skip to main content
In group chats, share one transcript across all participants — each message prefixed with the sender’s name.
The user messages in a group chat; everyone shares one transcript with sender names attached.

Quick Start

1

Enable per_chat scope in your gateway config

Run with:
In a Telegram group, the agent now sees one shared transcript:
2

Customise the attribution template

The attribution template supports two placeholders:
  • {sender} — the sender’s display name
  • {time} — current time in HH:MM format
Result: [Alice at 14:32] when is the launch?

How It Works

The session key in per_chat mode is:
This keeps different group chats and threads isolated from each other, even on the same platform.

per_user vs per_chat

Direct messages always use per_user scope, even when session_scope: per_chat is configured. Private conversations are never merged into a shared group transcript.

Configuration

Set these options under session: in your channel config: Valid values for session_scope: per_user, per_chat. Any other value raises a validation error.
Temporal grounding: add timestamps: true under session: to prefix each turn with its arrival time so the agent can reason about “now” and relative-time requests. In per_chat the time sits outermost, after the sender name. See Bot Temporal Grounding.

/new in Groups

The /new command clears the shared session for the whole group — not just the sender. All seven supported adapters (telegram, slack, discord, whatsapp, email, linear, agentmail) thread chat_id through their reset handlers. A /new from inside a DM clears only that user’s private session, not any group session.

Best Practices

Use per_chat when your group needs one coherent conversation thread — for example, a team planning bot, a group Q&A assistant, or a shared research helper. Keep per_user (the default) when each user needs their own private context, like a personal productivity or support bot added to a group.
The default "[{sender}] " is clear and compact. Add {time} when timing context helps the agent reason about sequences of events:
Set attribution: "" to disable attribution entirely — the agent sees messages without sender prefixes.
The key includes account to namespace different bot accounts on the same platform. If you run two gateway bots on the same Telegram group with different tokens, each bot maintains its own independent shared session. No additional config is needed — this is automatic.
A per_chat session accumulates turns from all participants. In active groups this fills max_history faster than a one-on-one conversation. Lower max_history or enable compaction to summarise older turns:

Bot Gateway

Set up the gateway to connect agents to messaging platforms

Multi-Channel Bots

Run one agent across telegram, slack, discord, and more