SuperAPIAI Directory

pi-ralph

github.com · AI agents

pi-ralph is an extension for the coding agent pi that implements a multi-agent orchestration loop based on "hats" (roles). It lets the agent iterate between specialized roles such as Planner, Builder, and Reviewer until the task is complete. Each hat has its own instructions, trigger conditions, and events, and drives the workflow forward through an event protocol. The extension supports built-in presets, custom YAML workflows, PDD (Prompt-Driven Development) planning mode, session persistence, and history and loop popups, among other features, and includes guardrails such as a maximum number of iterations, a maximum runtime, and completion promises to prevent runaway loops. Note that this repository is deprecated and no longer maintained, and the official recommendation is to use the sub-agent example extension bundled with pi for multi-agent orchestration.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

pi-ralph is an extension for the coding agent pi, with the theme of a "hat-based multi-agent orchestration loop." According to the repository description, the package is deprecated, no longer maintained, archived, and will not receive updates for the current pi version; the official recommendation is that if you need multi-agent orchestration in pi, you can refer to the sub-agent example extension bundled with pi. The following content is compiled based on repository materials.

Purpose Ralph lets the agent iterate continuously through a set of specialized "hats" (i.e., roles) until the task is complete. Each hat has its own instructions, trigger conditions, and events, which are used to drive the workflow forward.

Main capabilities

  • Hat-based orchestration: specialized roles can be defined (such as Planner, Builder, Reviewer, etc.), and roles hand off work to each other through events.
  • Built-in presets: ready-to-use workflows for common tasks.
  • Custom presets: supports creating custom YAML-based workflows.
  • PDD planning: i.e., Prompt-Driven Development mode, used to turn rough ideas into detailed designs.
  • Event protocol: hats publish events that trigger the next hat, forming an autonomous loop.
  • Guardrails: prevents runaway loops through a maximum number of iterations, a maximum runtime, and completion promises.
  • Session persistence: loop state can be retained after a session restart.
  • History and loop popups: provides pop-up overlays for browsing iteration history and past loop records.

Usage Installation: clone the repository into pi's extensions directory, and pi will automatically discover and load the extension on the next startup. When used with pi-slack-bot, replace / with !; when running !ralph without arguments, the Slack bot also provides an interactive preset selector.

Custom presets can be placed in the following locations (the latter overrides the former):

  • ~/.pi/agent/extensions/ralph/presets/ (built-in)
  • ~/.pi/agent/ralph/presets/ (user-level)
  • <project>/.pi/ralph/presets/ (project-level)

How the loop works:

  1. When the loop starts, it looks for the hat triggered by starting_event.
  2. It injects the hat instructions into the system prompt.
  3. The agent works under the guidance of that hat.
  4. When finished, the agent publishes an event: >>> EVENT: event_name
  5. Ralph looks for theThe next hat triggered by this event.
  6. Repeat this process until the agent outputs completion_promise or reaches the limit.

PDD (Prompt-Driven Development) The /plan command starts an interactive planning session that turns rough ideas into: requirements (scope refined through iterative Q&A), research (technical investigation with findings recorded), design (detailed architecture with diagrams and acceptance criteria), and an implementation plan (directly executable step-by-step steps). All outputs are saved to specs/<task-name>/. The session is user-driven—without confirmation, Ralph will not move to the next stage. After planning is complete, it can be handed off to autonomous implementation.

Use cases Suitable for multi-agent orchestration within the pi coding agent, role-based task flow, and turning rough ideas into detailed designs and connecting them to autonomous implementation.

Limitations The repository is explicitly marked as deprecated, no longer maintained, and will not be updated for the current pi version; it is recommended to switch to pi's built-in sub-agent example extension. Information about fees, pricing, platforms, and specific results is not provided in the materials.

Inspiration: This project was inspired by @mikeyobrien's ralph-orchestrator, which is the original Ralph Wiggum technique used for autonomous AI agent orchestration.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools