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.
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
- Go to https://api.slack.com/apps
- Create New App → From scratch
- Name it, select your workspace
Step 2: Enable Socket Mode
- Left sidebar → Socket Mode
- Toggle Enable Socket Mode → ON
- Generate an App-Level Token with scope
connections:write - Copy the
xapp-1-...token
Step 3: Add OAuth Scopes
Go to OAuth & Permissions → Bot 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:
- Toggle Enable Events → ON
- Under Subscribe to bot events, add:
app_mention message.channels message.groups ← CRITICAL for private channels message.im - Click Save Changes
Note:
message.groupsonly appears if you have thegroups:readscope. 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
| Mode | Behavior |
|---|---|
both | Reset after idle time OR at daily hour |
idle | Reset only after N minutes of inactivity |
daily | Reset at fixed hour every day |
none | Never 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
| Channel | Purpose | Session Key |
|---|---|---|
| #finance | Financial planning | agent:main:slack:channel:C0A:USER |
| #engineering | Code & architecture | agent:main:slack:channel:C0B:USER |
| #learning | Learning & documentation | agent:main:slack:channel:C0C:USER |
Messages in one channel never leak into another. Each is a separate conversation.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
invalid_auth | Wrong or stale bot token | Reinstall app, copy new token |
missing_scope | Missing OAuth scope | Add scope, reinstall |
message.groups not in dropdown | Missing groups:read | Add scope, reinstall |
| Gateway connects but no replies | Events not enabled | Enable Event Subscriptions |
| Silent in private channels | Bot not invited | /invite @HermesAgent |
Unauthorized user | User not whitelisted | Add SLACK_ALLOWED_USERS |
Built by Illia Hladkyi and Steward — together. Two brains, one system.
- Hermes Agent Docs: https://hermes-agent.nousresearch.com/docs
- Session Docs: https://hermes-agent.nousresearch.com/docs/user-guide/sessions
- Slack API: https://api.slack.com/apps