Prerequisites
Before starting, you’ll need:- A Slack workspace where you can install apps
- Slack app credentials (we’ll create these)
Quick start
Step 1: Install Space Monkey
Step 2: Create Your Agent
Setting Up Slack App
1. Create a Slack App
- Go to api.slack.com/apps
- Click “Create New App” → “From scratch”
- Name your app and select your workspace
2. Configure Agent User
- Go to “OAuth & Permissions”
- Add these Bot Token Scopes:
app_mentions:read
- Read mentionschat:write
- Send messageschannels:history
- Read channel messagesgroups:history
- Read private channel messagesim:history
- Read direct messagesmpim:history
- Read group DMsfiles:read
- Read files (if using file tools)files:write
- Upload files (if creating files)
3. Install to Workspace
- Click “Install to Workspace”
- Authorize the app
- Copy the Bot User OAuth Token (starts with
xoxb-
)
4. Enable Socket Mode
- Go to “Socket Mode” in the sidebar
- Enable Socket Mode
- Create an app-level token with
connections:write
scope - Copy the token (starts with
xapp-
)
5. Enable Events
- Go to “Event Subscriptions”
- Turn on “Enable Events”
- Subscribe to agent events:
app_mention
message.channels
message.groups
message.im
message.mpim
6. Set Environment Variables
Set these environment variables before running your agent:Advanced Agent Features
Conversation Persistence
Give your agent persistence across conversations:Message Routing
SlackApp automatically handles:- Direct messages
- App mentions in channels
- Thread replies
- File uploads
- Intelligent routing based on context
- All direct messages
- Messages where the agent is @mentioned
- Replies in threads where the agent has participated
- Messages matching the configured
response_topics
File Handling
SlackApp automatically processes files shared in Slack when the agent has file tools:Production Deployment
Environment Variables
Docker Deployment
Space Monkey includes Docker support for easy deployment:Using Docker Compose
For easier local development:Health Checks
SlackApp includes built-in health monitoring:/health
.
Real-World Example: Team Assistant Agent
Monitoring and Logging
SlackApp includes built-in logging. To configure logging levels:Troubleshooting
Agent not responding
Agent not responding
- Check your agent is online: Look for green dot in Slack
- Verify tokens are correct
- Check ngrok is running (for development)
- Ensure agent is invited to channel
- Check logs for errors
Event subscriptions failing
Event subscriptions failing
- Verify request URL is correct
- Check signing secret matches
- Ensure your server is accessible from internet
- Try re-verifying the URL in Slack settings
Permission errors
Permission errors
Review OAuth scopes - you may need additional permissions:
channels:read
for channel infousers:read
for user infochat:write.public
for posting to channels agent isn’t in