Deployment
Deploying the integration is three steps: create a DonutChat bot, run a Hermes Agent, and run the bridge that connects them. You can run the bridge locally for testing or as a flag-gated ECS service in production.
Prerequisites
Section titled “Prerequisites”- A DonutChat bot and its
donutbot_…token (created in the app or via the bot management API). - A reachable Hermes Agent instance with the OpenAI-compatible API server enabled.
- The chat(s) the bot should answer in, with the bot added as a member.
1. Create and place the bot
Section titled “1. Create and place the bot”- Create a bot in the DonutChat app (Bots → New) and copy its
donutbot_…token — it is shown once. - Add the bot to each chat it should respond in.
- Set the bot’s trigger mode per chat:
mention(default) — replies only when@mentioned.all— replies to every message (use for 1:1 DMs).manual— never auto-replies.
See Bot Receive for the full trigger-mode semantics.
2. Run a Hermes Agent
Section titled “2. Run a Hermes Agent”Stand up Hermes per its own docs and enable the API server:
API_SERVER_ENABLED=true(listens on port8642by default).- Set
API_SERVER_KEY— this becomes the bridge’sHERMES_API_KEY.
3. Run the bridge
Section titled “3. Run the bridge”The bridge is a subcommand of the main binary. It is stateless (no database) and reads all settings from the environment — see the Configuration reference.
export DONUT_BOT_TOKEN="donutbot_…"export DONUT_STREAM_URL="wss://api.donutchat.com/bots/v1/stream"export DONUT_SEND_URL="https://api.donutchat.com/bots/v1/messages"export DONUT_TYPING_URL="https://api.donutchat.com/bots/v1/typing" # optional; enables the thinking indicatorexport HERMES_BASE_URL="http://hermes-host:8642"export HERMES_API_KEY="…"export HERMES_MODEL="hermes"
go run main.go hermes-bridgeOn start the bridge validates its configuration (missing required values fail fast with a clear error), connects to the bot stream, and begins forwarding triggered messages. Stop it with SIGINT/SIGTERM for a graceful shutdown.
4. Deploy on ECS (production)
Section titled “4. Deploy on ECS (production)”The bridge ships as a flag-gated ECS Fargate service defined in infra/. It is disabled by default; enable it once a Hermes box is reachable. Secrets are pulled from AWS Secrets Manager, never baked into the task definition.
Set the Terraform variables and apply:
hermes_bridge_enabled = truehermes_bridge_bot_token = "donutbot_…" # sensitive → Secrets Managerhermes_bridge_api_key = "…" # sensitive → Secrets Manager
# Endpoints (sensible production defaults already set)hermes_bridge_stream_url = "wss://api.donutchat.com/bots/v1/stream"hermes_bridge_send_url = "https://api.donutchat.com/bots/v1/messages"hermes_bridge_typing_url = "https://api.donutchat.com/bots/v1/typing"hermes_bridge_hermes_base_url = "http://hermes.internal:8642" # private addresshermes_bridge_model = "hermes"cd infraterraform applyTerraform creates the ECS service, task definition, and the hermes_bridge secret holding bot_token and hermes_api_key. The non-secret URLs and model are passed as plain environment variables on the task.
Verify end to end
Section titled “Verify end to end”- In a chat the bot belongs to (trigger mode
mention), post@yourbot hello. - You should see the bot’s typing indicator, then a markdown reply attributed to the bot with a BOT badge.
- Stop the Hermes box and
@mentionagain — you should get the graceful fallback message, not silence and not a raw error.
If something is off, see Operations & troubleshooting.