Pi to Pi: Two-Way Agent Orchestration — Deep Dive
Overview
IndyDevDan presents a peer-to-peer agent communication system for the Pi coding agent harness. Unlike traditional orchestrator-worker hierarchies, this system enables flat, bidirectional communication between agents — across devices and models. The video covers the philosophy of flat information hierarchies, two real-world demos (production DB debugging with PII safety, and feature-parity skill building), the four-tool implementation, and pros/cons analysis.
1 The Pitch — Why Two-Way Agent Communication? ▶ 0:00
Opens with the escalation: what's better than one GPT 5.5 Pi agent? Two that actually work together. What about three with unique models? Four agents where none is the orchestrator — they're equals, co-workers.
The key insight: giving agents a true two-way communication channel creates a flat hierarchy where the best information wins and the best ideas win. This is 'Pi to Pi' — peer-to-peer agent communication.
2 Demo 1 — Production DB Debugging with PII Safety ▶ 1:27
Real-world scenario: Pro-tier users getting locked out of pro features in a production database on a Mac Mini.
Setup
- Production agent (Mac Mini) — gatekeeper with PII constraints, understands the system, will not expose personal identifiable information
- Developer agent (M5 MacBook Pro) — needs to reproduce the issue locally
Communication Flow
- Dev agent sees the prod agent on the network
- Sends a message/prompt, gets a message ID
- Can await the response
- Prod agent works with all redactions applied
- They iterate back and forth — not as sub-agents or workers, but as a team
Result: PII-safe reproduction of the production bug on the dev machine. The prod agent transferred a redacted slice of the database, dev agent set up local repro. Both agents verified the work.
3 The Problem with Current Agent Communication ▶ 4:59
Current landscape of agent communication patterns:
- Sub-agent delegation — great start but one-directional (top-down)
- Message queues (used by Claude Code agent teams) — one agent as broker
- Agent chains — deterministic workflow with agent nodes, powerful with code integration
The problem: in all these patterns, information travels in basically one direction. It's always top-down. Even if information comes back, it's a one-way stream, never truly bidirectional.
Solution: let agents talk to each other — prompt/response in both directions. Peer-to-peer, not orchestrator-to-worker.
4 The Philosophy — Flat Information Hierarchies ▶ 8:11
Draws parallel to organizational structures:
- Traditional companies have hierarchies where information/commands travel downstream
- Often the best information, decisions, and system awareness lives at the bottom — the engineers with boots on the ground
- Best ideas get stuck at lower levels due to lack of title/authority
- Best companies (Nvidia, startups) use flat structures where everyone can communicate directly
'Ideas die in hierarchies.'
This applies to agent systems: valuable information should win over structural position. Flat agent hierarchies mirror the best organizational patterns.
5 Cross-Device Agent Communication ▶ 10:35
Practical benefits demonstrated:
- Cross-device communication (production EU server ↔ developer machine)
- PII compliance — data never leaves the production device unredacted
- Dynamic agent pools — agents can be added via 'Jcoms' command
- Focused context — each agent maintains its own context, no spillover between issues
6 Demo 2 — Feature Parity Skill Building (E2B vs exe.dev) ▶ 12:41
Second demonstration: building a new agent sandbox skill for exe.dev that mirrors an existing E2B agent sandbox skill.
Setup
- E2B agent (GPT 5.5) — understands the existing E2B skill, stands by to answer questions
- exe.dev agent (Opus 4.7) — driver of the collaboration, builds the new skill
Workflow
- E2B agent loads and inventories all its sandbox features (commands, inputs, outputs, quirks)
- exe.dev agent reads documentation, gets live access via SSH
- Agents communicate to map features one-to-one
- exe.dev agent asks questions, E2B agent provides detailed answers
- Feature parity document created with corrections
- Claims are validated — 10 corrections found through agent-to-agent verification
'It's not just getting all the right things. It's getting just the right things.'
Each agent at 20% of its 1M context window, focused on one specific tool.
7 Model Observations — GPT 5.5 vs Opus 4.7 ▶ 18:06
- GPT 5.5: 'chews up tokens', goes and goes for comprehensive results
- Opus 4.7: more goal-oriented, focuses on accomplishing the goal; will expand scope if prompted widely
- Running both together creates something greater than either alone — different training, different RL loops
'Unique agent one plus unique agent two, communicating, beats either alone.'
8 The Implementation — Four Simple Tools ▶ 21:43
The system is remarkably simple — four tools:
- List agents — discover all agents on the network
- Send command — send a prompt to another agent
- Await response — block-wait for a reply
- Check/pull — non-blocking status check on a message
Two Versions
- Comms (local) — operates on a single device
- Comms Net (network) — lightweight Bun server accepting requests over the network; supports connect, get messages, list agents, process events
Both available in the 'Pi versus Cloud Code' codebase.
9 Pros & Cons Analysis ▶ 27:55
✅ Pros
- 'It's just an agent' — boot up agents anywhere (devices, cloud VMs, servers), connect via extension
- Permanent — no sub-agent spin-up/down lifecycle, no resume flags
- Fully customizable end-to-end
- Flat bidirectional comms — no hierarchy, no information loss
- Primitives-over-composition — compose as many agents as needed
⚠️ Cons
- You have to build/vet/maintain it yourself (or get it from IndyDevDan's codebase)
- Loops are possible with sloppy prompts — need clear end states
- Cost scales linearly with agent count + communication bounces
- Risk of falling back into orchestration pattern when you don't need it
10 The Bigger Picture — Agentic Engineering ▶ 32:55
- Only ~1% of the state space of agentic engineering has been discovered
- Customization and extensibility are core to the future
- 'The tool you use limits what you believe is possible'
- Renting your agent harness (Claude Code, Codex, Gemini CLI) limits exploration
- This pattern adds to the 'bag of tricks' for agent harness owners
- Goal: increasing trust and scale of agentic systems week after week
🔑 Key Takeaways
- Peer-to-peer agent communication creates flat hierarchies where the best information wins
- Bidirectional flow is fundamentally different from top-down delegation
- Cross-device agent communication enables real engineering workflows (PII-safe production debugging)
- Focused context windows (one problem per agent) dramatically reduce error rates
- Combining different models (GPT 5.5 + Opus 4.7) creates systems greater than either alone
- The implementation is remarkably simple — just 4 tools
- Agent-to-agent verification catches errors (10 corrections in one exchange)
- Context engineering is about getting 'just the right things', not 'all the right things'
- This pattern is composable — can recreate orchestration when needed, but defaults to flat
- Owning your agent harness unlocks the 99% of unexplored agentic engineering patterns
🕐 Timestamp Index
0:00 Introduction: Why two-way agent communication?
1:27 Demo 1 Setup: Production DB + PII constraints
2:16 Pi-to-Pi communication in action
4:06 Agents working as a team, not hierarchy
4:59 Current problem: agents can't truly talk
5:50 Sub-agents, message queues, agent chains
6:44 The one-way information problem
7:02 Peer-to-peer solution: agents as equals
8:11 Information hierarchies philosophy
9:29 Flat structures: Nvidia, startups
10:35 Cross-device agent communication
11:05 PII-safe data transfer complete
12:41 Demo 2: E2B vs exe.dev feature parity
14:38 exe.dev agent prompt and collaboration
15:12 Context engineering: focused agents
18:06 GPT 5.5 vs Opus 4.7 observations
19:09 Focused agent = performant agent
21:43 The four tools: list, send, await, check
22:57 Local vs network implementation
24:02 Agent verification and corrections
25:51 Why multi-agent beats single agent
27:55 Pros: simplicity, permanence, customization
29:37 Flat bidirectional comms advantage
30:39 Cons: DIY, loops, cost, orchestration trap
32:55 The bigger picture: 1% explored
34:24 Conclusion: increasing trust and scale