← the memory
systems ·

Multi-Channel AI Setup with Hermes Agent

Run one AI model across multiple Slack channels with isolated context per room. No @mentions, no leakage between topics.

#hermes#slack#ai#ops#multi-channel

Multi-Channel AI Setup with Hermes Agent

One model. Multiple channels. Isolated context per room.


What This Does

You have one Slack workspace. You want one AI assistant that behaves differently in different channels:

  • #finance → financial planning, budget tracking
  • #engineering → code review, architecture decisions
  • #learning → documentation, learning, ops

Messages in one channel never leak into another. Each room is a separate conversation. The AI responds without @mentions — just type.


Prerequisites

  • Hermes Agent installed and running (https://hermes-agent.nousresearch.com/docs)
  • Slack workspace where you are admin or have app management rights
  • Time: 15–30 minutes if everything goes right. We spent 2–3 hours across multiple sessions. The hope is this guide compresses that into one sitting.

Step-by-Step

Step 1: Create Slack App

  1. Go to https://api.slack.com/apps
  2. Create New App → From scratch
  3. Name it, select your workspace

Step 2: Enable Socket Mode

  1. Left sidebar → Socket Mode
  2. Toggle Enable Socket Mode → ON
  3. Generate an App-Level Token with scope connections:write
  4. Copy the xapp-1-... token

Step 3: Add OAuth Scopes

Go to OAuth & PermissionsBot Token Scopes:

app_mentions:read
channels:history
channels:read
chat:write
chat:write.public
groups:read          ← CRITICAL for private channels
im:history
im:read
im:write
mpim:read
reactions:write
users:read

Click Reinstall to Workspace. Copy the new xoxb-... token.

Step 4: Subscribe to Events

Go to Event Subscriptions:

  1. Toggle Enable Events → ON
  2. Under Subscribe to bot events, add:
    app_mention
    message.channels
    message.groups       ← CRITICAL for private channels
    message.im
  3. Click Save Changes

Note: message.groups only appears if you have the groups:read scope. If missing, add the scope, reinstall, then return here.

Step 5: Configure Hermes .env

nano ~/.hermes/profiles/<profile>/.env
SLACK_BOT_TOKEN=xoxb-...
SLACK_APP_TOKEN=xapp-1...
SLACK_ALLOWED_USERS=U0XXXXXXX

Find your user ID: Slack → Profile → About tab.

Step 6: Configure config.yaml

nano ~/.hermes/profiles/<profile>/config.yaml
slack:
  require_mention: false
  free_response_channels: "C0XXXXXXX,C0YYYYYYY,C0ZZZZZZZ"
  allowed_channels: "C0XXXXXXX,C0YYYYYYY,C0ZZZZZZZ"

Channel IDs: right-click any channel → Copy link → extract the ID.

Step 7: Invite Bot to Private Channels

In each private channel:

/invite @HermesAgent

Without this, Slack never sends message events for that channel.

Step 8: Start the Gateway

hermes --profile <profile> gateway run --replace

Watch for:

✓ slack connected
Authenticated as @hermesagent in workspace <name>
Socket Mode connected (1 workspace(s))

How It Works

Session Isolation

Hermes builds a session key for every message based on where it comes from:

agent:main:slack:channel:<channel_id>:<user_id>

This means each channel gets its own isolated context. A conversation about budgets in #finance never appears in #engineering.

Storage

Sessions live in SQLite (~/.hermes/profiles/<profile>/state.db). They survive gateway restarts and reboots.

Reset Behavior

In config.yaml:

session_reset:
  mode: both       # resets at fixed hour OR after idle time
  at_hour: 3       # 3am daily reset
  idle_minutes: 180 # or after 3 hours of inactivity
ModeBehavior
bothReset after idle time OR at daily hour
idleReset only after N minutes of inactivity
dailyReset at fixed hour every day
noneNever auto-reset — sessions live until /reset

Default for most users: both — balanced between continuity and freshness.

Manual Reset

When you want a fresh start in a channel:

/reset

This clears the session immediately.


Channel Isolation in Practice

ChannelPurposeSession Key
#financeFinancial planningagent:main:slack:channel:C0A:USER
#engineeringCode & architectureagent:main:slack:channel:C0B:USER
#learningLearning & documentationagent:main:slack:channel:C0C:USER

Messages in one channel never leak into another. Each is a separate conversation.


Troubleshooting

SymptomCauseFix
invalid_authWrong or stale bot tokenReinstall app, copy new token
missing_scopeMissing OAuth scopeAdd scope, reinstall
message.groups not in dropdownMissing groups:readAdd scope, reinstall
Gateway connects but no repliesEvents not enabledEnable Event Subscriptions
Silent in private channelsBot not invited/invite @HermesAgent
Unauthorized userUser not whitelistedAdd SLACK_ALLOWED_USERS

Built by Illia Hladkyi and Steward — together. Two brains, one system.