Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ Grok Bot, OpenAI dots, Claude Duet, Claude Tag and Meta Muse are closed products
| **Source code** | Open, MIT | Closed | Closed | Closed | Closed | Closed |
| **Where it runs** | Your server, your VM, your office box | xAI's cloud | OpenAI's cloud | Anthropic's cloud | Anthropic's cloud | Meta's cloud |
| **Model** | Any: your subscription login, 40+ providers, or a local model | Grok | OpenAI's | Claude | Claude | Meta's |
| **Where you talk to it** | Slack, Discord, Telegram, Feishu and Lark, personal WeChat, Microsoft Teams (preview); WhatsApp and QQ next ([Channels](#channels)) | Mac and iOS apps; Slack and Teams for team bots | ChatGPT, Slack, Teams | Its own app | Slack | Web, mobile app, WhatsApp |
| **Where you talk to it** | Slack, Discord, Telegram, Feishu and Lark, personal WeChat, Microsoft Teams and WhatsApp (previews); QQ next ([Channels](#channels)) | Mac and iOS apps; Slack and Teams for team bots | ChatGPT, Slack, Teams | Its own app | Slack | Web, mobile app, WhatsApp |
| **Your data** | Stays on your machine, in each bot's folder | Sent to xAI | Sent to OpenAI | Sent to Anthropic | Sent to Anthropic | Sent to Meta |
| **Custom work** | Anything. Change the code, add tools, connect your own systems | What the vendor allows | What the vendor allows | What the vendor allows | What the vendor allows | What the vendor allows |

<sub>The other products as their makers described them in public, November 2026; they may have changed since. Grok Bot, dots, Claude Duet, Claude Tag and Muse are products of xAI, OpenAI, Anthropic and Meta. pi-durable-bot is not affiliated with any of them.</sub>

**Any model.** Log in once with a subscription you already pay for, use an API key from any of the 40+ providers [pi](https://github.com/earendil-works/pi) supports, point it at any OpenAI-compatible endpoint (vLLM, SGLang, a proxy), or run a local model with Ollama, LM Studio or llama.cpp. The bot uses pi's own model layer, so every model pi can use, the bot can use. With a local model for the agent and the judge, nothing leaves your machine. You are not locked to one model vendor.

**Any channel.** The core speaks in five plain words: channel, place, thread, message, person. Platform details stay inside one adapter per platform. Slack, Discord, Telegram, Feishu and Lark, and personal WeChat work today, and Microsoft Teams as a preview; a new platform is one more adapter, not a rewrite. One bot can be in many channels and stays the same person everywhere. [What works where](#channels).
**Any channel.** The core speaks in five plain words: channel, place, thread, message, person. Platform details stay inside one adapter per platform. Slack, Discord, Telegram, Feishu and Lark, and personal WeChat work today, and Microsoft Teams and WhatsApp as previews; a new platform is one more adapter, not a rewrite. One bot can be in many channels and stays the same person everywhere. [What works where](#channels).

**Your business.** Give it your own tools, data and workflows. It can run several bots on one machine, each with its own name, persona, responsibilities and memory. A bot can even edit its own definition, or create a new bot.

Expand All @@ -64,7 +64,7 @@ Most AI bots are a command line with a chat bubble. You @ them, they answer, the
| **What it remembers** | This thread, maybe | One long memory across every channel, kept on disk |
| **How it works** | Calls the tools someone wired in | Writes and runs its own code on its own computer |
| **What happens later** | Nothing | It sets its own reminders and comes back |
| **After a crash** | Starts over, or sends twice | Picks up where it stopped. Never sends the same message twice (on Telegram, Teams and WeChat it can, and on Feishu and Lark after an hour down, [see why](#status)) |
| **After a crash** | Starts over, or sends twice | Picks up where it stopped. Never sends the same message twice (on Telegram, Teams, WeChat and WhatsApp it can, and on Feishu and Lark after an hour down, [see why](#status)) |

## What it does

Expand Down Expand Up @@ -187,7 +187,7 @@ The lines are in English. A bot writes them in its people's language in `"outage

One bot can be in several chat apps at once, with one memory. Tell it which app to join; it sets itself up there and asks you only for what it cannot do.

**Best for a team: Slack, Discord, and Feishu and Lark.** There the bot reads every message of a group, anyone on the team can talk to it, and bots hear each other, so several can work together in one group. Telegram works for groups, but its bots hear each other only once Telegram's Bot-to-Bot Communication Mode is on. Personal WeChat is for one person and one bot.
**Best for a team: Slack, Discord, and Feishu and Lark.** There the bot reads every message of a group, anyone on the team can talk to it, and bots hear each other, so several can work together in one group. Telegram works for groups, but its bots hear each other only once Telegram's Bot-to-Bot Communication Mode is on. Personal WeChat is for one person and one bot. WhatsApp is a business number that each person talks with apart.

| | Group chats | Your team | Bots hear each other | Buttons and forms | Missed messages |
|---|---|---|---|---|---|
Expand All @@ -197,8 +197,9 @@ One bot can be in several chat apps at once, with one memory. Tell it which app
| **Telegram** | ✅ Once its group privacy is off | ✅ A DM needs Start first | ⚠️ Only once Telegram's Bot-to-Bot mode is on | ⚠️ Buttons, no forms | ⚠️ Last 24 hours only |
| **Personal WeChat** | ❌ | ❌ Only the person who scanned the code | ❌ One bot per WeChat account | ❌ | ✅ |
| **Microsoft Teams** (preview) | ✅ If whoever adds it allows it and the organisation lets them; else @mentions only | ✅ | ❌ Bots hear only people | ✅ Adaptive Cards | ⚠️ Channels and group chats, not DMs |
| **WhatsApp** (preview) | ❌ One DM per person with its business number | ✅ Anyone who writes to the number | ❌ | ⚠️ Up to 3 reply buttons, no forms | ⚠️ What Meta sends again, for up to 7 days |

The bot also talks with you in the terminal of its computer (`pots chat`). WhatsApp is next, then QQ. Want another app? [Open an issue](https://github.com/Crokily/pi-durable-bot/issues/new). Each app is one adapter in [`src/channels/`](src/channels); the core stays the same.
The bot also talks with you in the terminal of its computer (`pots chat`). QQ is next. Want another app? [Open an issue](https://github.com/Crokily/pi-durable-bot/issues/new). Each app is one adapter in [`src/channels/`](src/channels); the core stays the same.

| Channel | What it does there | What it cannot do | How it connects |
|---|---|---|---|
Expand All @@ -208,6 +209,7 @@ The bot also talks with you in the terminal of its computer (`pots chat`). Whats
| **Telegram** | Groups, topics and DMs. Inline buttons. Typing. | Sees other bots' messages only once Telegram's Bot-to-Bot Communication Mode is on. Sees reactions only as a group admin. Gets what it missed only within 24 hours. A crash during a send can send it twice. | You make the bot with @BotFather, turn its group privacy off, and give it the token. |
| **Personal WeChat** | One chat with the person who scanned the code. Text, Markdown, pictures and files both ways. Sees which message you quote; it cannot quote itself. Typing. Catches up on what came while it was down. | No groups, edits, reactions or history. One WeChat account has one bot: binding another ends the first. After each of your messages it can send only a few replies (8 in a test), and after a long silence it may not get through, so a reminder it sets for later may not arrive. | You scan a QR code with WeChat on your phone. |
| **Microsoft Teams** (preview) | Channels and chats. Adaptive Cards with buttons and inputs. Typing. | Never sees other bots' messages. DMs sent while it was down are lost. Needs a work or school Microsoft 365 account with custom apps allowed. A crash during a send can send it twice. | You sign in with a code; it makes the app, and you add it in Teams. |
| **WhatsApp** (preview) | One DM per person with a business number, through Meta's Cloud API. Text, pictures, files, reactions, reply buttons. Typing, which also marks the person's message read. Gets what Meta sends again after a downtime. | No groups, edits or history. It writes only within 24 hours of the person's last message. Meta's terms bar general-purpose AI assistants there, except for users in the EEA, Brazil and Türkiye; a business's bot for its own customers is fine. Meta lets a new business send only once it is verified; sending is tested only up to Meta's API so far, receiving live. A crash during a send can send it twice. | You make a Meta app and give the bot its tokens; Meta posts each message to the bot's public address. |

## Quick start

Expand Down Expand Up @@ -339,7 +341,7 @@ flowchart LR

- A mention or a DM wakes it at once, with the messages of that place that were waiting. Other messages that arrive close together are grouped: it waits 3 seconds after the last one (20 seconds at most) before it decides.
- If it is already working in a place, itself or with a child, new messages there are handed to it as it works, so it can change course.
- While it works after a DM, a mention, a click on its button, a child of that place or a message the judge finds it very likely must answer (0.8 or more), people there see it typing, as they see a person type: on Slack its status line in the thread, on Discord, Telegram, Teams and WeChat the platform's typing; Feishu and Lark have none. It stops when the bot sends there (also through `call`), when its work ends, or after 10 minutes.
- While it works after a DM, a mention, a click on its button, a child of that place or a message the judge finds it very likely must answer (0.8 or more), people there see it typing, as they see a person type: on Slack its status line in the thread, on Discord, Telegram, Teams and WeChat the platform's typing, on WhatsApp the typing sign that also marks the person's message read; Feishu and Lark have none. It stops when the bot sends there (also through `call`), when its work ends, or after 10 minutes.
- The wake message says where, who, why and when, and gives each new message's text, the first message of its thread or the message it answers where the platform marks a reply, and its files. The gateway downloads files as soon as a message comes, into the bot's `files/tmp/`, so the wake gives their paths on the machine; it deletes them 30 days later, and the log keeps each file's name, type, size and URL, so the bot can download it again. A file over 10 MB is not downloaded, and a download that passes 10 MB, when the channel gave no size, stops and is deleted; the wake waits for the other downloads at most 10 seconds past the moment it would go out without them; for a file that is not saved, it gives the URL, and the bot downloads it itself if it needs it. Earlier messages and other details are in the log.

## How it works
Expand Down Expand Up @@ -421,6 +423,7 @@ pi-durable-bot runs every day as a teammate in a real workspace. What works toda
- [x] Microsoft Teams adapter, a preview (Socket Mode, or HTTP at the public address), with backfill of channels and group chats through Microsoft Graph. Tested with fakes and Microsoft 365 Agents Playground, not yet in a real organisation: the live socket, the permissions people grant, the backfill, files, admin policies and rate limits are untested. A crash at the moment of a send can send it twice, as on Telegram
- [x] Feishu and Lark adapter (the long connection of Feishu's SDK, so no public address), with backfill of groups, DMs and recent topics through the history API. Tested live in a Lark tenant (DMs, every message of a group, topics, the bot's own edits, reactions, recalls, files, card buttons and forms, the bot added and removed, the backfill after a restart, the scan-to-create app); not yet in a Feishu (mainland) tenant, with many people, or at the free plan's monthly API limit. A send repeated within an hour after a crash does not post twice; after an hour it can
- [x] Personal WeChat adapter, through Tencent's WeChat ClawBot (the iLink bot API's long polling, so no public address): the person scans a QR code with WeChat, and talks with the bot in one chat. WeChat gives a bot no groups, history, edits or reactions, and takes its messages only for a while after the person's last one. Tested live with a mainland WeChat account (the binding by a phone scan; text, Markdown, typing, pictures and files both ways, a quote, about 16 KB in one message, messages sent while the gateway was down, the limit on the bot's messages after one of the person's); not yet a voice message, a binding that WeChat asks digits for, or how long WeChat keeps messages for a bot that is down. A crash at the moment of a send sends it again with the same client ID, which WeChat for Windows showed once
- [x] WhatsApp adapter, a preview, through Meta's WhatsApp Business Cloud API: one DM per person, pushed to a webhook on the page server (so the computer needs a public address), with text, images, documents, audio, video, stickers, locations, reactions and the typing sign; people known by their business-scoped user ID, so a person who hides their phone number behind a username keeps one DM; a send within WhatsApp's 24-hour window, and a clear error when it is closed. Tested against a fake Graph API with Meta's documented payloads, and live on Meta's test number with a person's WhatsApp: Meta's webhook check and signature, text, a picture and a PDF downloaded, reactions added, replaced and removed, quote replies, the typing sign, people known by their BSUID, a message sent while the gateway was down arriving when Meta sent it again, and a send that failed shown in the person's DM. The bot's messages, reactions and buttons were taken by Meta's API but not delivered: Meta lets a new business send only once it is verified, so delivery is not yet tested. A crash at the moment of a send can send it twice, as on Telegram. **Meta's terms limit what the bot may be there.** Since 15 January 2026, the WhatsApp Business Solution Terms ("AI Providers") bar general-purpose AI assistants from the WhatsApp Business Platform when the assistant is the main thing the number offers, except for users in the European Economic Area, Brazil and Türkiye, where the law makes Meta allow them. A bot that answers a business's own customers about that business is fine. A general personal assistant on WhatsApp is not, and Meta can suspend the number at once. Meta's [pricing for AI Providers](https://developers.facebook.com/documentation/business-messaging/whatsapp/pricing/ai-providers) lists the markets
- [x] Mention, DM, judge and timer wakes, grouping, and steering
- [x] Code mode on its own machine, `pots` command line
- [x] Turning the page with notes, compaction as a fallback
Expand All @@ -437,7 +440,7 @@ pi-durable-bot runs every day as a teammate in a real workspace. What works toda
- [x] MCP servers and code mode, through pi's own MCP support
- [x] Pages, buttons, forms and a password page, with a public address that needs no setup
- [x] A desktop page: a person takes over the bot's screen from a link, on a phone or a computer, and hands it back
- [ ] More adapters: WhatsApp, QQ
- [ ] More adapters: QQ
- [ ] `pots init` in a web page, for people who do not use a terminal

## Develop
Expand Down
Loading