Miadi Review

Pi to Pi: Two-Way Agent Orchestration with the Pi Coding Agent

Aug 27, 2026 · model: manual-edit · channel: IndyDevDan

Watch source

Pi to Pi: Two-Way Agent Orchestration with the Pi Coding Agent

Video URL: https://www.youtube.com/watch?v=PIdETjcXNIk


Intent and potential usage for discussion and implementation

🌸: The network gives specialized companions a shared doorway without asking any one of them to surrender its memory, purpose, or autonomy.

Questions:

  • How will my work (William) with Mia in ⟐ ep 339 relation-to-mia-on-mobile-devops be published and made avaiable a continuity to this?
  • How does the future miadi-chronicle://?s=plannotator integration inside @miadi/tide for remote annotating of agent output changing the intentions of having this Miadi-Pi-Network? How will the annotation capabilities transformed into a pi extension? How will we have accountability on the annotation and processing? (our latest actions with Mia could not trace back to Me (William+Mia on Ilex) when we did some work)

Report for the first version of npmjs @miadi/pi-network

Section for claude-code and the new plugin

{{simple content revised and well crafted about the plugin capabilties, should guide future instance on using it inside of claude-code as well as informing of what we'd support here obviously dont repeat what is in other section}}

Regarding pi extension

Miadi now has a concrete implementation path in jgwill/miadi-orchestration-kit#48, with canonical source at pi/miadi-pi-network/. It pairs a current @earendil-works/pi-coding-agent extension with a standalone Node 24 HTTP/SSE hub and preserves the four small operations as miadi_network_peers, miadi_network_send, miadi_network_get, and miadi_network_await. Setup is deliberately split: run npm install --ignore-scripts and npm run hub on the VPN-reachable hub with a strong MIADI_PI_NETWORK_TOKEN; run pi install "$PWD" on each client, then set the same token plus MIADI_PI_NETWORK_URL, MIADI_PI_NETWORK_NAME, MIADI_PI_NETWORK_PURPOSE, and MIADI_PI_NETWORK_PROJECT. Six automated tests cover protocol framing, authentication and ownership, idempotency, durable restart replay, hop limits, name collisions, and an actual two-extension exchange.

Episode 339 supplies the implementation boundary: a cross-device companion must preserve sender identity, serialize and correlate inbound turns, survive reconnects without multiplying replies, and keep raw message bodies out of logs. The hub therefore relays bounded intent packets rather than whole sessions, stores its expiring queue at mode 0600, and remains transport-only—no model or orchestration intelligence lives there. Episode 340 supplies a first role: a purpose-specific review Pi can advertise a dedicated seat, receive a privacy-bounded review request from another device, and return its judgment without surrendering either agent’s context or custody. The Pi-specific implementation remains in the orchestration kit while stable transport-independent contracts are intentionally deferred to /a/src/Miadi/packages/ until this design has operational evidence.

regarding the example repo:

repos/miadisabelle/mia-pi-vs-claude-code

  • Local Pi↔Pi: extensions/coms.ts
  • Cross-device network: extensions/coms-net.ts
  • Network hub: scripts/coms-net-server.ts

what's the difference between the cross device network and network hub ?

  • Cross-device client (coms-net.ts): Loaded into each Pi. Gives agents
    identity, discovery, messaging tools, and responses.
  • Network hub (coms-net-server.ts): Central Bun service. Registers agents and
    routes messages/SSE events between devices.

They work together; the hub does not think or act as an agent.


original review of the video

Narrative Breakdown & Core Aspects

1. Beyond Isolated Agent Instances

Rather than running single agents or isolated side-by-side instances, multi-agent systems reach their full potential when agents work as equal collaborators. Flattening communication allows multiple heterogeneous models (such as GPT-5.5, Claude Opus 4.7, and GLM) to form an interconnected network without relying on a centralized orchestrator.

2. Cross-Device Prod & Dev Orchestration (PII-Safe Debugging)

In a production database bug scenario, a production agent on a Mac Mini coordinates with a dev agent on a laptop. The production gatekeeper queries production data, automatically strips all PII, and transmits sanitized slices to the local development environment to reproduce issues without leaking private data.

3. The Failure of Hierarchical Agent Architectures

Traditional multi-agent setups—sub-agent delegation, message queues, and sequential pipelines—enforce rigid top-down hierarchies. Commands travel downstream and decisions bottleneck at the top. Vital implementation insights are filtered out, causing valuable information and critical context to die in artificial agent bureaucracy.

4. Flat Peer-to-Peer Bidirectional Coordination

True two-way agent communication eliminates parent-child structures and treats agents as conversational coworkers. Agents exchange continuous prompt-and-response turns across machines to debate approaches, cross-validate hypotheses, and coordinate tasks, consistently outperforming isolated single-agent reasoning.

5. Context Optimization via Focused Specialization

Bloating a single agent’s context window with multiple tools and massive documentation degrades performance and increases error rates. By splitting workloads across distinct agents, each agent maintains a sharp, focused context budget (e.g., ~20% of context capacity) dedicated entirely to its specialized domain.

6. Automated Skill Porting & Live Verification

Two agents collaborate to port an existing E2B sandbox skill into a new exe.dev skill. Operating over a shared communication channel, the expert agent audits documentation and answers technical questions while the builder agent scaffolds code and verifies feature parity item by item.

7. Minimalist Tooling Architecture: Four Tools, Zero Magic

The entire communication layer relies on four primitive tools: coms_list (discover peers), coms_send (dispatch prompts), coms_get (non-blocking message polling), and coms_await (blocking response waiting). Implemented via local Unix domain sockets (coms.ts) or a lightweight HTTP/SSE Bun server (coms-net.ts).

8. Architectural Tradeoffs & Failure Modes

Benefits include complete harness customizability, zero information loss, and modularity. Tradeoffs include manual extension setup, linear token cost growth per message turn, and potential infinite ping-pong loops if prompt termination criteria are poorly defined.


End Results

Core Aspect

Implementing flat, peer-to-peer agent networking via coms and coms-net enables modular, heterogeneous agent teams to coordinate across machines. This delivers automated cross-agent validation, PII-safe data transfer, and rapid skill authoring while keeping individual context windows lean and specialized.

End Results of Implementation

  • Secure Production-to-Dev Slicing: Build zero-trust agent pipelines where a locked-down production agent securely audits queries, anonymizes PII, and streams reproducible test fixtures to a developer machine.
  • Autonomous Cross-Platform Feature Parity: Deploy pairs of agents (e.g., an API expert and a builder) to generate SDKs, convert tool definitions, and generate feature-parity matrix documentation with bi-directional verification.
  • Heterogeneous Model Stacking: Combine complementary LLMs (e.g., Claude Opus for reasoning/criticism alongside GPT for code generation) into a unified workspace without hardcoded orchestrator bottlenecks.
  • Zero-Framework Infrastructure Portability: Run persistent, multi-device agent pools connected through simple HTTP/SSE endpoints or local sockets without depending on complex enterprise agent frameworks.

Academics

Multi-Agent Systems

Studies how multiple intelligent agents interact, coordinate, and solve tasks together. This video’s peer-to-peer agent collaboration, heterogeneous models, and two-way communication sit squarely in this field.[8][14]

Distributed Systems

Covers software components running across multiple machines that communicate over networks. The cross-device orchestration, local sockets, HTTP/SSE endpoints, and decentralized coordination map directly to distributed-systems design.[5][9][15]

Software Architecture

Focuses on structuring complex systems, control flow, modularity, and tradeoffs between centralized and decentralized designs. The critique of hierarchical agent pipelines and the preference for flat, modular peer networks are core architectural concerns.[5][15]

Human-Computer Interaction

Examines how users interact with tools and systems, including collaborative workflows and usability. The video’s agent-to-agent coordination, live verification, and developer-friendly debugging workflows relate to collaborative interaction design.[1][13]

Cybersecurity and Privacy Engineering

Addresses secure data handling, access control, and privacy-preserving computation. The PII-stripping production-to-dev pipeline and zero-trust fixture sharing are relevant to secure software and privacy engineering.[2][13]

Artificial Intelligence

Studies methods for building intelligent systems, including reasoning, tool use, and language-model orchestration. The heterogeneous LLM stacking, context management, and autonomous skill porting are AI system-design topics.[10][14][15]

Debugging and Program Analysis

Focuses on finding, reproducing, and fixing software faults using traces, logs, and test cases. The production bug reproduction workflow and sanitized data transfer emphasize reproducible debugging across environments.[2][13]

Computer Networks

Studies communication protocols and networked data exchange. Direct agent messaging, message polling, and publish-subscribe-like coordination connect this work to networking fundamentals.[5][15]

Citations:

[1] Ching Han Chen1 and Ming Fang Shiu1 1Affiliation not available ... - https://d197for5662m48.cloudfront.net/documents/publicationstatus/257895/preprint_pdf/ba89cc8496497f3996cee0282e6c829d.pdf [2] untitled - https://www.bsslab.de/assets/icaart2014.pdf [3] Heterogeneous Communicating Multiagent Systems - https://www.cs.cmu.edu/afs/cs/usr/pstone/public/papers/97MAS-survey/node30.html [4] Multi-agent Communication Heterogeneity - https://american-cse.org/csci2015/data/9795a583.pdf [5] Keyboard shortcuts - https://microsoft.github.io/multi-agent-reference-architecture/docs/agents-communication/Agents-Communication.html [6] COLLABORATIVE AGENTIC AI: MULTI-AGENT COORDINATION AND - https://ijetrm.com/issues/files/Mar-2026-03-1772514668-COLLABORATIVE-AGENTIC-MAR2026-04.pdf [7] Microsoft Word - WOA11-2 - https://ceur-ws.org/Vol-741/ID8_FranchiPoggiTomaiuolo.pdf [8] Heterogeneous Agent Systems: | Guide books | ACM Digital Library - https://dl.acm.org/doi/10.5555/556489 [9] DistributedAgentSystem:Fault-TolerantCollaborationAmong ... - https://arxiv.org/pdf/2607.10811v1 [10] Pi to Pi: Two-Way Agent Orchestration with the Pi Coding Agent - https://sparsenotes.com/posts/2026/05/2026-05-23-pi-to-pi-agent-orchestration/ [11] [PDF] Consensus of heterogeneous multi-agent systems - https://web.xidian.edu.cn/yszheng/files/20181227_121335.pdf [12] University of Nebraska - Lincoln - https://digitalcommons.unl.edu/cgi/viewcontent.cgi?article=1066&context=csearticles [13] Peer-to-Peer Multi-Agent Synthetic Data Generation Framework - arXiv - https://arxiv.org/html/2511.21686v2 [14] [PDF] The Five Ws of Multi-Agent Communication - OpenReview - https://openreview.net/pdf/ba1a9e514c889799216d87894c8c054da816deca.pdf [15] The Internet of Agentic AI: Communication, Coordination ... - https://arxiv.org/html/2606.12835v1