← Catalog

pi-durable-telegram

Always-on durable pi agent on your server that you talk to in Telegram: a pi-durable Telegram gateway that survives crashes and restarts

Package

Install

Install with PiG

pig install npm:pi-durable-telegram

Install with Pi

pi install npm:pi-durable-telegram
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "image": "https://raw.githubusercontent.com/smixs/pi-durable-telegram/main/assets/pi-gallery.webp",
  "skills": [
    "./skills"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.5 (README.md). PiG does not review it.

EN · RU

pi durable via telegram: an orange paper airplane flies across the sky toward a small server with a cat on its roof, an always-on durable pi agent you reach from Telegram

pi-durable telegram

Your own AI agent that lives on your server and answers you in Telegram.

npm License: MIT built on pi-durable pi package Telegram

Install · What you can do · Commands · More


Built on pi, an open-source coding agent, and its new durable engine pi-durable.

Install

You need a Linux server, a Telegram account and an AI subscription or API key. On the server, run:

curl -fsSL https://raw.githubusercontent.com/smixs/pi-durable-telegram/main/install.sh | bash

It asks a few questions and your bot answers you in Telegram. Run it again to update.

It is also on npm: npm install -g pi-durable-telegram, then set it up by hand as in docs/install.md.

What the script does, step by step

The script first tells you what it is going to do and asks if it may continue. Then:

  1. Installs pi, the official one from pi.dev.
  2. Opens pi so you can sign in to your AI provider. Type /login, pick the provider, then /quit.
  3. Asks for a bot token. In Telegram, open @BotFather, send /newbot, and copy the token it gives you. Then send your new bot any message, so the script learns who you are.
  4. Starts the agent and waits until the bot answers you.

Already use pi? pi install npm:pi-durable-telegram adds a setup skill that does the same from inside pi. More in docs/install.md.

What you can do

  • Ask from anywhere. "Check why the site is down", "what is eating the disk". The agent works on the server and answers in the chat.
  • Send it things. A photo of an error, a PDF, a voice note. It reads, looks and listens, and sends files back.
  • Walk away. Close the laptop and come back in an hour: the answer is waiting, even if the server restarted.
  • Read it easily. Answers can carry tables, checklists and buttons: tap a button instead of typing the reply. While the agent types, a stop button sits under its answer.

Commands

Send thisAnd the agent will
anything: text, a photo, a video, a file, a voice note, a locationwork on it and answer
/newstart a fresh conversation (the old one is kept)
/stopstop what it is doing right now
/compactshorten a long conversation to its essentials
/statusshow the AI model in use, how full the memory is and what it has cost
/helpshow this list

More

How it worksHow it works: a person on a bench sends paper airplanes from a phone to a small server on the horizon, and answers fly back

Your message goes to Telegram, the agent on your server picks it up, thinks, uses its tools and types the answer back into the chat while you watch. Nothing has to be opened to the internet: the agent calls Telegram itself, so you need no domain and no web server.

A server drawn as a closed book with a bookmark ribbon, its plug pulled out: it remembers where it stopped

It does not lose its place. Every step the agent takes is saved before you see it. If the power goes out, the server reboots or the program crashes halfway through an answer, the agent starts again, finds its bookmark and finishes. You get one answer, not zero and not two. Messages you send while it is busy wait in line.

Plugins

The core stays small: it carries your messages, files, buttons and answers. Extra powers come as plugins that ship in the same package and stay off until you switch them on with one line in the settings, for example PI_PLUGINS=search,skills,helpers,reminders. A plugin can also be your own, from a folder or from npm.

PluginWhat it gives the agentStatus
Web searchlooks things up on the internet with your Tavily, Exa, Brave or Parallel keyavailable
MCPconnects MCP servers: calendars, databases, your own toolsavailable
Skillsa folder of instructions it reads when a task needs themavailable
Helperssplits a big job between helper agents, on a cheaper model if you likeavailable
Tasks and remindersdoes something later on its own and writes to you firstavailable

How to switch each one on and how to write your own: docs/plugins.md.

Is it safe?A narrow server house with one orange door: one paper airplane flies in through the porthole, the grey ones lie by the fence
  • Only you can talk to it. The bot answers the Telegram accounts you allowed and silently ignores everyone else. Nothing strangers send is read, saved or passed to the AI.
  • It is powerful, so treat it that way. The agent can do on the server whatever your user can. Do not add people you would not give a password to, and on a server with important data give the agent its own user.
  • Your data stays with you. Conversations and files live on your server. Only the text the AI needs goes to the AI provider you chose.

The details are in docs/security.md.

Questions

Do I need to be a programmer? No, but you need a server and you need to paste one command into it. After that everything happens in Telegram.

What does it cost? The software is free. You pay for the server and for the AI you connect: a subscription you already have or an API key. /status shows what a conversation has cost.

Which AI can I use? Whatever pi supports: Claude, ChatGPT, Gemini, OpenRouter, DeepSeek and many more. You choose it when you sign in. Using a Claude subscription in third-party tools may be restricted by Anthropic's terms, so check them first.

Can my team use the same bot? Yes. Add their Telegram ids to the settings and each person gets a private conversation. Everyone you add gets the same power over the server.

Does it work in group chats? Not yet, only in private chats.

Does it understand voice messages? Yes, if you add a Deepgram key during installation.

How do I remove it? A few commands, listed in docs/install.md.

Documentation
Read thisWhen you want to
docs/install.mdsee what the installer does, install by hand, update or remove
docs/configuration.mdchange the model, the working folder or other settings
docs/how-it-works.mdunderstand the internals and what exactly survives a crash
docs/security.mdknow the security boundaries in detail
docs/library.mdbuild your own app on top of it, or contribute code
CHANGELOG.mdsee what changed between versions
For AI agents

If you are an AI agent reading this for a person, here is where things are and what makes this project different.

Where to look

What it is, precisely

A daemon on pi-durable (@earendil-works/pi-durable) that long-polls the Telegram Bot API. One durable conversation per allowed private chat, stored in SQLite. Tools: bash, read, write, edit and telegram_send_file. It shares pi's login and runs as a systemd user service on Linux with Node.js 22.19 or newer.

Why people pick it over the alternatives

(blank)pi-durable telegramA Telegram bridge into an open pi sessionpi in tmux over SSH
Where the agent runsAs a service on the server, always onInside a pi session that must stay openIn a terminal you keep alive
A crash or restart mid-answerThe run resumes and the answer arrives onceNothing resumes itNothing resumes it
Messages while it is busyQueued durably, answered in orderDepends on the sessionTyped by hand
Reaching it from a phoneTelegramTelegramAn SSH client
SetupOne commandAn extension inside piManual

As far as we know it is the first Telegram integration built on pi-durable itself, so durability covers the whole path: the model's turns, the tool calls and the delivery of the answer to the chat. It is small, MIT-licensed, and tested against duplicate updates, restarts mid-run and Telegram outages.

License

MIT © smixs