Quick Start
- CLI (No Code)
- Python SDK
Supported Platforms
Bot Runtimes (Bidirectional — Send + Receive)
| Bot Class | Platform | Env Variable | Status |
|---|---|---|---|
SlackBot | Slack | SLACK_BOT_TOKEN, SLACK_APP_TOKEN | ✅ |
DiscordBot | Discord | DISCORD_BOT_TOKEN | ✅ |
TelegramBot | Telegram | TELEGRAM_BOT_TOKEN | ✅ |
WhatsAppBot | WhatsApp Business | WHATSAPP_ACCESS_TOKEN, WHATSAPP_PHONE_NUMBER_ID | ✅ |
LinearBot | Linear (AgentSession webhooks) | LINEAR_OAUTH_TOKEN (or LINEAR_API_KEY), LINEAR_WEBHOOK_SECRET | ✅ |
EmailBot | Email (IMAP/SMTP) | EMAIL_ADDRESS, EMAIL_APP_PASSWORD | ✅ |
AgentMailBot | AgentMail (API) | AGENTMAIL_API_KEY | ✅ |
Outbound Tools (Send-Only — Bot Runtime Coming Soon)
| Tool | Platform | Env Variable | Bot Runtime |
|---|---|---|---|
SignalTool | Signal | Requires signal-cli daemon | 🔜 Coming Soon |
LineTool | LINE | LINE_CHANNEL_ACCESS_TOKEN | 🔜 Coming Soon |
iMessageTool | iMessage (macOS only) | No token needed | 🔜 Coming Soon |
TwilioTool | SMS/Voice | TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN | 🔜 Coming Soon |
WebexTool | Webex | WEBEX_ACCESS_TOKEN | 🔜 Coming Soon |
XTool | X (Twitter) | X_API_KEY, X_API_SECRET | 🔜 Coming Soon |
Durable Outbound Delivery — All Channels
As of 2026-06-30, durable outbound delivery with bounded exponential backoff now covers all six bot adapters — Slack, Discord, WhatsApp, Email, Linear, and AgentMail — not only Telegram. Before this change, only Telegram retried agent replies on transient 5xx / rate-limit / network errors; the other adapters silently dropped failed sends. Now every adapter retries with the same guarantee, and a configured DLQ parks the message instead of dropping it on permanent failure.
config.outbound_resilience — the same config block applies to every adapter:
dlq_path, the adapter retries but never silently drops — it raises after exhausting attempts. With a dlq_path, a permanent failure parks the message to disk for manual inspection or replay.
Durable Delivery
Full reference: retry config, DLQ, drain-on-restart, and per-adapter
_outbound_platform labelsInbound Media → Vision
Both WhatsApp and Telegram bots forward photos and documents directly to your agent’s vision capability.Backward compatible: if your agent doesn’t accept
attachments, the bot skips the file and forwards only the caption text. Text-only agents need zero changes.WhatsApp Inbound Media
WhatsApp-specific details: Graph API download, security pipeline, and
max_inbound_media_bytes configBot Inbound Media
Full reference: security pipeline, SSRF guard, size limits, and common patterns
Outbound Media Delivery
Send agent-generated images, charts, and files via native platform uploads
How It Works
| Component | Role |
|---|---|
| Platform | Telegram, Discord, Slack, or WhatsApp |
| Bot | Message router and formatter |
| Agent | AI processing and response |
| User | End user on messaging app |
Wiring Button Clicks
Buttons and select menus rendered by your bot can be wired to your own async handlers — slash-command buttons work out of the box, and you can register custom namespaces for things like approvals, menus, or multi-step flows. See Interactive Bot Actions.AIUI Dashboard Integration
When bots are connected through PraisonAI UI (praisonai chat), channel messages appear in the Chat dashboard with full visibility into agent processing steps — tool calls, reasoning, and intermediate responses stream in real-time.
What You See in the Dashboard
| Feature | Description |
|---|---|
| Tool call steps | Each tool the agent uses appears as a collapsible step with icon, description, and result |
| Reasoning steps | Chain-of-thought reasoning streams in real-time |
| Platform icon | Session sidebar shows the platform badge (e.g. 💬 Slack, ✈️ Telegram) |
| Message history | All channel messages and responses are persisted and replayable |
The streaming bridge hooks into the same
StreamEventEmitter used by the web chat, so channel messages get identical step visibility as messages typed directly in the dashboard.Smart Defaults
Bots ship with sensible defaults so you can start chatting immediately — no tool wiring required. Bothpraisonai bot start and praisonai gateway start apply the same defaults:
| Default | Applied when | What you get |
|---|---|---|
| Safe tools | Agent has no tools configured | search_web, web_crawl, schedule_*, store_memory/search_memory, store_learning/search_learning |
| Auto-approval | auto_approve_tools=True (default) | Tool calls run without CLI prompts — chat bots can’t show them anyway |
| Session history | Agent has no memory configured | Last 20 messages remembered per user, zero-dep |
Opting out
| Goal | How |
|---|---|
| Run with zero tools | Set tools: [] explicitly in YAML, or pass tools=[] to Agent |
| Require manual approval | Set auto_approve_tools: false in the channel config |
| Override the tool list | Set default_tools: [...] under the channel — destructive tools are still filtered |
Upgrading from an older release?
auto_approve_tools used to default to False. If your bot relied on manual approval, set auto_approve_tools: false explicitly.Pending approvals can survive a bot restart when you configure an
ApprovalStore — late Allow/Deny taps still resolve after a deploy.Telegram-native durable approvals. On Telegram, setting Agent(approval="presentation") is enough — the bot auto-wires the durable backend to the chat on start and rehydrates pending approvals across restarts. See Telegram Durable Approval.Platform Awareness
Every bot automatically tells the agent which platform it’s on, what kind of chat it’s in, and which channels it can reach.This is enabled by default via
inject_session_context=True on BotSessionManager. The agent receives a ## Session Context block in its system prompt each turn — for example: “You are replying on telegram (group ‘Project Alpha’) in thread 123. Reachable delivery targets: slack:home, team (slack:C0123).”To suppress the visible block (context still flows to tools), set inject_session_context=False. See Platform-Aware Agents for the full configuration reference.Socket Mode vs Webhook
PraisonAI bots support two connection modes:| Mode | Use Case | Requirements |
|---|---|---|
| Socket Mode | Local development, behind firewall | App Token only |
| Webhook Mode | Production, high scale | Public URL with HTTPS |
Socket Mode works by opening an outbound WebSocket connection to Slack/Discord. No public URL or port forwarding is needed - your bot initiates the connection from behind NAT/firewall.
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
token | str | "" | Bot authentication token |
webhook_url | str | None | Webhook URL for webhook mode |
command_prefix | str | "/" | Prefix for bot commands |
mention_required | bool | True | Require @mention in channels (DMs never require mention) |
typing_indicator | bool | True | Show typing indicator. On Telegram, the indicator is renewed every 4 seconds for the entire duration of the agent run so users keep seeing “typing…” even during 20–30s RAG / tool-call operations. |
max_message_length | int | 4096 | Max message length |
allowed_users | list | [] | Allowed user IDs. Empty list now defers to unknown_user_policy (deny / pair / allow). Earlier releases treated empty as “allow everyone” on Telegram — fixed in PR #1885. |
allowed_channels | list | [] | Allowed channel IDs |
timeout | int | 30 | Request timeout |
reply_in_thread | bool | False | Always reply in threads |
thread_threshold | int | 500 | Auto-thread responses longer than N chars (0 = disabled) |
group_policy | str | "mention_only" | Group chat behavior: respond_all, mention_only, or command_only |
allow_silence | bool | false | When true, agent may return NO_REPLY to send nothing. See Intentional Silence. |
silence_token | str | None | Custom silence marker (default: NO_REPLY) |
bot_loop_protection | low-level guard primitive | — | Break runaway bot-to-bot reply loops. Currently a BotLoopGuard primitive you wire yourself (not yet a Bot(...) kwarg). See Bot Loop Protection. |
default_tools | list[str] | ["search_web", "web_crawl", "schedule_add", "schedule_list", "schedule_remove", "store_memory", "search_memory", "store_learning", "search_learning"] | Safe tools auto-injected when the agent has no tools configured. Destructive tools (execute_command, delete_file, write_file, shell_command) are excluded from auto-injection even if listed. |
auto_approve_tools | bool | True | Skip confirmation for safe tool execution. Chat bots can’t show CLI approval prompts, so this defaults to True. Set False to require approval (only useful if you wire a chat-level approval flow). |
unknown_user_policy | Literal["deny","pair","allow"] | "deny" | How to handle messages from users not in allowed_users. deny silently drops, pair runs the owner-approval flow, allow lets everyone through. With an empty allowed_users, every user is “unknown” and this policy applies to all of them. |
owner_user_id | Optional[str] | None | Platform-specific ID of the bot owner. Required for inline-button approvals — without it, "pair" policy falls back to a plain-text CLI instruction. |
retry_attempts | int | 3 | Number of retry attempts for failed operations |
polling_interval | float | 1.0 | Interval for polling mode (seconds) |
Reply behavior:
- Default: Inline replies in the channel
- Auto-thread: Responses > 500 chars are automatically threaded
- Force thread: Set
reply_in_thread=Trueto always use threads
Group policy:
mention_only— Bot only responds when @mentioned (default, safest)respond_all— Bot responds to every message in the groupcommand_only— Bot only responds to/commands
group_policy per channel in gateway.yaml. See Bot Gateway → Channel Security.For the full owner-approval workflow (inline buttons on Telegram / Discord / Slack, HMAC signing, CLI fallback), see Bot Unknown-User Pairing.
CLI Capabilities
Enable powerful agent features directly from the command line:Memory
Knowledge/RAG
Skills
Extended Thinking
Full CLI Options Reference
Full CLI Options Reference
| Flag | Description | Example |
|---|---|---|
--memory | Enable conversation memory | --memory |
--memory-provider | Memory backend | --memory-provider chroma |
--knowledge | Enable RAG/knowledge | --knowledge |
--knowledge-sources | Source files | --knowledge-sources file.pdf |
--skills | Skill modules | --skills researcher |
--thinking | Thinking mode | --thinking high |
--web | Enable web search | --web |
--web-provider | Search provider | --web-provider duckduckgo |
--browser | Enable browser | --browser |
--tools | Named tools | --tools WikipediaTool |
--sandbox | Sandbox mode | --sandbox |
--auto-approve | Auto-approve tool executions | --auto-approve |
Platform Setup
- Telegram
- Discord
- Slack
- WhatsApp
- WhatsApp Web Mode
- Message @BotFather on Telegram
- Send
/newbotand follow prompts - Copy the bot token
Bot Commands
Built-in commands available on all platforms:| Command | Description |
|---|---|
/help | Show available commands and agent info |
/status | Show agent name, model, platform, and uptime |
/new | Reset conversation session — starts a fresh chat (works alongside automatic session reset policies) |
/sethome | Mark this chat as the platform home channel for scheduled deliveries |
Common Patterns
- Restricted Access
- Webhook Mode
- Group Settings
CLI Commands
The Slack bot uses Slack Bolt, Slack’s official Python framework.
When running, you’ll see “⚡️ Bolt app is running!” - this confirms the bot is connected and listening.
WhatsApp Message Filtering (Web Mode)
By default, WhatsApp Web mode responds only to self-chat messages — when you message your own number. This prevents the bot from replying to every conversation on your account, including messages you send in other people’s chats.Self-chat means messaging your own phone number — not just any message you send. Messages you send in other people’s chats or groups are filtered out by default.
CLI Flags
- Self-Only (Default)
- Allowed Numbers
- Allowed Groups
- Combined
- Respond to All
Python SDK
YAML Config
Filtering Behavior Matrix
| Scenario | Default | --respond-to 123 | --respond-to-groups g@g.us | --respond-to-all |
|---|---|---|---|---|
| Self-chat (message your own number) | ✅ | ✅ | ✅ | ✅ |
| Your message in someone else’s chat | ❌ | ❌ | ❌ | ✅ |
| DM from 123 | ❌ | ✅ | ❌ | ✅ |
| DM from 999 | ❌ | ❌ | ❌ | ✅ |
| Group g@g.us | ❌ | ❌ | ✅ | ✅ |
| Other group | ❌ | ❌ | ❌ | ✅ |
| Old/offline messages | ❌ | ❌ | ❌ | ❌ |
Phone numbers are normalized automatically —
+1-234-567-890, 1234567890, and (123) 456-7890 all match the same number. Group IDs use WhatsApp’s JID format (e.g., 120363123456@g.us).Stale message guard: Messages older than when the bot connected are always dropped, even with --respond-to-all. This prevents replaying old conversations on reconnect.Docker Deployment
Deploy bots using Docker for production environments:- Slack
- Discord
- Telegram
Production (Webhook Mode)
For production deployments with a public URL, use webhook mode instead of Socket Mode:- Slack
- Discord
- Telegram
- Event Subscriptions → Enable Events
- Set Request URL:
https://your-domain.com/slack/events - Subscribe to bot events:
app_mention,message.im
Multi-Channel Gateway
Run all bots simultaneously with a single gateway config: gateway.yaml:channels: (e.g. telegram, telegram_cfo) is just an identifier you choose. When the key is not a platform name, set platform: telegram (or whichever) inside the block so the gateway can pick the right protocol. This enables running multiple bots on the same platform. Note: bot.yaml requires channel keys to be platform names.
Bot() — agents get the same safe tools and auto-approval in both entry points.
Multiple bots on the same platform
For role-specific bots on the same platform (e.g., multiple Telegram bots), use this pattern:See the Multi-Channel Bots guide for complete setup instructions including the onboard wizard flow and validation with
praisonai doctor.Zero-Code Mode (YAML Config)
Run a bot with a single YAML file — no Python code needed: bot.yaml:Tip: You can omittools:entirely — the bot auto-injects safe defaults (search_web, schedule, memory, learning). Keeptools: []only if you want the bot to run with zero tools.
Token Types — When to Use What
Different platforms use different types of tokens. Here’s when to use each:Telegram
| Token | Format | When to Use |
|---|---|---|
| Bot Token | 123456:ABC-DEF... | Always required. Get from @BotFather. Used for all bot operations. |
Discord
| Token | Format | When to Use |
|---|---|---|
| Bot Token | MTIz... | Always required. Get from Discord Developer Portal → Bot → Reset Token. Used for bot authentication. |
Slack
| Token | Format | When to Use |
|---|---|---|
| Bot Token | xoxb-... | Always required. Get from OAuth & Permissions → Install to Workspace. Used for sending messages and API calls. |
| App Token | xapp-... | Required for Socket Mode (default). Get from Socket Mode settings. Enables WebSocket connection without a public URL. |
| Client ID | 12345.67890 | OAuth flow only. Used when building apps that are installed by multiple workspaces (not needed for single-workspace bots). |
| Client Secret | d119ac... | OAuth flow only. Used with Client ID for the OAuth2 authorization flow. Never expose publicly. |
- Cloud API (default)
- Web Mode (experimental)
| Token | Format | When to Use |
|---|---|---|
| Access Token | EAAx... | Required. Get from Meta for Developers → WhatsApp → API Setup. Used for sending messages via Cloud API. |
| Phone Number ID | 123456789 | Required. Found in API Setup page. Identifies which WhatsApp business number to send from. |
| Verify Token | Any string | Required for webhooks. A secret string you create. Must match in both Meta console and your environment. |
| App Secret | abc123... | Optional. Used to verify webhook signatures for security. Found in App Settings → Basic. |
Best Practices
Secure your bot token
Secure your bot token
Never commit bot tokens to version control. Use environment variables or secure secret management.
Use allowlists in production
Use allowlists in production
Set
allowed_users and allowed_channels to prevent unauthorized access to your bot.Enable mention requirement for groups
Enable mention requirement for groups
Set
mention_required=True to prevent the bot from responding to every message in group chats.Handle rate limits gracefully
Handle rate limits gracefully
Outbound sends now honour the platform’s
Retry-After / retry_after automatically — both on live retries (deliver_with_retry) and on durable drains (OutboundQueue). To make the limiter widen the lane for the rest of your bot’s concurrent sends, pass a shared RateLimiter into deliver_with_retry(rate_limiter=...). See Bot Rate Limiting and Durable Delivery.Safe default tools only
Safe default tools only
The default tool list is intentionally safe (
search_web, schedule_*, memory/learning). Tools like execute_command require explicit opt-in and should be paired with an approval backend. See Approval Protocol.Set approval flow for auto-approve disabled
Set approval flow for auto-approve disabled
Only set
auto_approve_tools: false if you’ve wired a chat-level approval flow (e.g. SlackApproval). Otherwise tool calls will hang silently waiting for a CLI prompt the user cannot see.Multi-Agent Configuration
You can also define multiple agents in anagents.yaml file for complex workflows:
agents.yaml:
Inbound Message Debounce
When users send multiple rapid messages (e.g. “hey” → “can you” → “search for AI news”), debounce coalesces them into a single agent call — saving tokens and preventing duplicate responses.- Python
- YAML
The per-user debounce lock cache is bounded (default: 10,000 entries, 1 hour TTL). Long-running bots with millions of distinct users won’t leak memory — idle entries are evicted automatically.
Smart Message Chunking
Long agent responses are split at paragraph boundaries while preserving code fences — no more broken code blocks mid-message.How splitting works
How splitting works
Code fence protection
Code fence protection
Code blocks wrapped in triple backticks are never split, even if they exceed
max_message_length. This ensures your users always see complete, copyable code.Smart chunking is enabled automatically for all bot adapters. No configuration needed.
Override
max_message_length in BotConfig to change the split threshold (default: 4096).Session History
Bot agents automatically remember the last 20 messages per conversation — no extra dependencies required.- Automatic (default)
- Custom memory
Ack Reactions
Acknowledge inbound messages with an emoji reaction (e.g. ⏳) so users know the bot is processing, then swap to a done emoji (e.g. ✅) when the response is sent.- Python
- YAML
Long-Running Agent Feedback
RAG-enabled agents commonly take 20–30 seconds to answer (vector search + tool calls + LLM). PraisonAI Telegram bots give users continuous feedback throughout, with no extra code on your side.What the user sees
Why this matters
| Before | After |
|---|---|
One send_action("typing") at T+0 | Renewed every 4s for the full run |
| Bubble vanishes at T+5s | Bubble persists until the reply is sent |
| Users assume bot is broken, send duplicates | Users see continuous activity |
Session Reset Policy
Per-channel YAML policies automatically clear a user’s conversation history after idle time or at a scheduled hour — configured undersession.reset on each channel.
| Feature | What it clears | Configuration |
|---|---|---|
| Session Reset Policy | User conversation history | channels.*.session.reset in YAML |
| Session Reaper (below) | In-memory session records | BotConfig(session_ttl=...) |
Bot Session Reset
Idle, daily, and combined reset modes with full configuration reference
Session Reaper
Automatically prune stale sessions to free memory on long-running bots. Sessions idle longer thansession_ttl seconds are reaped.
Set
session_ttl: 0 (default) to disable automatic reaping.
You can also call bot._session.reap_stale(max_age_seconds) manually.YAML Configuration
Deploy bots entirely from YAML — including agent memory, tools, roles, and multi-platform config.- Full YAML
- Python loader
Supported agent fields
Supported agent fields
| Field | Type | Description |
|---|---|---|
name | string | Agent display name |
role | string | Role/job title |
goal | string | Primary objective |
backstory | string | Background context |
instructions | string | Direct instructions |
llm | string | Model name (gpt-4o-mini, claude-3-sonnet) |
memory | bool/dict | Memory config (true or {history: true}) |
tools | list | Tool names from praisonaiagents.tools |
knowledge | list | Knowledge sources |
guardrail | string | Output validation |
Environment variable syntax
Environment variable syntax
Use
${ENV_VAR} in YAML values — resolved at load time.Tool Approval via Messaging
When your bot agent uses dangerous tools (e.g.execute_command), you can route approval requests to Slack:
See Approval Protocol for full configuration options.
Related
Bot Rate Limiting
Prevent 429 errors with platform-aware rate limiting
Send Policy
Authorise where bots may send — allow/deny guard for send_message
Approval Protocol
Tool execution approval system
Gateway
Multi-agent coordination
Webhooks
Event-driven integrations
Bot Platform Capabilities
How platform capabilities drive this feature
Channel Descriptor
Let a channel plugin declare its config, prompt hint, and setup wizard
Bot Session Compaction
Summarise old turns instead of dropping them
Outbound Media Delivery
Deliver agent-generated images and files to users on Telegram, Slack, and Discord

