The Pattern Discord bot provides a natural language interface to the multi-agent system through Discord.
- Create a Discord application and bot at https://discord.com/developers/applications
- Copy
.env.discordto.envand add your bot token - Invite the bot to your server with appropriate permissions (Send Messages, Read Messages, Use Slash Commands)
/chat [message]- Chat with the agents/vibe- Check current system state/vibe/tasks- List current tasks (coming soon)/memory- Show shared memory state
The bot supports flexible agent routing in DMs and channels:
pattern- Orchestrator/sleeptime agententropy- Task managementflux- Time managementarchive- Memory/searchmomentum- Energy trackinganchor- Habits
- @ mentions:
@entropy help me break down this task - Colon prefix:
flux: when should I schedule this? - Slash agent:
/agent momentum how's my energy? - Default: Messages without routing go to the orchestrator
You can customize which agents are available by modifying the MultiAgentSystemBuilder in src/bin/discord_bot.rs:
// Add custom agents
builder.add_agent(
"chaos".to_string(), // Internal ID (used for routing)
"Chaos".to_string(), // Display name
"Task breaker".to_string(), // Description
"You are Chaos, the task breakdown specialist.".to_string(),
false, // Not a sleeptime agent
);Agent names are automatically detected for routing - no hardcoded lists!
DISCORD_TOKEN(required) - Bot tokenDISCORD_CHANNEL_ID(optional) - Limit to specific channel(s). Comma-separated list supported.DISCORD_GUILD_IDS(optional) - Restrict responses to specific guild(s). Comma-separated list supported. (DISCORD_GUILD_IDfor a single ID also works)LETTA_BASE_URL- Letta server URL (default: http://localhost:8000)LETTA_API_KEY- For Letta cloud instead of local serverPATTERN_DB_PATH- Database location (default: pattern.db)
Create pattern.toml for persistent configuration (non-sensitive options like channel and admin lists can live here):
[discord]
# Non-sensitive options (token stays in environment)
# Channels the bot may proactively post to when routing prompts or announcements
allowed_channels = ["1390442382654181477", "1310716219527135363"] # or: "1390442382654181477,1310716219527135363"
# Admin users allowed to use /permit, /deny, /permits
admin_users = ["592429922052472840", "123456789012345678"] # or: "592429922052472840,123456789012345678"
# Behavior flags (optional)
respond_to_dms = true
respond_to_mentions = true
[letta]
base_url = "http://localhost:8000"
# Or for cloud:
# api_key = "your_api_key"
[database]
path = "pattern.db"- Never commit
.envorpattern.tomlwith real tokens - Use environment variables for sensitive data in production
- The bot requires MESSAGE_CONTENT intent for natural language routing
- Token (
DISCORD_TOKEN): environment only (required). - allowed_channels/admin_users: read from pattern.toml if present; otherwise from env.
- Environment overrides:
DISCORD_CHANNEL_IDandDISCORD_ADMIN_USERSaccept comma-separated lists.
- Environment overrides: