praisonai-bot Package Migration
Where bots, gateway, and channel CLI live after the C9 extraction from the praisonai wrapper into a new sibling PyPI package
praisonai-bot is a new sibling PyPI package holding the bots, gateway, and channel CLI — extracted from the praisonai wrapper — and every existing import still works via alias_package shims.
from praisonaiagents import Agent
agent = Agent(
name="Support",
instructions="Answer support questions from users on Telegram, Slack, and Discord.",
model="gpt-4o-mini",
)
agent.start("Hello — reply if you see this.")A gateway process running praisonai-bot gateway start routes each Telegram/Slack/Discord message to this agent and posts the reply back.
graph LR
Agents[praisonaiagents<br/>Core SDK] --> Code[praisonai-code<br/>Terminal CLI]
Agents --> Bot[praisonai-bot<br/>Bots / Gateway / Channels]
Code --> Main[praisonai<br/>Wrapper + shims]
Bot --> Main
WB["_wrapper_bridge"] -.->|optional dep| Main
CB["_code_bridge"] -.->|optional dep| Code
classDef pkg fill:#8B0000,stroke:#7C90A0,color:#fff
classDef bridge fill:#189AB4,stroke:#7C90A0,color:#fff
classDef core fill:#6366F1,stroke:#7C90A0,color:#fff
class Agents core
class Code,Bot,Main pkg
class WB,CB bridgeQuick Start
- Nothing changes if you install the wrapper
pip install praisonaipulls inpraisonai-bottransitively. Every existing command still works:bash pip install praisonai praisonai bot serve --config bot.yaml praisonai serve gateway --config gateway.yaml - Standalone install for headless workers or containers
Install only what your container needs:
bash pip install praisonai-bot[gateway,bot] praisonai-bot gateway start --config gateway.yaml praisonai-bot bot start --config bot.yaml - Agent-centric example — route messages from any channel
python from praisonaiagents import Agent agent = Agent( name="Support", instructions="Answer support questions from users on Telegram, Slack, and Discord.", model="gpt-4o-mini", ) agent.start("Hello — reply if you see this.")Run the gateway alongside it:
bash praisonai-bot gateway start --agents agents.yamlMessages arrive from any configured channel, the agent replies, and the gateway posts the response back.
How It Works
sequenceDiagram
participant U as User (Telegram)
participant GW as praisonai-bot gateway
participant A as praisonaiagents.Agent
U->>GW: incoming message
GW->>A: Agent.run(message)
A-->>GW: reply text
GW-->>U: outbound messageThe gateway is the only process that holds channel credentials. Agents never talk directly to Telegram, Slack, or Discord — they receive plain text and return plain text. The gateway handles platform-specific formatting, rate-limiting, and delivery guarantees.
Which install shape is right for me?
graph TB
Start{What do I need?}
Start -->|Full CLI + all commands| Full["pip install praisonai<br/>→ praisonai bot serve<br/>→ praisonai serve gateway"]
Start -->|Small container — gateway only| GW["pip install praisonai-bot[gateway]<br/>→ praisonai-bot gateway start"]
Start -->|Small container — bots only| BotOnly["pip install praisonai-bot[bot]<br/>→ praisonai-bot bot telegram ..."]
Start -->|Existing code with praisonai.bots imports| Shim["No change required<br/>alias_package shims keep working"]
Start -->|Writing a new channel adapter| Plugin["Publish entry-point:<br/>praisonai.channels group<br/>(see Extending below)"]
classDef pkg fill:#8B0000,stroke:#7C90A0,color:#fff
classDef shim fill:#F59E0B,stroke:#7C90A0,color:#fff
classDef plugin fill:#189AB4,stroke:#7C90A0,color:#fff
classDef start fill:#6366F1,stroke:#7C90A0,color:#fff
class Full,GW,BotOnly pkg
class Shim shim
class Plugin plugin
class Start startCompatibility Guarantees
Every existing import path continues to resolve. No code changes required.
| Old path (still works) | Resolves to |
|---|---|
from praisonai.bots import Bot | praisonai_bot.bots.Bot |
from praisonai.bots.telegram import TelegramBot | praisonai_bot.bots.telegram.TelegramBot |
from praisonai.gateway import GatewayConfig | praisonai_bot.gateway.GatewayConfig |
from praisonai.gateway.server import GatewayServer | praisonai_bot.gateway.server.GatewayServer |
from praisonai.daemon import ... | praisonai_bot.daemon.* |
| CLI command modules (bot / gateway / channels) | praisonai_bot.cli.commands.* |
pip install praisonairemains the canonical user-facing install.praisonai.bots.,praisonai.gateway.,praisonai.daemon.are stable API — they arealias_packageshims backed bypraisonai_bot..- Shim registration is safe under concurrent module imports — if another thread mutates
sys.moduleswhile shims are being installed (e.g. an async client loading modules during a parallel test run), the shim retries the snapshot and falls back to key-by-key reads instead of raisingRuntimeError: dictionary changed size during iteration. praisonai-bothas no hard PyPI dependency onpraisonai— no import cycle.- Any access that
praisonai-botneeds into the wrapper goes through_wrapper_bridgeat call time, degrading gracefully when the wrapper is absent.
New CLI: praisonai-bot
The praisonai-bot binary is separate from the praisonai binary. It exposes:
praisonai-bot
├── bot Start messaging bots with full agent capabilities
│ ├── start Start a bot from a YAML config file (zero-code)
│ ├── telegram Start a Telegram bot
│ ├── discord Start a Discord bot
│ ├── slack Start a Slack bot
│ └── ...
├── gateway Manage the PraisonAI gateway server
│ ├── start Start the gateway server
│ ├── stop Stop a running gateway instance
│ └── status Check gateway and daemon status
├── pairing Manage bot pairing
├── identity Manage bot identity
├── onboard Onboard a new bot
├── kanban Kanban integration
├── claw Channel-agnostic bot operations
└── mint-link Mint magic linksExamples:
praisonai-bot gateway start --config gateway.yaml
praisonai-bot gateway start --agents agents.yaml --port 9000
praisonai-bot gateway stop
praisonai-bot gateway status
praisonai-bot bot start --config bot.yaml
praisonai-bot bot telegram --token $TELEGRAM_BOT_TOKEN --model gpt-4o-mini
praisonai-bot bot slack --token $SLACK_BOT_TOKEN --memory
praisonai-bot mint-link # hyphen form (matches --help output)
praisonai-bot mint-link --ttl 600 # with custom TTL
praisonai-bot mint_link # underscore form (backward-compatible)Extending: Register a New Channel
praisonai-bot discovers channel adapters via the praisonai.channels entry-point group at startup. No changes to praisonai-bot itself are needed.
To publish a third-party channel adapter, add an entry-point in your package’s pyproject.toml:
[project.entry-points."praisonai.channels"]
mattermost = "my_pkg.mattermost:MattermostBot"The gateway/bot loader calls entry_points(group="praisonai.channels") on startup and registers every discovered adapter automatically.
Built-in Channels
| Entry-point key | Class |
|---|---|
telegram | praisonai_bot.bots.telegram:TelegramBot |
discord | praisonai_bot.bots.discord:DiscordBot |
slack | praisonai_bot.bots.slack:SlackBot |
whatsapp | praisonai_bot.bots.whatsapp:WhatsAppBot |
linear | praisonai_bot.bots.linear:LinearBot |
email | praisonai_bot.bots.email:EmailBot |
agentmail | praisonai_bot.bots.agentmail:AgentMailBot |
Behavior changes
Recent fixes to the praisonai bot ... CLI that operators upgrading should know about:
| Change | What to expect |
|---|---|
| Declared platform wins | bot start respects the config’s platform: even when the token comes from the environment. Other platforms are no longer auto-enabled from unrelated credentials — a warning names each one skipped. |
token: is optional | Omit token: and the declared platform: resolves its own documented env var (TELEGRAM_BOT_TOKEN, etc.). |
| Slack app token required | bot slack now errors early if --app-token / SLACK_APP_TOKEN is missing (previously it silently subscribed to nothing). |
| Non-blocking bots stay up | linear, email, agentmail, webhook, and WhatsApp cloud no longer exit 0 in ~1s — the loop is held open while the adapter runs. |
| Non-zero exit codes | Any startup failure now exits 1, so systemd Restart=on-failure and if praisonai bot ... ; then scripting work. |
New bot run verb | praisonai bot run --platform <name> starts any registered platform — including local, signal, webhook, plugin channels, and adapter: drop-ins. Declared channel config_fields (including plugin/registry channels) are also accepted as --field-name flags. See praisonai bot run. |
Best Practices
Keep using praisonai.bots / praisonai.gateway in library code
Application and library code should continue to import from praisonai.bots, praisonai.gateway, and praisonai.daemon. These paths are the stable public API backed by alias_package shims. praisonai_bot.* is an alternative available path, not a replacement — the shim layer allows the physical package layout to evolve without breaking callers.
Use praisonai-bot extras for headless workers
For containers or workers that don’t need the full praisonai wrapper, install only the extras you need:
pip install praisonai-bot[gateway]— WebSocket gateway only (~200 MB fewer transitive deps than the full wrapper).pip install praisonai-bot[bot]— messaging platform adapters only.pip install praisonai-bot[gateway,bot]— full inbound-and-outbound flow.pip install praisonai-bot[all]— shortcut for[gateway,bot].
Extras are additive — install only what you need
[gateway] pulls in FastAPI, uvicorn, SSE-starlette, websockets, watchdog, and redis. [bot] pulls in python-telegram-bot, discord.py, slack_sdk, slack-bolt, and psutil. Installing both is safe and additive. [bot-whatsapp-web] adds neonize and qrcode for WhatsApp Web support.
Alias shims are load-bearing — do not remove them as cleanup
praisonai.bots, praisonai.gateway, and praisonai.daemon are alias_package shims in the wrapper. Removing or rewriting imports away from these paths in your own code is not a “cleanup” — they are the stable API. praisonai_bot.* is a new alternative surface for users who want the standalone install shape.
Related
The C0–C6 sibling extraction that moved the agentic terminal CLI into its own package
Python WrapperThe praisonai wrapper — four-tier architecture reference for contributors
GatewayGateway and control plane — WebSocket server, config, and deployment
Messaging BotsBot platform documentation — Telegram, Discord, Slack, WhatsApp, and more