Published on
Abinyah Walker

Ce billet n'a pas encore été traduit en français.

Putting a Hermes Agent in Slack: the setup we actually run

We run our research agent in Slack every day, and people keep asking how it is wired. This is the short version of what we actually run — not a generic tutorial.

The interesting part is what it doesn't need: no public URL, no TLS certificate, no tunnel. Hermes talks to Slack over Socket Mode — an outbound WebSocket the agent opens to Slack, rather than Slack calling in.

.The short version

  • Socket Mode out, not webhooks in. The agent connects outbound, so it runs happily behind a home router with no domain at all.

  • Two tokens, not one. A bot token to post and read, and an app-level token to open the socket.

  • One process that must stay alive. A launchd service, respawning on crash.

.What you need

  • A working Hermes install. Get the CLI answering a prompt before you touch Slack — never debug two things at once.

  • A Slack workspace where you can install an app.

  • Ten minutes, and the ability to paste a JSON manifest.

.Wire it up

  1. Create the app from a manifest. In Slack's app settings, choose From an app manifest and paste the one Hermes ships. It sets all 16 bot scopes and 7 event subscriptions atomically, so you cannot half-install it.

  2. Install it, then collect two tokens. The bot token from OAuth & Permissions, and an app-level token with the connections:write scope. That second scope is the one people miss — without it the socket opens and immediately dies with no obvious cause.

  3. Put the tokens in .env. Hermes reads secrets from its own env file, never from the repository. Keep that file out of git.

  4. Point config.yaml at Slack. Add slack to the gateway's platform list, then decide the mention policy. require_mention: true means the agent answers only when @mentioned in a channel — the right default. DMs always work regardless.

  5. Run it as a service. On macOS that is a launchd LaunchAgent with RunAtLoad and KeepAlive. Set PATH explicitly inside it — launchd hands you a bare environment, and that is exactly why skills that work in your shell fail under the service.

.One agent, or two

Hermes profiles let a single install run more than one Slack identity, each with its own config, tokens and memory. We run two: the main agent on cloud models, and a local-only twin that never leaves the machine, so anything sensitive stays here. Same machine, two Slack apps, no shared state.

.The traps we hit

  • Silent in channels, fine in DMs. Almost always a missing message.channels event subscription. Reinstall after adding it.

  • Duplicate replies to one message. Two gateway processes fighting over one socket. Always start with --replace.

  • A config edit that changes nothing. Tokens and config are read at process start. Restart, every time.

  • A scary warning in the log. The channel-directory lookup fails constantly and is harmless. We lost an hour to it so you do not have to.

.Why we teach this

This is the shape of the work we care about at myDMDi: one person, one afternoon, one useful agent — then teaching the next person how. Socket Mode is what makes that possible on a laptop in a community hub, with no infrastructure bill attached.

.Dans Slack, sans serveur

Socket Mode veut dire pas d'URL publique, pas de certificat, pas de tunnel : c'est l'agent qui ouvre la connexion vers Slack, pas l'inverse. Un installeur, deux jetons, et un service qui redémarre tout seul.

Ateliers en français à venir | French-language workshops coming soon.

← Retour aux billets