Skip to content

Channels - Telegram and Slack Integration

Fresh

Source: 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 telegram

This automatically:

  • Installs dependencies
  • Validates the token
  • Configures DM policy (pairing, allowlist, or open)

Step 3: Start Server

bash
letta server --channels telegram

Step 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 B5ZR5H

Slack Setup

Step 1: Create Slack App

  1. Navigate to api.slack.com/apps
  2. Create from manifest (provided JSON manifest pre-configures Socket Mode, permissions, and events)
  3. Generate app-level token (xapp-...)
  4. Generate Bot User OAuth token (xoxb-...)

Step 2: Configure

bash
letta channels configure slack

The 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

ContextBehavior
Channel mentionCreates new conversation with in-thread replies
Direct messageMaps 1:1 to conversations; auto-creates routes

DM Policies

PolicyDescription
PairingOne-time codes requiring operator approval
AllowlistPre-configured user IDs only
OpenAnyone 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/:

FilePurpose
accounts.jsonCredentials and policies
routing.yamlChat-to-agent bindings
pairing.yamlPending/approved pairings

Verification Checklist

  • [ ] Bot token obtained from platform
  • [ ] letta channels configure completed
  • [ ] DM policy configured
  • [ ] letta server --channels <platform> starts without errors
  • [ ] Users can pair/connect
  • [ ] Messages flow bidirectionally
  • [ ] Formatting renders correctly on platform

See Also