pi-durable-bot

agent
Guvenlik Denetimi
Basarisiz
Health Uyari
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 6 GitHub stars
Code Basarisiz
  • fs module — File system access in package.json
  • network request — Outbound network request in scripts/slack-test.ts
  • exec() — Shell command execution in scripts/tlc.ts
  • spawnSync — Synchronous process spawning in scripts/tlc.ts
  • process.env — Environment variable access in scripts/tlc.ts
  • exec() — Shell command execution in src/agent/judge.ts
Permissions Gecti
  • Permissions — No dangerous permissions requested

Bu listing icin henuz AI raporu yok.

SUMMARY

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.

README.md
Pots logo

pi-durable-bot (Pots)

The open-source 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 · Quick start · How it decides · Open and yours · How it works

npm
Platforms: macOS, Linux, Windows
License: MIT
Built on pi-durable
Chat SDK
Node 24+

[!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: install it and run pots init, then the bot connects Slack and your other apps itself.

Pots reads Slack, email, Discord, X and calendars on its own, decides what matters, speaks up in #pricing, and does real work on its own computer

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.

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

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 (after a short pause, so you can finish typing)
It notices overhears something that is their job A judge reads each message that does not mention it and asks two questions: is this about me? and should I respond? It sees the bot's own list of responsibilities. The judge is the bot's own model, a fast classifier such as TypeSafe's Jev, or a local model
It checks in looks around now and then, and keeps promises It sets its own timed wakes: "check Acme's pricing every Monday", "follow up at 5 pm". If it has none, it looks around every two hours

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) plus three channel actions (send, react, call), and builds the rest itself.

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 schedule

It promises to come back, and it does. Timed wakes live in the same database as everything else, so they survive restarts. It can also add normal cron jobs on its machine.

📓 Its own memory

Each bot has one long conversation, across every channel. 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 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.

Open and yours

Grok Bot, dots, Muse and Claude Duet 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.

Closed AI coworkers pi-durable-bot
Source code Closed Open, MIT
Where it runs The vendor's cloud Your server, your VM, your office box
Model The vendor's Your subscription login, any of 40+ providers, or a local model
Your data Sent to the vendor Stays on your machine in one SQLite file per bot
Channels The ones the vendor supports Any channel with a Chat SDK adapter
Custom work What the vendor allows Anything. Change the code, add tools, connect your own systems

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, so adding Discord, Teams, Telegram or email is one 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.

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.

You need Node.js 24 or newer, on macOS, Linux or Windows (with Git for Windows).

npm install -g pi-durable-bot
pots init

pots init asks three things:

  1. Your bot's name.
  2. Its AI. Sign in with a subscription you already pay for (ChatGPT, Claude, GitHub Copilot, Grok, Kimi and more), use an API key, or point it at a local server (Ollama, LM Studio, llama.cpp).
  3. 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. It 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 asks you only for what it cannot do, like signing in to Slack or approving the app. Leave with Ctrl+C; come back with pots chat.

It joins only the places it is invited to, like a new hire who is added to the right channels.

Command What it does
pots init Set up your first bot, or another one
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
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 and the messages it sent

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. Each bot's bot.json names two models, 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.

Field What it does Values
model The agent that reads, thinks and acts Any pi model as provider/modelId, for example openai/gpt-6.1-sol or anthropic/claude-opus-5-5
judge Decides which messages that do not mention the bot should wake it main (default): the bot's own model judges, no extra account
provider/modelId of a classifier: typesafe/jev-latest, openrouter/typesafe/jev-1.14, opencode/jev-1.13-free, or a llama.cpp model
off: every message wakes the bot, and the agent decides

A fast classifier 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.

OpenAI-compatible and local endpoints (Ollama, LM Studio, vLLM, a proxy): pots init adds them for you. By hand, they go in pi's ~/.pi/agent/models.json (fields):

{
  "providers": {
    "ollama": {
      "baseUrl": "http://localhost:11434/v1",
      "api": "openai-completions",
      "apiKey": "ollama",
      "compat": { "supportsDeveloperRole": false, "supportsReasoningEffort": false },
      "models": [{ "id": "qwen3:8b", "contextWindow": 32768 }]
    }
  }
}

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.

{ "model": "llama.cpp/<your chat model>", "judge": "llama.cpp/Kev-4B-Q4_K_M" }

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: 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 log<br/>and decides}
  A --> S[Speak, react or act]
  A --> N[Do nothing]
  • Messages that arrive close together are grouped: it waits 3 seconds after the last one (20 seconds at most) before it judges.
  • If it is already working in a place, new messages there are handed to it as it works, so it can change course.
  • The wake message says only where, who, why and when. The agent reads the content itself.

How it works

flowchart LR
  subgraph Adapters[Channel adapters]
    S[Slack]
    T[Terminal]
    D[Discord, Teams, ...]
  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<br/>send react call]
  end
  S --> I
  T --> I
  D --> I
  K --> A
  A --> O
  O --> S
  O --> T
  O --> D
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 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, judge, channel accounts, 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 Notes it carries across pages.
workspace/ Its working directory.
terminal/ Its terminal channel: what you and the bot say in pots chat.
bot.sqlite Message log, timers 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 context, pots turn-page. Tokens stay inside the running gateway; the agent never sees them.

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
  • 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
  • Crash-safe inbox and outbox, tested with a forced crash mid-send
  • Several bots per machine
  • pots init: name, AI 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
  • 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
  • More adapters: Discord, Teams, Telegram, email
  • 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 and waker (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.

Built on

  • pi-durable for the durable agent runtime
  • Chat SDK for channel adapters
  • 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

License

MIT. The demo video, music, sky images and logo in docs/media were made for this project and use the same license.

Yorumlar (0)

Sonuc bulunamadi