omp packages

pi-agents0.34.1

Durable, named agents for Pi: delegate tasks, compose agents into graphs, and watch them work.

GitHub Actions Published 1 day ago MIT ~3.4K downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

๐Ÿค– pi-agents

Give Pi durable, named agents. Delegate a job, keep working while the agent runs, and get its result back as a message. Watch any agent live, talk to it, or stop it. Agents survive crashes and restarts.

Agents run inside your Pi process on pi-durable, which checkpoints every step. When you resume a session, interrupted agents continue where they stopped.

[!CAUTION] Agents can't use MCP servers (earendil-works/pi#10837) or tools from other extensions, such as web search (earendil-works/pi#10386). They work with Pi's built-in tools: read, bash, edit, write, grep, find, ls, and codemode. MCP servers and extension tools live in Pi's session, while agents run on pi-durable.

Pi starts an audit graph on three models whose reviewers delegate one helper per file, shows the live tree and the merged findings, browses the results in /agents, and spawns three agents that tell jokes Scout messages fixer about a concurrency bug, fixer patches it and replies, and Pi browses their exchange in /messages and attaches to both agents
Delegate work to agents and graphs
Run parallel reviews, follow progress, and bring the findings together.
Agents message each other
Coordinate a fix between agents, then browse their conversation.

๐Ÿš€ Installation

pi install npm:pi-agents

โœจ Usage

Have an agent review src/run for error handling while we keep going.
Spawn two agents in parallel: one maps the API surface, one checks the tests.
Merge their findings once both report back.
Start a graph: three agents review src/run, src/ui, and src/host, and a
fourth merges their findings into one list of issues.
Start an agent that may delegate: it finds every module under src, has one
helper review each, and returns one merged review.

Pi starts agents only when you ask for delegation. An agent's result is its final message. Agents work in the background and their results arrive as messages in your conversation, so you can keep talking to Pi meanwhile. In a graph, agents pass their results to each other, and Pi gets one message at the end.

The usage manual covers the rest: the panel, attaching to agents, graphs, delegation, messaging, profiles, and configuration.

๐Ÿ—๏ธ Architecture

Agents run inside your Pi process. Pi-agents keeps one pi-durable harness per Pi session, with its own store, kept apart from Pi's session file:

โ•ญโ”€ Pi process โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚                                                                  โ”‚
โ”‚  โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ  โ”‚
โ”‚ โ•ญโ”ค  โ—† Pi session: MCP, extension tools โ”‚ โ”‚  โ–ค panel           โ”‚  โ”‚
โ”‚ โ”Šโ•ฐโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ฒโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚  โ‡„ attach view     โ”‚  โ”‚
โ”‚ โ”Š    โ”‚ agent_*  โ”‚ results                โ”‚  โ‰ก /agents         โ”‚  โ”‚
โ”‚ โ”Š    โ–ผ          โ”‚                        โ”‚  โœ‰ /messages       โ”‚  โ”‚
โ”‚ โ”Šโ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ•ฎ                    โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ฒโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ  โ”‚
โ”‚ โ”Šโ”‚  โœฆ pi-agents     โ”œโ—€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ             โ”‚
โ”‚ โ”Šโ•ฐโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ฒโ”€โ”€โ”€โ•ฏ                                            โ”‚
โ”‚ โ”Š    โ”‚ start    โ”‚ state                                          โ”‚
โ”‚ โ”Š    โ”‚ message  โ”‚ results                                        โ”‚
โ”‚ โ”Š    โ–ผ stop     โ”‚                                                โ”‚
โ”‚ โ”Šโ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ  โ”‚
โ”‚ โ”Šโ”‚  pi-durable harness                                        โ”‚  โ”‚
โ”‚ โ”Šโ”‚                                                            โ”‚  โ”‚
โ”‚ โ”Šโ”‚   โ—‰ scout โ”€โ”€โ”€ message โ”€โ”€โ–ถ โ— notes                          โ”‚  โ”‚
โ”‚ โ”Šโ”‚                                                            โ”‚  โ”‚
โ”‚ โ”Šโ”‚   โ•ญโ”€ graph โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ  agent tools:        โ”‚  โ”‚
โ”‚ โ”Šโ”‚   โ”‚ โ— map โ”€โ”ฌโ”€โ–ถ โ—‰ core โ”€โ”ฌโ”€โ–ถ โ—‹ report โ”‚  read  bash  edit    โ”‚  โ”‚
โ”‚ โ”Šโ”‚   โ”‚        โ””โ”€โ–ถ โ—‰ ui โ”€โ”€โ”€โ”˜            โ”‚  write  grep         โ”‚  โ”‚
โ”‚ โ”Šโ”‚   โ”‚            โ””โ”€ โ—‰ โ—‰ โ—‰ helpers     โ”‚  find  ls  codemode  โ”‚  โ”‚
โ”‚ โ”Šโ”‚   โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ                      โ”‚  โ”‚
โ”‚ โ”Šโ”‚                                                            โ”‚  โ”‚
โ”‚ โ”Šโ”‚   agents are conversations; turns, tool calls, and graphs  โ”‚  โ”‚
โ”‚ โ”Šโ”‚   are durable tasks that own what they start               โ”‚  โ”‚
โ”‚ โ”Šโ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ  โ”‚
โ•ฐโ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
  โ”Š saves                        โ”‚ checkpoint every step
  โ–ผ                              โ–ผ
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ    โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ โ–ค Pi's session file  โ”‚    โ”‚ โ–ค pi-agents store, one per   โ”‚
โ”‚   your conversation, โ”‚    โ”‚   session: agents, graphs,   โ”‚
โ”‚   saved results, and โ”‚    โ”‚   messages, tasks            โ”‚
โ”‚   message cards      โ”‚    โ”‚                              โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ    โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

docs/architecture.md explains how agents, graphs, and results stay durable across crashes and restarts.

๐Ÿ“š Documentation

  • Usage: glossary, states, skills, UI, commands, and tools.
  • Graphs: coordinating agents and delegating to helpers.
  • Messaging: using messages and their guarantees.
  • Agent profiles: reusable settings and instructions.
  • Configuration: models, requests, and footer counts.
  • Architecture: durable tasks, recovery, and storage.