Quick Start
- CLI (No Code)
- Python SDK
Start a bot with a single command - no Python code required:A default agent is created automatically with basic assistant capabilities.agents.yaml:
1
Set Environment Variables
2
Start the Bot
3
(Optional) Custom Agent
Supported Platforms
Bot Runtimes (Bidirectional — Send + Receive)
Outbound Tools (Send-Only — Bot Runtime 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 labelsTwo different flows can prepend a recovered-reply marker after a gateway restart:
- Durable Delivery with
mark_recovered=True(opt-in) —♻️ Recovered reply — the gateway restarted during delivery, so this may be a duplicate.See Durable Delivery. - Outbound DLQ boot recovery (on by default) —
♻️ Recovered after restart — this reply may be a duplicate.See Outbound Resilience → Automatic crash-recovery on start.
Inbound Media → Vision
Both WhatsApp and Telegram bots forward photos and documents directly to your agent’s vision capability. On Telegram, a media album is coalesced into a single turn — see Media Albums.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
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
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:
Opting out
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: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
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/commandsobserve— Bot stays silent likemention_only, but keeps unmentioned group messages as passive context so it can answer with full awareness when next mentioned (Telegram only). Seeobserve: passive group context.
group_policy per channel in gateway.yaml. See Bot Gateway → Channel Security.Sender name sanitisation is on by default. Display names in group / multi-party chats are neutralised (newlines collapsed, control chars stripped, length-bounded to 240) before they are interpolated into the
[{sender}] attribution prefix, so a hostile name can’t masquerade as a fake system directive. See Sender Attribution Sanitisation for details.For the full owner-approval workflow (inline buttons on Telegram / Discord / Slack, HMAC signing, CLI fallback), see Bot Unknown-User Pairing.
Access-check methods
BotConfig exposes two allowlist checks with distinct purposes:
Custom adapters should guard the pairing flow with
is_explicitly_allowed() so a policy-allowed unknown user still gets pairing/deny semantics — PR #2856.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
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:Telegram also ships
/automations and /blueprint for consent-first scheduled automations — see Automation Suggestions. Other adapters don’t register these yet.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
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
Discord
Slack
- Cloud API (default)
- Web Mode (experimental)
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.New: gateway does this for you
New: gateway does this for you
If you set
channels.<platform>.allow_shell: true with auto_approve_shell: false, the gateway now wires SlackApproval / TelegramApproval / DiscordApproval automatically — no Python glue required. And auto_approve_shell: true is automatically downgraded to the same wiring on externally-bound gateways or channels with a group_policy, unless auto_approve_shell_acknowledge_exposed: true opts in. See Bot Shell Execution.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
1
Paragraph boundaries
Split at blank lines (
\n\n) first — keeps ideas together.2
Sentence boundaries
If a paragraph is still too long, split at sentence endings (
. ).3
Hard split
Last resort: character-level split for very long single lines.
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
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.
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
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
Ask Conversation
Let agents ask another chat a question mid-turn and act on the reply
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

