@jiangkoumo_: Pi officially published a tutorial on building a multi-user Agent on Cloudflare Durable Objects. A single Durable Object corresponds to one session, with state stored in the built-in SQLite. Multiple users can share the same link to join the same session and chat collaboratively…

X AI KOLs Timeline Tools

Summary

Pi officially published a tutorial on building a multi-user Agent on Cloudflare Durable Objects: a single Durable Object maps to one session, state is stored in built-in SQLite, and it supports multiple users sharing a link to chat collaboratively, as well as scheduled wake-up tasks. The tutorial also demonstrates an isolated design for session retrieval, idempotent request handling, and a mechanism for sharing a single alarm across multiple tasks.

Pi officially published a tutorial on building a multi-user Agent on Cloudflare Durable Objects. A single Durable Object corresponds to one session, with state stored in the built-in SQLite. Multiple users can share the same link to join the same session and chat collaboratively. The tutorial also demonstrates waking up after the page is closed to check the weather two minutes later. Session retrieval in the tutorial uses an isolated design. The main conversation dispatches the search-history task to a sub-agent, which only gets a plain-text substring search tool. It only searches user and assistant messages at the top level of the same session, and explicitly excludes its own messages as well as previously generated retrieval messages, preventing search results from becoming evidence for subsequent retrievals. Raw match records and intermediate tool calls from retrieval stay in the sub-conversation; the main conversation only receives a brief conclusion tagged with the conversation ID. The prompt explicitly requires a direct "not found" reply when nothing turns up. When a Durable Object is evicted or the retrieval tool is replayed, the code retrieves the original sub-conversation by task ID and continues execution. When creating a conversation, the receipt corresponding to the request ID is stored alongside the new conversation, so re-sending the same request after a disconnect won't create duplicates; concurrent inputs go into a persistent inbox queue and are queued. The due times of multiple tasks are projected onto a single underlying alarm. The official tutorial notes that the alarm may fire multiple times, so task-handling logic must remain idempotent — external calls cannot inherently guarantee exactly-once execution. This architecture is a useful reference for anyone building cross-conversation in-session retrieval or scheduled-task Agents. The official demo intentionally skips authentication; we only reviewed the official tutorial this time and did not deploy and run it locally.
Original Article
View Cached Full Text

Cached at: 10/17/26, 06:51 AM

Pi has published an official tutorial on building multiplayer agents on Cloudflare Durable Objects. A single Durable Object corresponds to one session, with state stored in the built-in SQLite. Multiple users can share the same link to join the same session and collaborate in chat. The tutorial also demonstrates waking up two minutes later to check the weather after the browser tab is closed.

The session retrieval in the tutorial uses an isolated design. The main conversation dispatches the search-history task to a subagent, which only receives a plain-text substring search tool. It only searches top-level user and assistant messages within the same session, explicitly excluding itself and messages generated by previous retrievals — preventing retrieved results from becoming evidence for subsequent retrievals.

The raw match records and intermediate tool calls from retrieval stay in the sub-conversation; the main conversation only receives a brief conclusion with a conversation ID. The prompt explicitly instructs the agent to reply “not found” directly when nothing matches.

When a Durable Object is evicted or the retrieval tool is replayed, the code recovers the original sub-conversation by task ID and continues execution. When creating a conversation, the request ID’s acknowledgment is committed to storage alongside the new conversation, so resending the same request after a disconnect won’t create duplicates — concurrent submissions are queued in a durable inbox.

Expiry times for multiple tasks are projected onto a single underlying alarm. The official tutorial notes that alarms may fire more than once, so task-handling logic must be idempotent; external calls cannot inherently guarantee exactly-once execution.

This architecture is a useful reference for anyone building cross-conversation in-session retrieval or scheduled-task agents. The official demo deliberately omits authentication; we only reviewed the official tutorial and did not deploy or run it locally.

Similar Articles

@realfxw: Running Multi-Agent systems in a distributed architecture, the biggest fear isn't slow model inference — it's "state loss" and "coordination deadlocks". Recently, many Agent teams have been discussing migrating orchestration logic to the edge. Paired with Cloudflare Durable Objects (…

X AI KOLs Timeline

The article introduces an edge-based multi-agent orchestration approach using Pi Durable Objects on Cloudflare: each session is mapped to a stateful Durable Object, enabling state persistence, sleep/wake cycles, and parallel sub-agent scheduling — eliminating the traditional heavy backend architecture built on Redis and message queues.

@JoshARosen: https://x.com/JoshARosen/status/2107840212915077350

X AI KOLs Following

一篇架构对比文章,分析 Pi Durable 与 OpenCode 的设计差异:Pi Durable 将模型生成、工具调用等序列化为可调度的持久任务,使工作不再绑定于单个进程,而传统会话式 harness(如 OpenCode、Claude Code、Codex)仍依赖进程内的活动 agent 循环。

@NFTCPS: After trying it out, flipping through sessions and switching branches in the terminal is a real pain. The pi coding agent released a web version, pi-web, where you can do these things directly in the browser: view session list, grouped by working directory, chat with the agent in real-time, switch models mid-conversation, fork from any message, or rollback…

X AI KOLs Timeline

The pi coding agent has launched a web version, pi-web, offering session management, real-time conversation, branch navigation, and more, which can be quickly run via npx.