Skip to main content
Build a Slack bot with tools, memory, and slash commands.
1

Create the Slack app

  1. Go to api.slack.com/apps and click Create New App
  2. Enable Socket Mode and generate an App-Level Token (xapp-)
  3. Add bot scopes: chat:write, app_mentions:read, channels:history, im:history
  4. Subscribe to events: message.im, app_mention
  5. Install the app and copy the Bot Token (xoxb-)
2

Create the agent

slack_bot.py
3

Install dependencies

4

Set environment variables

5

Run

Mention the bot in a channel or send a DM. Use /ask for slash commands.

Production Deployment

Switch to HTTP Events API mode for production:
See Slack reference for all configuration options including Block Kit interactions, modals, and shortcuts.