Skip to content

Platform Integrations

The message gateway connects platform channels to agents. When a message arrives:

  1. Route resolution — Match platform + channel ID to an agent
  2. Rate limiting — Check per-user and global rate limits
  3. Credit check — Verify minimum $0.50 balance
  4. Session loading — Create or resume conversation session
  5. Flow execution — Run the agent’s CAFF flow
  6. Response delivery — Send the response back to the platform
PlatformAdapterFeatures
TelegramBot APIText, inline keyboards, files
DiscordBot gatewayText, embeds, reactions, threads
SlackBot eventsText, blocks, file sharing
TwitterAPI v2Mentions, replies, monitoring
RedditAPIPosts, comments, keyword monitoring

Routes map a platform channel to an agent using the key format PLATFORM:channelId:

TELEGRAM:123456789 → Agent A
DISCORD:987654321 → Agent B
SLACK:C01234567 → Agent C
TELEGRAM:* → Agent D (catch-all)
  1. Exact matchPLATFORM:channelId matches a specific route
  2. Catch-allPLATFORM:* handles unmatched channels on that platform
  • Agent must be in ACTIVE state
  • User must have sufficient credits ($0.50 minimum)
  • Channel must pass allowlist check (if configured)

Sessions track conversation state per user per platform:

  • Persistent chat history
  • Flow variable state
  • Platform-specific context (user ID, channel, thread)