pi-durable-bot (Pots) The open-source Grok Bot alternative: an AI coworker that acts on its own. It reads every channel, email and event you give it, decides what matters, does the work on its own computer, and speaks up when it should. Demo · Compare · Quick start · How it decides · How it works ⭐ If Pots is useful to you, a star helps other people find it. [!TIP] Setting this up with an AI agent, such as Claude…
Open-source Grok Bot alternative. Pots is an AI coworker that reads every channel, decides what matters, and acts on its own computer. Self-hosted, any model.
⭐ If Pots is useful to you, a star helps other people find it.
Tip 提示
Setting this up with an AI agent, such as Claude Code, Codex or Cursor? Have it read docs/for-agents.md first. That page explains Pots to your agent and how to set it up. In short: the agent installs it and makes the bot, you sign in to your model (and a judge such as Jev, for group chats) with pots login, and then the bot connects Slack and your other apps itself.
Grok Bot, dots and Claude Tag showed what an AI teammate can be. pi-durable-bot gives you the same kind of coworker as open source: it runs on your machine, with the model you choose, in the places your team already talks.
Open and yours
Grok Bot, OpenAI dots, Claude Duet, Claude Tag and Meta Muse are closed products. They run on someone else’s computer, with someone else’s model, inside the apps they chose. pi-durable-bot is MIT-licensed and runs where you put it.
pi-durable-bot
Grok Bot (xAI)
dots (OpenAI)
Claude Duet (Anthropic)
Claude Tag (Anthropic)
Muse (Meta)
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, Microsoft Teams (preview), Feishu and Lark, personal WeChat, and any channel with a Chat SDK adapter
Mac and iOS apps; Slack 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
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.
Any model. Log in once with a subscription you already pay for, use an API key from any of the 40+ providers 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.
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.
Not a bot. A coworker.
Most AI bots are a command line with a chat bubble. You @ them, they answer, they forget. A real coworker works differently:
A chat bot
pi-durable-bot
What it sees
The message that mentions it
Everything in the places it was invited to: chats, DMs, emails, events, pages it watches
When it acts
When you @ it
When it decides it should. It can also answer when you @ it
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)
What it does
📥 Its own inbox
Every message in every place you invite it to lands in one inbox: channel messages that never mention it, edits, deletions, reactions, people joining, and its own messages. It keeps all of it in a local SQLite log and reads that log with SQL whenever it needs context. Nothing is thrown away when a conversation gets long.
🧠 Its own judgment
It is woken in three ways, the same three ways a person notices work:
Like a coworker who…
How
Someone asks
gets a message or an @
A mention or a DM wakes it at once
It notices
overhears something that is their job
Every message that does not mention it comes to it too, and it decides itself whether it is about its work. You can also set a judge that reads these messages first and asks two questions: is this about me? and should I respond? It sees the bot’s own list of responsibilities. The judge is a fast classifier such as TypeSafe’s Jev, a local model, or the bot’s own model
It looks around
looks around now and then, unasked, and keeps promises
A few times a day a helper of its own looks for what you would want to know or have done, with its memory, the message log and its tools, and tells the bot only when it finds something. The bot also sets its own timed wakes and routines: “check Acme’s pricing every Monday”, “follow up at 5 pm”
Being woken is not the same as speaking. Each time, the agent reads the log and decides if it should say anything, where, and when. Most of the time the right answer is to stay quiet.
💻 Its own computer
It has a real machine with a shell, files, the internet, and a screen it uses like a person: the browser and the apps on it, with the mouse and keyboard. It does not wait for a plugin. It writes the script it needs, runs it, fixes it, and keeps the useful ones. That covers research, spreadsheets, reports, monitoring a web page, filling a form, or booking a flight, and also code.
This is code mode: the agent gets a few general tools (read, write, edit, bash, grep, find, screen) plus three channel actions (send, react, call), and builds the rest itself. One more tool, task, hands work to its helpers (below). With codemode, pi’s code mode, it writes a JavaScript script that calls these tools and the tools of MCP servers in a sandbox; only what the script returns comes back to it.
grep and find are pi’s: they search file contents and file names with ripgrep and fd, skip what .gitignore lists, and cap their output (100 matches or 1000 files, 50 KB). When the computer has neither program, pi downloads it to ~/.pi/agent/bin on first use, with no sudo. They run in the gateway’s process, not in a systemd scope of their own.
screen is bash with the screen’s environment, such as DISPLAY; bash does not have it. A screen runs one task at a time, as a person’s desktop does: the first screen command of an agent takes the screen until its work ends, also across bots and the Pots processes of the same user on the machine. Another agent that tries then learns who has it, since when, and when it frees, and decides itself what to do. A person who takes over the screen from a desktop page link holds it the same way, until they hand it back. A bot that sets up its own desktop, such as an Xvfb display, writes its environment into screen in its bot.json.
Known secrets are masked in tool output. When a secret Pots knows shows up in a tool’s output, such as a token in a file the bot reads or a command prints, the model and the log get [secret] in its place, also in the output of a command that is still running and in a codemode script’s calls. Pots knows only its own secrets: the values in the secrets folder and in the files bot.json names, such as the channels’ tokens and the VNC password; pi’s logins and settings are not read. A routine’s output and stored errors are masked too. Values shorter than 8 characters, and names in them such as *_URL, *_ID or *_NAME, are not masked, so ordinary text is not hidden; the files are looked at at most once a second, and a tool call costs one regular expression over its output.
Windows.pots admin <command> runs a command as administrator without Windows’ prompt (UAC), through a scheduled task that runs with the highest privileges. Windows asks once, when Pots is installed, to make that task, and pots admin --setup asks later when nobody said Yes then. A gateway that already runs as administrator runs the command itself. When Windows has locked its screen, the screen tool’s output says so. With the person’s Windows PIN stored as a secret and pots admin set up, Pots unlocks the screen before a screen command, by typing the PIN on the sign-in screen of its own session through its own VNC service, and locks it again once no agent and no person on a desktop page uses the screen. Pots types the PIN itself; it is in no command line or log of Pots.
One agent at a time per screen is enforced only on Linux, where plain bash has no DISPLAY or WAYLAND_DISPLAY and so cannot reach the screen. On macOS and Windows the screen does not depend on those variables, so bash can still use it; there the agents use the screen tool because the prompt tells them to.
On Linux with a systemd user manager (a desktop, or a server with lingering, which pots service install turns on), each command of bash, screen and a routine runs in a systemd scope of its own, in one slice per Pots home. When memory runs out, systemd-oomd or the kernel then stops the command that uses it, not the gateway with every bot in it. What a command leaves running when it returns, such as a browser, a dev server or a nohup job, keeps running when Pots restarts after an upgrade or a crash, and the bot’s next wake lists it, so the bot decides when to stop it. A command Pots still waits on when it stops is stopped, with what it started. When you stop Pots’ service on purpose (systemctl --user stop pots, pots service uninstall), everything its commands left stops too. A scope costs about 25 ms per command. Where there is no user manager (macOS, Windows, --system services, most containers), commands run as before.
👥 Its own helpers
Longer work does not keep it from talking. With its task tool the bot starts children: agents that work in the background with read, write, edit, bash, grep, find, screen, codemode and task, without the channel actions, on a brief it writes for them. It answers the person first, hands the work to a child, and stays free for the next message. A child starts from an empty conversation and its brief, so the bot’s own context stays small; it sees the bot’s memory index as it was when it started. When a child ends, its final message is kept, also across crashes and restarts, and wakes no one: the bot reads it with the task tool when it wants, and looks in on longer work with its own timed wakes. A child that cannot go on, such as when its model stops waiting (When the model cannot answer), wakes the bot once, also across restarts, with why and what it did last. A child wakes the bot itself with pots wake: when the bot hands it work, the brief says to wake the bot with pots wake when it is done; a child whose work someone waits for wakes it when done, and one that nobody waits for ends quietly. A child can also wake the bot with a question for a person. The bot checks what a child reports, passes on what matters, and sends the child the answer. While a child works for a place, new messages there go to the bot, so it can pass them on. A child takes the bot’s messages only between its steps, so a message sent while it is in a long command waits until the command ends. Wherever the bot sees a child that works (its timed wakes, the wakes from the child’s place, the task tool’s list and the answer to a message it sends), it sees what the child does now: the tool call it is in and for how long, the start of the command, its last line of output and how old that is, and how many of the bot’s messages wait for it. When a command hangs, the bot can interrupt the child’s current tool calls: the child goes on with its work so far, sees that they were aborted, and takes the messages that waited. A stopped child does nothing more, also when the process dies in the middle of the stop.
A child can start children of its own with the same task tool, also from a codemode script, to the depth it needs; all of them share one cap. A grandchild works for its parent’s place, with its parent’s model unless the parent chooses another, and its brief says which child it came from. Its result goes to the child that started it, which reads it with task’s result, or with wait: wait holds until all the children it names have ended, or any one of them, or until a time limit, then gives how each ended, with its final message then, also when Pots restarts in the meantime, and holds no process while it waits. A grandchild’s failure goes to its parent too, as a message, while the parent works; once the parent no longer works, it wakes the bot as a child’s failure does. The bot sees the whole tree, in task’s list and in pots children, and can stop any of them; a stop also stops what that child started. A child manages only the children it started, also with pots children in its commands. The bot can wait too, but cannot answer anyone while it waits, so a batch of work to wait for goes to a child that starts and waits for the others.
The bot chooses each child’s model and thinking level when it starts it: any model signed in on this computer, and any of pi’s levels. A child it starts without a choice has the bot’s model, also after a change in bot.json, and thinking xhigh. A child keeps the model chosen for it and its level for its whole life, also across restarts; a level the model does not have becomes the nearest one it has, as in pi. A model that is unknown or not signed in is refused before the child starts, with the reason, so the bot can take another or ask you to run pots login. By default the bot talks at the thinking of bot.json (medium), and its children do the work at xhigh or max. Every request carries Pots’ notes on the models signed in on the computer, from their makers, independent tests and their work in Pots, updated with each release: what each does well, where it stands next to the other makers’ models, and which subscription or price it comes with. So the bot chooses a model by the work and by the makers you are signed in to. What you say about which model, or which coding agent’s command line, does which work comes first: the bot asks at its first start and keeps your answer in its AGENTS.md. settings.maxChildren (50 by default) caps how many work at once, counting the children that children started. pots children lists them, and pots children --stop <id> or --stop-all stops them.
It works like a pi session: it reads AGENTS.md and uses Agent Skills from the same places pi does, so the skills you give pi, the bot can use too. Screenshots and photos are shrunk to fit the model, as in pi.
💬 Its own voice
When it speaks, it speaks like a teammate: in the right channel or thread, in its own words, with the file attached. It can reply in a thread, start a new message, DM a person, add a reaction, edit its own message, or call any other platform API.
🪟 Its own pages
Some things do not fit in a chat message. For a plan, a report or a dashboard, the bot writes a web page and sends a link. Each page gets its own layout and look, made for who reads it and what they do with it. The bot picks the best form for each piece of information (a chart, a calendar, a table to sort and search, a calculator, a map), uses the width of a computer and one column on a phone, and looks at the page before it sends it. A page can ask, too: people choose, comment, fill in, approve or reject on it, and each answer wakes the bot at once.
Buttons and forms in the chat. On Slack and Discord the bot sends the platform’s own buttons, menus and forms; on Telegram, inline buttons; on Teams, Adaptive Cards; on Feishu and Lark, cards with buttons and forms. A click wakes it within a second, and a form opens at once.
A password page for secrets. When the bot needs an API key from you, it sends a one-time link to a page of Pots’ own. You type the key there. It goes into a file in the secrets folder, never into the chat, the log or a trace.
A desktop page for the steps only you can do. When a sign-in, a CAPTCHA or an approval needs you, the bot sends a one-time link. On your phone or computer you see its whole screen, do the step, and press Done; the bot is woken with your note and carries on. On a phone the picture fills the screen, and the bot’s desktop takes your phone’s shape when its VNC server can change size; you type into a field that sends each character as you go. Pots signs in to the VNC server on the bot’s computer itself, so its password stays there, and nothing shows before you press Start. On Windows Pots brings its own, UltraVNC, which it downloads at the first link and checks against its SHA-256. While you have the screen, the bot’s screen commands do not run.
A login page for models. When a model login expires, or you want another model or a judge, the bot sends a one-time link. On your phone or computer you sign in with your subscription (a device code or a copy code works from any device) or paste an API key, also TypeSafe’s for Jev, as many as you need, then press Done. pi keeps the login on the bot’s computer, for every bot there; the bot is told which provider and which models it can use now, never the login. When no bot can think, because its only login expired, pots login --link on that computer prints such a link.
No public address needed. The first link starts a Cloudflare Quick Tunnel, so pages work from a laptop behind a home router. For a fixed address, the bot sets up Tailscale Funnel with you, or uses your own domain.
⏰ Its own schedule
It promises to come back, and it does. A timed wake (pots wake) wakes it once, at a time it chooses. A routine (pots routine) repeats: every 30 minutes, say, or on a cron schedule in the computer’s time zone. Both live in the same database as everything else, so they survive restarts. It can also add normal cron jobs on its machine.
Add a routine, or replace the one with that name. Names are letters, digits, - and _; durations are as in pots wake --in: 90s, 30m, 2h, 1d
pots routine list
Each routine’s schedule, what it does, its next time and its last run
pots routine remove <name>
Remove a routine
--note wakes the bot with the note at each time. --run makes Pots run the command at each time, in the bot’s shell, folder and environment, with POTS_FROM set to the routine’s name. The command decides itself whether to wake the bot with pots wake, so watching an inbox every few minutes costs no model request until there is mail. --child starts a child at each time with the text as its brief, without waking the bot; the child decides itself whether to wake it, so a check that finds nothing leaves nothing in the bot’s conversation.
A run is skipped while the last run of the same routine still runs, or the child it started still works. Times missed while the gateway was stopped or the computer was off or asleep are skipped, not made up: the next run is the next time from now.
A command runs at most 10 minutes, or its --timeout; then Pots stops it and the processes it started. When the gateway stops, it stops the commands it runs.
Pots keeps each run’s start, end, exit code and last lines of output for 7 days. A failed run (a non-zero exit code, the timeout, or a child that could not start, such as at settings.maxChildren) wakes the bot once, with that output; later failures of the same routine do not, until one of its runs succeeds.
A script that calls pots wake says where the wake comes from with --from <name> (letters, digits, - and _), or $POTS_FROM. The wake then tells the bot that it comes from a command on this computer, not from a person, so outside text in its note, such as an email’s subject, does not read as the bot’s own plan. With --id <id>, a second pots wake with the same ID gives back the first wake and sets none, as pots send --id does.
The look. At its first start, Pots gives each bot one routine, look: at 8:00, 11:00, 14:00, 17:00 and 20:00 in the computer’s time zone (--cron "0 8-22/3 * * *"), it starts a child that looks, unasked, for what the bot’s people would want to know or have done, with what the bot has: its memory, the message log, its tools and the logins on its computer. It sees what was said before and how people took it. When it finds something worth their attention, it wakes the bot with it and where it found it; otherwise it ends quietly and nothing goes into the bot’s conversation. The bot decides whether and when to tell people. Ask the bot for other times, or for none, and it changes or removes the routine; Pots never adds it again, also after an upgrade or a restart.
📓 Its own memory
Each bot has one long conversation, across every channel. Its memory is plain markdown files, one per memory, and an index, MEMORY.md, that the bot sees at the start of every page and that points to them. Memory keeps facts and pointers that must outlast a page: how to reach a machine, where something is, people’s details, key dates, and decisions with who made them, when and where they are recorded. Each file names its source and, for a fact that stops being true, an expires date; after that date its line is no longer shown, and the file stays. Lasting rules and preferences go into the bot’s AGENTS.md, in the person’s own words. The bot saves memory itself when it sees something worth keeping, and its prompt names index lines whose file is missing and files with no line, so it can fix them. Each bot has its own memory, in memory/ in its folder, and the bots of one computer share one more, in ~/.pots/memory/, for facts about you. “Remember this” and “forget that” work by talking to it; to forget is to delete the file. A memory file read two days or more after it changed says how old it is. "settings": {"autoMemory": false} in bot.json turns the memory off.
Each index the bot sees starts with a status line, such as MEMORY.md: 69/200 lines, 10/25 KB; 4 lines link to expired memories. At most once a day, after the bot (its main agent or a child) changed its memory at least 5 times since the last one, a tidy runs in the background: the bot’s own model, continuing the same conversation, deletes expired memories, deletes one of two memories that say the same thing, shortens index lines that are too long and corrects the wrong one of two memories that contradict. It adds no facts and keeps no copies of what it deleted. A memory that reads as a rule or a preference it only names, for the bot to decide, unless the memory’s file already says what was decided. "settings": {"memoryTidy": false} turns it off. An extraction pass after each piece of work, as in Claude Code, which saves what the bot missed, is off by default; "settings": {"memoryExtraction": true} turns it on. Neither sends a message or holds up a reply, their requests start as the bot’s last one did, so the provider’s prompt cache serves most of them, and code lets them change nothing but the memory. The bot’s next wake says what they changed, with the tidy’s summary; a restart before that wake loses the note, not the memory.
When the context gets full, the bot decides when to turn the page: it writes notes for itself, starts a fresh context, and the notes and the memory come with it. The full message log stays on disk, so nothing is lost. Its AGENTS.md, its responsibilities and its notes are plain files it edits itself.
🛟 Durable by design
Built on pi-durable, every step is journaled. Kill the process in the middle of a task and it continues after restart. Every incoming event is written to disk before it is acknowledged. Every outgoing message carries a send ID, and after a crash the bot checks whether the message already went out before it sends again. Messages to one place go out in the order the bot sent them, each once the one before it is posted, so a reply in several messages reads in order; sends to other places do not wait.
When the model cannot answer
The network drops, the provider is slow or overloaded, or a usage limit is reached. The bot’s work does not end there: the run waits and asks its model again, 2, 4, 8 … 256 seconds apart, then every 5 minutes, and goes on where it stopped once the model answers. The messages, timed wakes and child reports that come meanwhile wait behind it, and none is used up. Children wait the same way. Each failed try is in the conversation’s journal, so the waiting goes on across restarts.
A time the provider names. When a failed response says when to come back (Retry-After, or the reset in the headers of the 429 of a Claude subscription’s usage limit), Pots sends that model nothing before then, for every bot, child and judge of the computer, and asks it again a second after that time. A limit of the whole account, such as Claude’s 5-hour and weekly limits, holds all the provider’s models; another one holds only its model. Once an hour one request goes out all the same, in case the time was wrong. A new login (pots login, or any change of pi’s auth.json), a restart or an answer of the model ends the wait. A time more than 8 days away is not believed.
When it stops. With no time named, a run stops after 24 hours without an answer. With a time named, such as a weekly limit days away, it waits until then. A request that went out and got no answer in time may still cost money, since the provider may have worked on it: a failure that came a minute or more after the request, or after part of the answer, counts as one, as does an answer a restart cut off after it began, and after 3 of them since the model last answered the run stops. A compaction’s summary has the same limits. A refusal (429, 5xx), a connection that never opened and a connect timeout come within seconds and cost nothing, so they do not count. A login the provider refuses, an account with no usage left and a request the model refuses end the run at once.
What people see. Without its model the bot cannot speak, so Pots posts one line for it in each place where people wait on it: a DM, a mention, a click on its button, or what the judge found it must very likely answer, for the wakes the run has or that wait behind it. It comes once the model has failed for a minute, or at once when the provider named a time a minute or more away, and it says why and when the bot goes on. Once per outage and place, never twice in a row, never after the model answered; one that the chat app did not take goes again, with the same send ID, at the next try. The typing stops there. When a run stops, a line says so and what happens next. Lines never hold the error, which can name the model’s configuration in a place others share; pots status shows it, and while the bot waits, since when, why, until when and the next try.
Going on by itself. After a stop at 24 hours, a refused login or no usage left, the bot goes on where it stopped once a model of its provider answers (another bot’s, a child’s, a look’s) or pi’s logins change, at most once every 5 minutes. After the stop for requests that may cost money it does not: the next wake, such as a new message, makes one try.
What the agent learns. When the model answers after failing a minute or more, or after a run stopped, the agent reads a note with that request: from when to when it failed, why, how many requests failed and the last error, which runs stopped and why, and the lines Pots posted where, and whether the chat app took them. The journal keeps the note before the answer. The agent decides what to do: answer, apologise, continue a child, or drop what is out of date.
The lines are in English. A bot writes them in its people’s language in "outage" in its bot.json; a key it does not set keeps the English text:
Key
When
English
waiting
while the run waits; {cause} is one of the five below, {when} is at or later
I am stuck: {cause}. I will carry on by myself {when}.
limit
a usage or rate limit (429)
my model’s usage limit is reached
overloaded
an overloaded or failing provider (5xx)
my model’s provider is overloaded or failing
network
no connection, a DNS error, a connect timeout
I cannot reach my model’s provider over the network
slow
out a minute or more, or cut off in its answer
my model’s provider does not answer in time
other
any other failure that may pass
my model does not answer
at
a time is named; {time} is like 15:00 (GMT+11), with the date when it is not today
at about {time}
later
no time is named
when it answers again
gaveUp
the run stopped after 24 hours
I stopped trying: my model has not answered for 24 hours. I will carry on by myself when it answers again. The reason is in pots status on the computer I run on.
tooSlow
the run stopped after 3 requests that may cost money
I stopped trying: my model did not answer my last 3 requests in time, and each of them may cost money. I will try again when a new message or task comes.
login
the provider refused the login (401, 403)
I cannot work: my model’s provider refused my login. Someone must sign in again with pots login on the computer I run on. Then I carry on by myself.
noUsage
no usage left (402, billing, quota)
I cannot work: my model’s account has no usage left. Someone must add usage, or sign in to another account with pots login, on the computer I run on. Then I carry on by myself.
refused
the model refused the request for another reason
I could not work on this: my model refused the request. The reason is in pots status on the computer I run on.
Quick start
Important 重要
The bot gets full control of the computer it runs on, with no approval step. Give it a computer or VM of its own.
On Windows, run them in cmd, or in PowerShell as npm.cmd and pots.cmd: PowerShell’s default policy refuses the .ps1 scripts that npm makes for them.
pots init asks four things:
Your bot’s name.
Its AI. Sign in with a subscription you already pay for (ChatGPT, Claude, Google AI Pro or Ultra, GitHub Copilot, Grok, Kimi and more), use an API key, or point it at a local server (Ollama, LM Studio, llama.cpp).
Who decides on group messages that do not mention it. By default the bot itself: every such message wakes it. Or Jev, a fast judge from TypeSafe, with your TypeSafe API key, or a judge model you already set up in pi; the bot then wakes only for the messages about its work.
In one sentence, what it is for. Optional. The bot writes its own persona and responsibilities from it.
Then the gateway starts as a background service (it starts again at login) and you are talking to your bot in the terminal. On Windows, Windows asks once whether to let Pots make changes: with Yes, the bot runs administrator commands without a prompt each time, as sudo without a password does on Linux. The bot first checks that it can use the computer’s screen and walks you through any permission it needs, such as Screen Recording and Accessibility on a Mac. On a server with no desktop, it works without a screen and asks you before it sets one up. Tell it which chat apps to join. It sets them up itself on its computer and signs in with what the computer has, such as your accounts in its browser and your password manager. It asks you only for what it cannot do, like a code that comes to your phone or an admin’s approval. Leave with Ctrl+C; come back with pots chat.
It works in the places it is in, like a new hire who is added to the right channels. On Slack it can also join public channels and create channels itself; a private channel needs an invite.
To add another bot, ask a bot you have to make one, or run pots bot new <name> --about "<what it is for>". The new bot sets itself up the same way, and when another bot already uses the screen, it offers to set up one of its own (Add another bot).
Command
What it does
pots init
Set up your first bot, or another one
pots login
Sign in to models and judges, or add API keys or local servers, one after another, for every bot on this computer; --list shows what can be used; --link prints a link to a login page instead, for a person on any device
pots mcp add | remove | list | login | logout
The MCP servers of every bot on this computer, and sign-ins to them
pots chat
Talk to a bot in this terminal
pots status
The gateway, the service and each bot
pots service install | uninstall | restart | logs
The gateway as a background service: launchd on macOS, systemd on Linux (--system for a server), Task Scheduler on Windows. restart waits until the new gateway runs, then says its version and which bots run
pots start
Run the gateway in this terminal instead
pots bot new | list
Create and list bots
pots trace
What a bot did: its last wakes, or one wake from the events to its run, the runs of the children it started, and the messages it sent, with how much of each model request the provider’s prompt cache served
pots admin <command>
Windows: run a command as administrator without Windows’ prompt; --check says whether it works, --setup asks Windows for it once
pots children [--stop <id> | --stop-all]
The children a bot started for longer work, with each one’s thinking level, the model the bot chose for it, and what each one that works does now, or stop them
To upgrade, run npm install -g pi-durable-bot@latest, then pots service restart. To remove it, run pots service uninstall, then npm uninstall -g pi-durable-bot. The bots stay in ~/.pots/ until you delete that folder.
Choose the models
pots init sets up the model, and pots login signs in to others or adds keys, one after another, for every bot on the computer. Each bot’s bot.json names its model and, if you want one, a judge, and you can change them at any time; edits apply within seconds. Logins, API keys and local endpoints are stored in pi’s files in ~/.pi/agent/, so the pi command line, if you use it, shares them.
The bot’s children, which do its longer work, have the bot’s model unless it chooses another one for a child, by the work, with Pots’ notes on the models signed in. At its first start it asks you which models you want for which work, and your answer comes first; sign in to those with pots login too.
Field
What it does
Values
model
The agent that reads, thinks and acts
Any pi model as provider/modelId, for example openai/gpt-6.2-sol or anthropic/claude-opus-5-5
thinking
How hard the agent thinks. A level the model does not have becomes the nearest one it has, as in pi
off, minimal, low, medium (default), high, xhigh, max
judge
Decides which messages that do not mention the bot should wake it
off (default): every message wakes the bot, and the agent decides provider/modelId of a classifier: typesafe/jev-latest, openrouter/typesafe/jev-1.14, opencode/jev-1.13-free, or a llama.cpp model main: the bot’s own model judges, no extra account, but slower
With off, each group of messages is a wake of the main model, which then decides. A fast classifier keeps the messages that are not for the bot away from it, and is cheaper and quicker than the main model: Jev answers in about 0.3 seconds. With main, each group of messages costs one short request to the main model before the bot hears of it.
A network that needs a proxy. The gateway sets up its network as the pi command line does: a proxy from HTTP_PROXY, HTTPS_PROXY and NO_PROXY, or from httpProxy in pi’s ~/.pi/agent/settings.json, and pi’s httpIdleTimeoutMs. Model requests, MCP servers over HTTP and the chat apps that use fetch go through it; Slack’s Socket Mode and Discord’s gateway connection do not.
Requests through OpenRouter, NVIDIA NIM and OpenCode name Pots (https://pots.sh) as the app, where pi would name itself; subscription logins send no such name.
OpenAI-compatible and local endpoints (Ollama, LM Studio, vLLM, a proxy): pots init and pots login add them for you. By hand, they go in pi’s ~/.pi/agent/models.json (fields):
Then set "model": "ollama/qwen3:8b". The agent needs a model that calls tools well and a context window of 32K tokens or more. In our tests a 4B model judged well but was too small to do the work alone; use the largest model your machine runs well.
llama.cpp can be both the agent and the judge. Start llama-server in router mode, then log in once with the pi command line: run pi, then /login llama.cpp (guide). Its chat models appear as llama.cpp/<model>. For the judge, use a decision model such as Kev-4B (3 GB), which answers through llama.cpp’s /v1/systemone; any chat model also works as a judge.
Providers from pi extensions. A pi extension can bring a model provider, such as pi-claude-code, which uses a Claude Pro or Max subscription through the Claude Code CLI. Pots loads no pi extension that pi itself has installed. It loads only the extensions in "extensions" in ~/.pots/settings.json, as pi’s -e takes them: paths, relative to ~/.pots, or package sources. From them it takes only their providers, for every bot on the computer; their tools and commands are for pi’s own sessions. For example, after git clone https://github.com/earendil-works/pi-claude-code ~/.pots/extensions/pi-claude-code and claude auth login:
{ "extensions": ["./extensions/pi-claude-code"] }
Then pots login --list shows the claude-code/... models, and a bot uses one as "model": "claude-code/claude-sonnet-5-5". A running gateway loads an extension added to the list within a few seconds. One taken out of the list or changed stays as it was loaded until pots service restart.
Gemini with a Google AI Pro or Ultra subscription. Run bots on Gemini 4 Neon and the rest of the Google plan you already pay for, with no API key. pots login → “Sign in with a subscription” → “Google AI Pro or Ultra: Gemini and more through Antigravity”. It adds the pi extension pi-agy (npm:@pots/pi-agy) to "extensions", installs Google’s Antigravity CLI (agy) with Google’s own install script when it is missing, and signs in with Antigravity’s own sign-in. Then a bot uses "model": "agy/gemini-4-neon", or Carbon, Hydrogen, an Orchestrator or a Claude model the account has. Each run of the bot is a turn of Google’s own agent through agy acp, as Antigravity’s terms allow: AGY’s own tools do files, commands and web search, and the bot’s other tools reach it over MCP. Antigravity’s AI credits must stay off; pi-agy does not run while they are on. It is about twice as fast as pi-antigravity-acp-provider on the same task, and one agy process serves every bot. The pi-agy README has the numbers and the details.
Images. A bot makes and edits images in codemode scripts with models.generateImages(); models.getAvailableOfType("image") lists the image models it can use. With the ChatGPT subscription signed in to pi (openai-codex), that is openai-codex/gpt-image-2, through the same endpoint the Codex CLI uses, on the subscription’s Codex usage. ChatGPT decides which accounts may: when it answers 403, the Codex CLI’s own image tool is refused too. OpenRouter’s image models work with an OpenRouter key.
MCP servers
The bot uses MCP servers through pi’s own MCP support. They are set in pi’s files: ~/.pi/agent/mcp.json for every bot on the computer and the pi command line, and .pi/mcp.json in a bot’s workspace/ for that bot alone. The bot’s codemode scripts call their tools, as with pi’s default exposure, so the tools the model is told about never change and the provider’s prompt cache keeps serving; a section of the prompt lists the servers. A server added, removed or changed applies from the bot’s next wake, with no restart.
Command
What it does
pots mcp add <server> -- <command> [args...]
Add a server that runs on this computer; --url <url> adds a remote one
pots mcp list
Each server, whether it connects, and its tools
pots mcp login <server>
Sign in to a server in your browser; logout signs out
pots mcp remove <server>
Remove a server
pots mcp is pi’s pi mcp, with the same options (pots mcp --help); npm links only pots, so pi may not be on your PATH. Sign-ins are stored in pi’s ~/.pi/agent/mcp-auth.json, and the bot uses a new one from its next request. When the browser is on another computer, as over SSH, paste the address the browser was sent to into the terminal.
The bot also looks for a command line tool, an API or an MCP server before it uses the screen. When it finds a command line tool that has no skill yet, it offers to write one in ~/.agents/skills/, so every bot and pi know when and how to use it.
How it decides to act
flowchart LR
E[New event] --> L[(Message log)]
E --> M{Mention or DM?}
M -- yes --> W[Wake the agent]
M -- no --> J{Judge, if set:<br/>about me?<br/>need to respond?}
J -- yes --> W
J -- no --> Q[Stay quiet, remember it]
T[Its own timers] --> W
W --> A{Agent reads the wake<br/>and decides}
A --> S[Speak, react or act]
A --> N[Do nothing]
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.
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
flowchart LR
subgraph Adapters[Channel adapters]
S[Slack]
D[Discord]
TG[Telegram]
MT[Teams]
FS[Feishu / Lark]
WX[WeChat]
T[Terminal]
end
subgraph Gateway[Gateway core, one per bot]
I[Inbox] --> G[(Message log)]
G --> K[Waker]
O[Outbox]
end
subgraph Bot[Bot]
P[Persona, responsibilities, notes, timers]
A[pi-durable agent<br/>read write edit bash screen<br/>send react call task codemode]
C[Children<br/>read write edit bash screen codemode]
A --> C
end
S --> I
D --> I
TG --> I
MT --> I
FS --> I
WX --> I
T --> I
K --> A
A --> O
O --> S
O --> D
O --> TG
O --> MT
O --> FS
O --> WX
O --> T
Layer
Job
Channel adapter
One per channel account. Translates events in and actions out, backfills what it missed. Platform concepts never leave this layer.
Gateway core
Inbox, message log, waker and outbox. The same for every platform.
Bot
Identity, persona, responsibilities, notes, timers, workspace and one long conversation.
Agent
pi-durable: runs the model, journals every step, owns the tools.
One gateway process runs every bot on the machine. Everything lives in ~/.pots/ (or $POTS_HOME): one folder per bot in bots/, channel tokens in secrets/, the memory the bots share about you in memory/, the gateway’s output in logs/ on macOS and Windows (on Linux, pots service logs reads the journal). Each bot folder holds:
File
What it is
bot.json
Name, model, thinking, judge, channel accounts, its screen and the VNC server that shows it, the lines Pots posts while its model cannot answer (outage), settings. Edits apply within seconds.
AGENTS.md
Personality and voice, read the way pi reads AGENTS.md. The bot maintains it.
responsibilities.md
What it is responsible for. The judge reads it. The bot maintains it.
notes.md
Its handoff to the next page: what it is doing and what it promised.
workspace/
Its working directory.
files/
Files people sent in messages, in files/tmp/: one folder per message, and in it one numbered folder per file. Pots deletes them 30 days after they were saved, and nothing else in the bot folder; the bot moves or copies out of files/tmp/ what it keeps.
terminal/
Its terminal channel: what you and the bot say in pots chat.
memory/
Its memory: one markdown file per memory, and MEMORY.md, their index. The bot maintains it.
bot.sqlite
Message log, timers, routines and the agent’s journal in one file.
The same pots command gives the bot (and its scripts and cron jobs) its actions from a shell: pots send, pots react, pots call, pots wake, pots routine, pots context, pots turn-page, pots children. Tokens stay inside the running gateway; the agent never sees them.
The bot sends its whole conversation with each model request, so the provider’s prompt cache matters: a request whose start the provider has cached costs a fraction. The system prompt holds only facts that stay the same, and the bot’s own parts of it, its memory too, keep their text for the whole page; a change, such as a new settings value in bot.json, shows after the page turns, after pi compacts, or after an upgrade. What changes from one wake to the next, such as the time, the context use and the bot’s own address in a channel, is in the wake. The main agent’s requests ask for the provider’s long cache entry (1 hour at Anthropic instead of 5 minutes) on models pi knows it for, as its wakes are often minutes to an hour apart; other models keep the provider’s default. Children, memory passes and the judge, which rarely pause, keep the short one, also with pi’s PI_CACHE_RETENTION=long. pots trace and pots context show how much of the input the cache served and what the requests that missed it cost.
A cache entry lasts about 5 minutes, and the bot often waits longer: for a person’s answer, or for a child’s work. So Pots warms the cache as the pi command line does: shortly before the entry of the main agent’s or a child’s last request expires, it sends that request again with a one-token answer, but only when pi’s numbers say the warm costs less than the miss it saves. It warms during a run for up to an hour after the request, and after the run for up to 30 minutes. pi’s setting cacheWarming in ~/.pi/agent/settings.json is the switch for both: idle (the default), streaming (only during a run) or off. Memory passes, compaction and the judge are not warmed. A warm is in pots trace, beside the request it repeats.
Status
pi-durable-bot runs every day as a teammate in a real workspace. What works today and what is next:
Slack adapter (socket mode), with backfill after downtime
Discord adapter (Gateway WebSocket), with backfill after downtime
Telegram adapter (long polling). Telegram’s Bot API cannot read history or look up a sent message, so the bot gets what it missed only within 24 hours, and a crash at the moment of a send can send it twice
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
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
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
Mention, DM, judge and timer wakes, grouping, and steering
Code mode on its own machine, pots command line
Turning the page with notes, compaction as a fallback
Memory it keeps by itself after each piece of work, its own and one shared about you
Crash-safe inbox and outbox, tested with a forced crash mid-send
Several bots per machine
pots init: name, AI, judge and one sentence, then the bot sets up its own chat apps from the terminal
macOS, Linux and Windows, as a background service of the user
The screen, mouse and keyboard of its computer, used like a person (computer use), or no screen on a server
Children for longer work in the background, whose final messages are kept across restarts; they wake the bot themselves when it needs to know
Any model pi can use: subscription logins, API keys, OpenAI-compatible endpoints, local models
A judge you choose: the bot’s own model, Jev or another classifier, a local llama.cpp model, or none
AGENTS.md, Agent Skills and images as in a pi session
MCP servers and code mode, through pi’s own MCP support
Pages, buttons, forms and a password page, with a public address that needs no setup
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
pots init in a web page, for people who do not use a terminal
Develop
git clone https://github.com/Crokily/pi-durable-bot && cd pi-durable-bot
npm install
npm run pots -- status # the pots command, straight from src/ (Node 24 runs TypeScript)
npm run check # type check
npm test # tests, including a real gateway with a fake model
npm run tla # the TLA+ models of the inbox, outbox, waker and a model that fails (needs Java and tla2tools.jar)
npm run build writes the JavaScript that the npm package ships to dist/. Set POTS_HOME to try things without touching ~/.pots/. With OTEL_EXPORTER_OTLP_ENDPOINT set, the gateway also sends its traces to any OpenTelemetry tool (Jaeger, Grafana Tempo, Honeycomb). Tests, the TLA+ models and traces in detail: docs/development.md. Coding agents: read AGENTS.md. Agents that set Pots up for someone: read docs/for-agents.md.
pi’s model layer for logins, providers and local models
Effect for the gateway core and the pots command line
TypeSafe AI’s Jev, one of the judges you can choose
Official accounts
Warning 警告
Heads up: Pots has no coin, token or airdrop, and never will. Accounts impersonating Pots (such as @potsdotsh on X) are promoting a “$POTS” coin. It is not ours; please don’t get scammed. Official accounts: @PotsSh and @Crokily_.
Sponsoring Colin on GitHub Sponsors is the only official way to support Pots.
License
MIT. The demo video, music, sky images and logo in docs/media were made for this project and use the same license.
On Windows, Pots downloads UltraVNC 1.8.3.2 (GPL-3.0) from uvnc.com the first time a bot needs it; Pots does not ship it.
The desktop page bundles noVNC 1.7.0 in kit/desktop/novnc.js, under the MPL 2.0, with the MIT-licensed pako in it; their license texts are in kit/desktop/novnc/. node scripts/vendor-novnc.ts builds that file from noVNC’s release.
评论