Skip to content

Messaging Gateway

Send a message, get an AI reply with full workspace tools. The Messaging Gateway lets you run Ptah from your phone, your team chat, or anywhere else you can text.

PlatformAdapterVoice messages
TelegramBot APIYes
Discorddiscord.js-compatibleYes
Slack@slack/bolt Socket ModeYes
  • Pairing — first inbound message from a new sender produces a 6-digit code; you approve the binding in the Bindings UI before any agent work happens
  • Voice — audio attachments are decoded with ffmpeg and transcribed by nodejs-whisper
  • One reply per turn — the agent’s output is accumulated while it works and delivered as a single message when the turn completes (see Stream coalescing)
  • Auto-approved tools — gateway turns run with tool use auto-approved; there is no per-tool prompt to answer from chat. This is why pairing and allowlists are strict, and why the gateway ships disabled by default
  • Turn ceiling — a turn that produces nothing for 10 minutes is stopped automatically and you get an error reply; the conversation stays usable and your next message runs normally

Sessions & workspaces from chat (Discord-only for now)

Section titled “Sessions & workspaces from chat (Discord-only for now)”

On Discord, each thread is its own Ptah session, and five slash commands (/sessions, /session use, /new, /workspace list, /workspace use) let you re-point a thread at an existing session, start fresh, or switch which workspace the thread targets — validated against a closed allowlist of folders you’ve opened in the desktop app. See Discord Setup for the full command reference. Telegram and Slack keep today’s plain-message behavior; command parity there is a planned follow-up.

The gateway ships with gateway.enabled = false. Each platform also has its own gateway.<platform>.enabled flag. Both must be true for that platform to connect.

This is intentional. Bots-with-tools are a real attack surface — opt-in only.

  1. Create a bot / app on the platform (instructions per-platform: Telegram · Discord · Slack)
  2. Paste tokens into Settings → Messaging → [platform]
  3. Whitelist the user / guild / team IDs you want to allow
  4. Enable the platform, then enable the gateway
  5. Send a message → approve the pairing code → start working