Skip to main content
Two ways to deploy AI agents for real-time communication: Bot for messaging platforms, Gateway for custom applications.

Quick Comparison

FeatureBotGateway
Use CaseMessaging platformsCustom applications
PlatformsTelegram, Discord, SlackAny WebSocket client
UsersSingle-user conversationsMulti-user, multi-agent
ProtocolPlatform-specificWebSocket
CLIpraisonai bot <platform>praisonai serve gateway

When to Use Bot

Team Communication

Deploy to Slack/Discord for team assistants

Customer Support

Telegram bots for customer interactions

Personal Assistant

Single-user conversational AI

Quick Deployment

One command to production
# Deploy to Telegram in one command
praisonai bot telegram --token $TELEGRAM_BOT_TOKEN --memory --web

When to Use Gateway

Web Applications

Custom chat interfaces and dashboards

Multi-Agent Systems

Coordinate multiple specialized agents

Real-time Dashboards

Live updates and streaming responses

Custom Protocols

Full control over communication
# Start gateway for custom applications
praisonai serve gateway --port 8765

Architecture Deep Dive

Key Points:
  • Platform handles user authentication
  • Bot receives messages via webhook or polling
  • Multi-agent routing per bot (dm → agent A, group → agent B)
  • Platform-specific features (reactions, threads, etc.)

Feature Comparison

Capabilities Support

CapabilityBotGateway
Memory--memory✅ Session state
Knowledge/RAG--knowledge✅ Per-agent
Tools--tools✅ Per-agent
Web Search--web✅ Per-agent
Browser--browser✅ Per-agent
Thinking Mode--thinking✅ Per-agent
Multi-Agent✅ Context-based routing✅ Multiple agents with routing
Multi-Platform✅ All 4 platforms concurrently✅ WebSocket + bots
Custom UI❌ Platform UI✅ Full control

Deployment

AspectBotGateway
SetupPlatform token requiredNo external deps
ScalingMultiple bots per platform via platform: fieldMultiple clients per gateway
AuthPlatform handlesYou implement
SSLPlatform handlesYou configure

Code Examples

from praisonai.bots import TelegramBot
from praisonaiagents import Agent

# Create agent with capabilities
agent = Agent(
    name="assistant",
    instructions="You are a helpful assistant.",
    memory=True,
    knowledge=["./docs/"]
)

# Deploy to Telegram
bot = TelegramBot(
    token="YOUR_BOT_TOKEN",
    agent=agent
)

# Start bot
await bot.start()
CLI equivalent:
praisonai bot telegram --token $TOKEN --memory --knowledge

Migration Guide

Bot to Gateway

Moving from bot to gateway for more control:
1

Extract Agent Configuration

# agents.yaml
agents:
  - name: assistant
    instructions: Your current bot instructions
    memory: true
    tools:
      - search_web
2

Start Gateway

praisonai serve gateway --port 8765 --agents agents.yaml
3

Connect Your Client

const ws = new WebSocket('ws://localhost:8765/ws');

ws.onopen = () => {
  ws.send(JSON.stringify({
    type: 'join',
    agent_id: 'assistant'
  }));
};

ws.onmessage = (event) => {
  const data = JSON.parse(event.data);
  console.log('Response:', data.content);
};

Decision Tree