Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Gateways

Gateways handle communication between users and agents. Duragent separates core gateways (built-in) from platform gateways (plugins).

Core Gateways (Built-in)

These protocols ship with Duragent:

GatewayUse Case
CLILocal development, duragent chat, duragent attach
HTTP RESTProgrammatic access, webhooks, Admin API
SSEReal-time LLM token streaming

Platform Gateways (Plugins)

Platform-specific integrations (Telegram, Discord, etc.) run as separate processes communicating via the Gateway Protocol — JSON Lines over stdio.

┌──────────────────────────────────┐
│           Duragent               │
│  ┌────────────────────────────┐  │
│  │   Core Gateways (built-in) │  │
│  │   CLI │ HTTP REST │ SSE    │  │
│  └────────────────────────────┘  │
│              │                   │
│       Gateway Protocol           │
│      (JSON Lines / stdio)        │
│              │                   │
└──────────────┼───────────────────┘
               │
    ┌──────────┼──────────┐
    ▼          ▼          ▼
[Telegram]  [Discord]  [others]
 (plugin)   (plugin)   (plugin)

This design means:

  • Gateway crashes don’t affect core — plugins are isolated processes
  • Any language — plugins can be written in Rust, Python, Go, etc.
  • Independent releases — plugins ship separately from Duragent core
  • Lightweight core — platform SDKs aren’t bundled in the main binary

Gateway Protocol

Plugins communicate with Duragent using JSON Lines over stdin/stdout:

DirectionMessage Types
Duragent to pluginsend_message, send_media, send_typing, edit_message, delete_message, answer_callback_query, ping, shutdown
Plugin to Duragentready, message_received, callback_query, command_ok, command_error, pong, error, auth_required, auth_success, shutdown

First-party plugins (Telegram, Discord) are written in Rust and ship as standalone binaries. Third-party plugins can use any language.

Available Gateways

GatewayStatusCrate
CLIBuilt-induragent
HTTP RESTBuilt-induragent
SSEBuilt-induragent
TelegramPluginduragent-gateway-telegram
DiscordPluginduragent-gateway-discord

For setup instructions, see Gateway Setup. For configuration details, see Gateway Plugins.