memcode docs
Agents

Slack

Run your memcode agent from a Slack app using Socket Mode.

Memcode uses Slack's Socket Mode, connecting out to Slack, so you do not need a public URL or to host an endpoint.

Step 1: Create a Slack app

At api.slack.com/apps, create a new app from scratch and pick your workspace.

Step 2: Enable Socket Mode

Open Socket Mode and turn it on. This generates an app-level token that starts with xapp-. Copy it. It carries the connections:write scope.

Step 3: Add bot scopes and install

Under OAuth & Permissions, add the bot token scopes you want the agent to use (for example chat:write and the *:history and message scopes for the conversations it should read), then install the app to your workspace. Copy the Bot User OAuth Token, which starts with xoxb-.

Under Event Subscriptions, subscribe the bot to message events so it receives what people send.

Step 4: Configure

memcode gateway setup

Choose slack, paste the app-level token (xapp-) and the bot token (xoxb-), then enter the Slack user ids allowed to drive the agent. The tokens are written to your global .env as SLACK_APP_TOKEN and SLACK_BOT_TOKEN.

Step 5: Run

memcode gateway

from the project you want the agent to work in. In a DM the bot replies to every message; in a channel it acts only when you @mention it, so it does not run on ordinary chatter (set respond_to_all: true under the channel in gateway.yaml to change that). The reply comes back in the same conversation.

On this page