Skip to main content
Register any Agent on a standalone WebSocket gateway with three imports and one asyncio.run().

Quick Start

1

Install

2

Set credentials

3

Register an agent on the gateway

4

Verify the gateway is running

The response confirms the gateway is live with the registered agent.

How It Works

The gateway routes messages from any connected channel to the registered agent. The agent never knows which channel the message came from — it just receives text and returns a response.

Configuration Options

GatewayConfig fields

WebSocketGateway.register_agent() parameters

Returns: The agent_id string used for registration.

CLI Equivalent

praisonai-bot gateway start is the canonical CLI command. When the praisonai wrapper is co-installed, praisonai gateway start is an alias that delegates to the bot tier.

Common Patterns

Multiple agents on one gateway

Custom agent ID


Imports: bot-first and wrapper shims

praisonai_bot.gateway is the canonical import for the WebSocketGateway class. When praisonai is installed alongside praisonai-bot, from praisonai.gateway import WebSocketGateway works as a backward-compatible shim.

Best Practices

Assign explicit agent_id values. Channel clients connect by agent ID — changing it after deployment disconnects existing sessions.
host="127.0.0.1" (loopback) is safe for local development. For production, bind to 0.0.0.0 only behind a reverse proxy with TLS termination.
The health endpoint (http://host:port/health) returns 200 OK when the gateway is ready. Use it in your load balancer or process manager health check.
For multi-agent, multi-channel setups, use the standalone YAML format instead of Python to keep credentials and topology out of code.See Standalone Bot YAML for details.

Standalone Bot YAML

Declarative gateway + agent + channels config

Gateway CLI

CLI commands for starting and managing the gateway

BotOS

Multi-platform bot orchestration

praisonai-bot SDK

Full bot-tier SDK reference