Skip to main content

Bidirectional AI Communication

Most multi-agent systems are one-directional: leader delegates, worker reports back. connector.json supports bidirectional communication — agents that genuinely converse.

The Difference

How It Works

Two PTY sessions. Each running a different AI. The mailbox system routes messages between them.
The orchestrator reads one agent’s response, feeds it to the other, and repeats. Each agent sees the full conversation history — they’re having a real dialogue.

Debate Pattern

Two AI agents argue opposing positions. A third judges.
Round 1: Claude argues for microservices. Codex argues against. Round 2: Each reads the other’s argument and responds. Round 3: Final rebuttals. Verdict: Gemini reads the full transcript and decides. Three different AI models. Three different perspectives. One decision.

Peer Review Pattern

Two agents review each other’s work, not just a leader’s delegation.
Both implement independently → Each reviews the other’s code → Best parts merged. Neither agent is “senior”. Both contribute. Both critique. The result is better than either could produce alone.

Socratic Teaching Pattern

One agent asks questions. The other explains. Together they find gaps.
Opus asks probing questions. Haiku answers from codebase knowledge (cheap, fast). After 5 rounds, Opus has enough context to hypothesize — without reading every file itself. Cost: 5 rounds of Haiku responses ($) + 1 Opus synthesis ($$$) vs Opus reading everything ($$$$$$).

Red Team / Blue Team

One agent attacks. The other defends.
Codex attacks. Claude defends and patches. Gemini judges. Three AI models, three roles, one security audit.

Why Bidirectional Matters

Unidirectional multi-agent is delegation: one AI telling others what to do. Bidirectional multi-agent is collaboration: multiple AI reasoning together.
When two different LLMs debate, they catch each other’s blind spots. Claude’s reasoning depth + Codex’s speed + Gemini’s breadth = stronger than any one alone.

Implementation

Bidirectional communication uses the same PTY infrastructure:
The mailbox (get-answer + DB) persists the full conversation. Both agents see the entire dialogue history. The orchestrator just routes messages between PTY sessions. No special protocol needed. No JSON-RPC. No structured I/O. Just reading terminal output and typing into another terminal. The simplest possible implementation of AI-to-AI communication. Dialogue is one step on the topology spectrum. For all-at-once multi-agent conferences, see Meeting Protocol. For any-agent-to-any-agent communication without a leader, see N-to-N Topology. For the full topology spectrum, see Dimensional Growth.