Skip to content
Letta Code Letta Code Letta Docs
Sign up
Features
Channels

Telegram

Connect Telegram to your Letta Code agent

Create a Telegram bot via @BotFather and copy your bot token.

letta channels configure telegram

The interactive wizard will:

  • Auto-install the Telegram runtime dependencies
  • Ask for your bot token (validates it against the Telegram API)
  • Let you choose a DM policy (pairing, allowlist, or open)

Config is written to ~/.letta/channels/telegram/accounts.json.

letta server --channels telegram

You’ll see [Telegram] Bot started as @your_bot in the output. The bot begins long-polling for messages immediately.

Send any message to your bot from Telegram. With the default pairing policy, the bot replies with a pairing code and instructions to complete setup in Letta Code.

You can complete the pairing from the CLI:

letta channels pair \
--channel telegram \
--code B5ZR5H \
--agent <your-agent-id> \
--conversation <your-conversation-id>

The --agent flag defaults to the LETTA_AGENT_ID env var and --conversation defaults to LETTA_CONVERSATION_ID (or "default").

You can also pair from within an active Letta Code session (app, CLI, or desktop):

/channels telegram pair B5ZR5H

Messages from Telegram now flow into the agent’s conversation. The agent responds using the MessageChannel tool, which converts markdown to Telegram-safe HTML formatting (bold, italic, code, links, etc.).