Appearance
Channels - Telegram and Slack Integration
FreshSource: Letta Code Channels
Beta Feature
Channels are a beta feature enabling Letta Code agents to interact with external messaging platforms.
Overview
Channels provide an additional communication option alongside the desktop app, CLI, and chat.letta.com. Currently supported: Telegram and Slack.
Telegram Setup
Step 1: Create Bot
Create a bot through @BotFather on Telegram and obtain the bot token.
Step 2: Configure
bash
letta channels configure telegramThis automatically:
- Installs dependencies
- Validates the token
- Configures DM policy (pairing, allowlist, or open)
Step 3: Start Server
bash
letta server --channels telegramStep 4: Pair Users
When a user sends a message, they receive a pairing code:
bash
letta channels pair \
--channel telegram \
--code B5ZR5H \
--agent <your-agent-id> \
--conversation <your-conversation-id>Or pair within an active session:
/channels telegram pair B5ZR5HSlack Setup
Step 1: Create Slack App
- Navigate to
api.slack.com/apps - Create from manifest (provided JSON manifest pre-configures Socket Mode, permissions, and events)
- Generate app-level token (
xapp-...) - Generate Bot User OAuth token (
xoxb-...)
Step 2: Configure
bash
letta channels configure slackThe wizard requests both tokens and DM policy preferences.
Step 3: Bind to Agent
bash
letta channels bind --channel slack --agent <your-agent-id>Slack Behavior
| Context | Behavior |
|---|---|
| Channel mention | Creates new conversation with in-thread replies |
| Direct message | Maps 1:1 to conversations; auto-creates routes |
DM Policies
| Policy | Description |
|---|---|
| Pairing | One-time codes requiring operator approval |
| Allowlist | Pre-configured user IDs only |
| Open | Anyone can message; routes auto-provision |
CLI Commands
bash
# Configure a channel
letta channels configure <channel>
# Add a route
letta channels route add --channel <ch> --chat-id <id> --agent <id>
# List routes
letta channels route list
# Bind Slack to agent
letta channels bind --channel slack --agent <id>Architecture
The MessageChannel tool converts markdown to platform-safe formatting (HTML for Telegram, Slack markup for Slack).
State Management
Configuration files are stored in ~/.letta/channels/:
| File | Purpose |
|---|---|
accounts.json | Credentials and policies |
routing.yaml | Chat-to-agent bindings |
pairing.yaml | Pending/approved pairings |
Verification Checklist
- [ ] Bot token obtained from platform
- [ ]
letta channels configurecompleted - [ ] DM policy configured
- [ ]
letta server --channels <platform>starts without errors - [ ] Users can pair/connect
- [ ] Messages flow bidirectionally
- [ ] Formatting renders correctly on platform
See Also
- Agents - Agent configuration
- Scheduling - Automated messages
- Headless Mode - Non-interactive operation