Skip to content

Telegram

A project can have a Telegram bot. Each member then talks to their agents in their private chat with it: their main agent in the chat itself, and their agents’ other conversations in topics of their own, one session of an agent each. What the agent does and asks shows up there as it works, and its notifications can reach you there too.

Create the bot

Someone who manages the project creates the bot in Telegram, with @BotFather (/newbot), and keeps its token. Then, in BotFather’s Mini App (Open, then the bot, Bot Settings, Threaded Mode), turn on threaded mode with users not allowed to create threads: AgentSpaces opens the topics itself.

Add it to the project

In the portal, open the project’s Settings, Channels, and under Chat apps choose Add bot. Paste the bot’s token and Add bot. The portal checks the token and the bot’s settings.

The Add a Telegram bot dialog in the project's settings: where to turn on threaded mode, the masked Telegram bot token, and Cancel and Add bot The Add a Telegram bot dialog in the project's settings: where to turn on threaded mode, the masked Telegram bot token, and Cancel and Add bot

Link your account

Every member who wants to use the bot links their own Telegram account. On the canvas, their own agent’s card shows the Telegram icon in orange, with a bubble under it, “Link your Telegram”: press it, then Get link, open the link (or scan its QR code) and press Start in Telegram within 10 minutes; the dialog then shows your Telegram username: Confirm, if it is you. The bubble’s × hides it for good. Or link it from Account, Chat apps, Link next to the bot.

The Link Acmebot dialog after Start in Telegram: Confirm the link, the Telegram account @alice_e2e wants to link to your account, with Reject and Confirm The Link Acmebot dialog after Start in Telegram: Confirm the link, the Telegram account @alice_e2e wants to link to your account, with Reject and Confirm

Talking to your agents

  • The chat is your main conversation, with your root agent in the project (it starts if it hasn’t yet). Send a message and it is a prompt: Thinking... shows at once, then what the agent is doing, and its reply takes that message’s place.
  • /new opens a topic: pick one of your agents, then one of its sessions: New session, Main (when no topic has it yet), or one of its other sessions no topic has, such as one you started in the chat panel. The topic is that session’s conversation, named after the agent and the session, so one agent can have several topics. A suspended machine isn’t resumed to list its sessions: then only a new session or main are offered. An agent without sessions takes main at once.
  • /status shows what your agents do: in the chat, a board of every agent you talk to here, awake or asleep, and whether it works, is done or needs you (the board is also pinned); in a topic, that topic’s agent.
  • Questions come with buttons. When the agent asks whether it may run a command, tap an answer; Continue lets it go on. /cancel stops what it is doing for you there.
  • Files. A photo or file you send (up to 20 MB) reaches the agent as an artifact of the project; the agent can send photos (up to 10 MB) and files (up to 50 MB) back.
  • The agent can write first, when it has news: its notifications go to Telegram when you talk to it there.

An agent that is asleep wakes for your message; the reply then takes a little longer.

Note

If the portal says “Topics don’t work in members’ chats with this bot”, threaded mode is off: turn it on as in the first step. Then each member unlinks the bot and links it again (Account, Chat apps).

Unlink or remove

  • Unlink your account under Account, Chat apps: your conversations on the bot end.
  • Remove the bot under the project’s Settings, Channels: every member’s conversation on it ends.

How an agent sees these conversations (the message types, notify, who may talk on a channel) is in Reaching out.

Last updated on