ClawdBot Gateway Architecture

Unified AI interface across all messaging platforms. One bot, multiple channels.

🌐 What is the Gateway?

The ClawdBot Gateway is the central hub that connects all messaging platforms to your AI backend.

Key Features

  • βœ… Unified conversation context across platforms
  • βœ… Automatic message routing
  • βœ… Cross-platform user identity
  • βœ… Load balancing and rate limiting
  • βœ… Message queue management

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         Messaging Platforms             β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Telegram β”‚ WhatsApp β”‚ Discord  β”‚ iMessageβ”‚
β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”¬β”€β”€β”€β”˜
     β”‚          β”‚          β”‚          β”‚
     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β”‚
            β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚   Gateway      β”‚
            β”‚   (Router)     β”‚
            β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β”‚
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚              β”‚              β”‚
β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”
β”‚ Claude  β”‚  β”‚   GPT-4   β”‚  β”‚ Gemini  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“± Supported Channels

Channel Status Features
Telegram βœ… Full Support Bots, groups, inline
WhatsApp βœ… Full Support Personal, groups
Discord βœ… Full Support Servers, DMs, slash commands
iMessage (macOS) βœ… macOS Only Personal messages
Slack ⚠️ Beta Workspaces
Matrix ⚠️ Experimental Federated chat

πŸ”€ Message Routing

Basic Routing

# config.yaml
gateway:
  routing:
    # Default AI provider
    default: "anthropic"
    
    # Route by channel
    byChannel:
      telegram: "claude-3-5-sonnet"
      whatsapp: "gpt-4"
      discord: "gemini-pro"

Advanced Routing

gateway:
  routing:
    rules:
      # Route coding questions to Claude
      - pattern: "code|debug|refactor"
        provider: "anthropic"
        model: "claude-3-5-sonnet"
      
      # Route creative tasks to GPT-4
      - pattern: "write|story|creative"
        provider: "openai"
        model: "gpt-4"
      
      # Route simple questions to Gemini (cheap)
      - pattern: "what|when|where|who"
        provider: "google"
        model: "gemini-1.5-flash"

βš™οΈ Gateway Configuration

# config.yaml
gateway:
  port: 3000
  host: "0.0.0.0"
  
  # Channels
  channels:
    telegram:
      enabled: true
    whatsapp:
      enabled: true
    discord:
      enabled: true
  
  # Rate limiting
  rateLimit:
    enabled: true
    maxRequestsPerMinute: 60
    maxRequestsPerHour: 1000
  
  # Queue management
  queue:
    enabled: true
    maxSize: 1000
    processingTimeout: 60000
  
  # Logging
  logging:
    level: "info"
    format: "json"

❓ Gateway FAQ

Can I use multiple AI providers simultaneously?
Yes! Configure routing rules to use different providers for different tasks or channels.
Does conversation context persist across platforms?
Yes, if you link user identities across platforms in config.
How do I add a new messaging platform?
Create a channel adapter following the ClawdBot channel API. See developer docs.

πŸ“š Related Guides