Bots

Bots are Telegram bots that Xedant Agent uses to talk to you (or your teammates) right in Telegram. You can have as many bots as you like: one for daily reports, a second for project questions, a third for the whole team. Each bot has its own model, its own skill, its own system prompt, and its own list of allowed users.

Bots are managed from the interface — the Bots dialog (Settings → “Extra Telegram Bots”): create, enable and disable, restart, and reset the chat to a new conversation, all in one click and without editing files. The configuration is stored in .xedant/bots.yml.


Why your own bot

A bot is the simplest way to let people work with the agent: no web interface to open, no login and password to enter, no settings to learn. A teammate just opens a chat with the bot in Telegram and writes the job in plain words. What this gives you:

  • Several bots for different jobs — one bot is trusted with reports, another with code, a third with talking to customers. Each has its own model, skill, and rules;
  • Access control — you choose exactly who the bot answers (by Telegram user ID);
  • No web interface needed — people talk through a messenger they already know, on the phone and on the computer;
  • Ongoing conversation — the bot keeps the current chat with the agent: you can clarify, ask for a redo, or pose the next question — the context stays;
  • Notifications from tasks — the bot delivers the results of automated tasks (see Tasks).

How to set up a bot

Open the Bots dialog from Settings → “Extra Telegram Bots” and click “New Bot”. What you configure:

  • Bot token — issued by @BotFather (an environment variable reference through $ is supported, for example $TELEGRAM_BOT_TOKEN);
  • Title — for example, “Reports” or “Team assistant”;
  • Model — from your model list, the same AI model you use in chats;
  • Skill — the skill the bot loads at the start of a conversation (for example, a reporting skill or a support skill);
  • System prompt — the bot’s rules of behavior: who it serves, in what style it answers, what jobs it takes on;
  • Allowed users — the Telegram IDs the bot answers. Important: while the list is empty, the bot answers no one — it replies “Bot is not configured for access.” with the sender’s Telegram user ID until you add at least your own;
  • Show details — whether to show tool calls and the model’s thinking (for transparency) or to hide them (for simplicity);
  • Web URL — the address of the web interface the bot sends when a chat is worth opening in full.

You set the token once; in lists it is shown masked. Change the model or the token and the bot restarts itself with the new value — no manual step needed (there is also a “Restart” button in the interface). All the other settings — prompt, skill, the user list, detail display — apply immediately.


How to use a bot

In Telegram, a bot has three commands:

  • /start — show help and the bot’s purpose;
  • /new — start a new chat (reset the current conversation);
  • /commit [message] — commit and push the project’s changes (when the bot works with code).

Any message without a command is a job for the agent: the bot passes it to the agent’s chat, the agent does the work, and the reply comes back through the bot. In a new chat, the bot’s system prompt and skill are added to the first message automatically.

The bot receives updates through long polling: the agent’s server itself connects to Telegram and waits for new messages. The bot needs no public web address and no open ports; the connection is outgoing, from the agent’s server to Telegram.


Bots and tasks: ready-made scenarios

A bot and a task work together like this: the task fires (on a schedule or by trigger), the script collects the data, the AI writes the analysis — and the task’s fresh chat is automatically bound to your bot. You get the result in Telegram and can keep the conversation going: ask for details, request a different report, or hand over the next step.

  • Morning digest — a “Reports” bot and a task “every day at 09:00 collect the metrics and write a summary”: you get the summary in the morning and ask in the evening “what happened to the orders after lunch?”;
  • Alarm signal — a task monitors the site with the trigger “ERROR”: when something breaks, the bot sends an error breakdown, and you can give the command right there — “fix it and commit”;
  • Overnight test run — a task runs the tests at night; when they fail, the AI reads the log and the bot delivers a clear report with recommendations;
  • Backups — a task makes the backup and stays silent while all is well; only on an error does the AI write through the bot what went wrong;
  • Post-deploy check — after a deployment, a task checks the application’s health and always sends the result to the team bot.

The key idea: the task collects the data and starts the AI, the bot delivers the result and carries the conversation. Together they turn the agent from a tool you open in a browser window into an AI worker that comes to you with the work already done.


The configuration file

All bots are stored in .xedant/bots.yml — the same YAML format as the rest of the project configuration. The file is versioned in Git, so your set of bots moves between servers together with the project. If you prefer, tokens can be moved into environment variables with the $ENV_VAR syntax, keeping secrets out of the repository.


What’s next

To have a bot deliver the results of automated scenarios, set up the link with tasks — see Tasks. For choosing bot models, see the Models page.


← Back: Tasks

Next: Models