Skip to main content
Gateway agents automatically know where a message came from and which channels they can deliver to — no extra code required.
The user messages on Telegram; the gateway agent replies with platform-aware routing.

Quick Start

1

Simple Usage

The agent’s system prompt automatically includes the source platform, chat type, and reachable delivery targets.
2

With Configuration

Add a channel directory for cross-platform delivery:

How It Works

Prompt injection happens after the system prompt cache boundary — the per-turn ## Session Context block is never cached.

Configuration Options

BotSessionManager

BotConfig media

Chat-type detection


Common Patterns

Cross-platform delivery

Disable injection for privacy

Context still flows to tools via get_session_context() — only the visible prompt block is suppressed.

Best Practices

The ## Session Context block is injected after the cache boundary — each turn gets fresh context without invalidating prior cache entries.
Prefer "team" or "ops" over raw channel IDs — the model matches user intent to alias names.
set_home_channel(platform, channel_id) designates the default delivery target; agents refer to it as "<platform>:home".
Set inject_session_context=False when platform metadata should not appear in the system prompt.

Cross-Platform Sessions

Unified conversation history across platforms

Channels Gateway

Connect agents to Telegram, Discord, Slack, and WhatsApp

Bot Message Routing

Route messages to different agents by channel

Gateway Tool Policy

Scope the toolset per route