Skip to main content
The gateway now ships in the praisonai-bot package. praisonai serve gateway still works exactly as documented here; for a standalone install see praisonai-bot Migration.
Deploy a Hermes-style AI workforce using PraisonAI Gateway with multiple specialized Telegram bots, each serving different business functions while sharing common knowledge.
The user chats on Telegram; multichannel routing delivers the same agent logic across Telegram chats.

Workforce Layout

Quick Start

1

Create Multiple Telegram Bots

Create three separate bots with @BotFather:
Save each token separately - never reuse tokens between bots.
2

Configure Multi-Channel Gateway

Create gateway.yaml with Hermes workforce pattern:
3

Configure Environment

Create .env file with all required tokens:
If you leave TELEGRAM_ALLOWED_USERS empty, you must also set unknown_user_policy: "allow" for the bot to reply to anyone (since PR #1885). For production, set TELEGRAM_ALLOWED_USERS to your user IDs and leave unknown_user_policy at the default "deny".
4

Launch Workforce Gateway

Start the single gateway process:
All three bots will start simultaneously through one gateway process.

How Multi-Channel Works

Routing Logic

Each channel routes to its specialized agent:

Knowledge Architecture

Dual-Brain RAG Pattern

Each agent accesses both shared and private knowledge:
Company-wide information accessible to all agents:
All agents can search this knowledge for general company context.
CFO agent exclusive access:
Only accessible via CFO bot (@your_company_cfo_bot).
Ops agent exclusive access:
Only accessible via Ops bot (@your_company_ops_bot).
Content agent exclusive access:
Only accessible via Content bot (@your_company_content_bot).

Golden Rules for Workforce Deployment

Single Gateway Instance

Critical: Run only one gateway process per machine. Why: Multiple gateways cause conflicts:
  • Both bind to port 8765 (port collision)
  • Both poll same Telegram tokens (409 Conflict errors)
  • Session state becomes inconsistent
  • Bot stops responding mid-conversation
Verification:

Unique Tokens per Channel

Each Telegram channel requires its own bot:

Response Latency Expectations

Normal behavior: First reply takes 20-30 seconds for RAG queries. Why the delay:
  1. Knowledge base search (5-8 seconds)
  2. Context preparation (2-3 seconds)
  3. LLM processing (10-15 seconds)
  4. Response formatting (1-2 seconds)
User experience notes:
  • Typing indicator disappears after ~5 seconds (known limitation)
  • Do NOT send duplicate messages during processing
  • Do NOT restart gateway if response is delayed
  • Typing indicator renewal fix is pending in PraisonAI

Advanced Configuration

User Access Control

Configure per-channel user allowlists:
Environment variables:
Security: As of PR #1835, the gateway polling path enforces allowed_users for both text messages and built-in commands (/help, /status, /new). Unauthorized users are silently dropped at the security pipeline.

Custom Knowledge Tools

Configure specialized search tools per agent:

Performance Tuning

Optimize for multi-channel deployment:

Monitoring and Troubleshooting

Health Check Interpretation

Comprehensive health monitoring:
Expected response for 3-channel deployment:

Common Multi-Channel Issues

Symptoms: One bot works, others silentCauses:
  • Missing environment variables for non-working bots
  • Incorrect token in .env file
  • BotFather token typos
Debugging:
Symptoms:
  • All bots work initially
  • Random bots stop responding
  • Logs show: Conflict: terminated by other getUpdates request
Cause: Duplicate gateway processes or token reuseSolution:
Symptoms: Agents respond but can’t find company informationDebugging:
Symptoms:
Solution:

Log Analysis

Monitor gateway logs for multi-channel issues:

Best Practices

Use clear naming conventions:
This helps users understand which bot to contact for specific needs.
Configure helpful bot descriptions in BotFather:
Configure welcome messages for new users:
Track performance for 3-channel deployment:

Migration from Hermes

Configuration Mapping

If migrating from Hermes agent setup:

Feature Parity

PraisonAI Gateway provides equivalent functionality: Supported:
  • Multi-channel deployment (3+ bots)
  • Specialized agent routing
  • Shared + private knowledge bases
  • WebSocket coordination
  • Health monitoring
  • User access control
⚠️ Different implementation:
  • Knowledge search uses different indexing
  • Tool system has different syntax
  • Session management works differently
Not yet available:
  • Real-time typing indicator renewal
  • Advanced analytics dashboard
  • Multi-tenancy features

Gateway Overview

Core gateway concepts

Windows Deployment

Windows-specific setup guide