Most multi-agent systems are one-directional: leader delegates, worker reports back.
connector.json supports bidirectional communication — agents that genuinely converse.
Unidirectional (everyone else): Leader → "do this" → Worker → "done, here's result" → Leader Worker never initiates. Worker never asks questions.Bidirectional (connector.json): Agent A → "what do you think about X?" → Agent B Agent B → "I think Y, but what about Z?" → Agent A Agent A → "good point, let me revise" → Agent B ...continues until convergence
Two PTY sessions. Each running a different AI.
The mailbox system routes messages between them.
┌──────────────────┐ mailbox ┌──────────────────┐│ PTY Session 1 │ ←──────────────────────→ │ PTY Session 2 ││ Claude Opus │ niia get-answer → │ Codex ││ │ ← niia write │ ││ "I think the │ │ "Actually the ││ auth flow │ │ bottleneck is ││ has a gap in │ │ in the token ││ session mgmt" │ │ refresh, not ││ │ │ session mgmt" │└──────────────────┘ └──────────────────┘
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.
Two AI agents argue opposing positions. A third judges.
{ "connector": "2.0", "name": "architecture-debate", "models": { "advocate": "claude", "challenger": "codex", "judge": "gemini" }, "pipeline": { "phases": [ { "name": "debate", "type": "dialogue", "participants": [ { "model": "advocate", "role": "Argue FOR microservices architecture." }, { "model": "challenger", "role": "Argue AGAINST microservices. Propose monolith." } ], "rounds": 3, "scratchpad": true }, { "name": "verdict", "model": "judge", "prompt": "Read the debate transcript. Which architecture is better for this specific codebase? Decide with evidence." } ] }}
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.
Two agents review each other’s work, not just a leader’s delegation.
{ "pipeline": { "phases": [ { "name": "implement", "parallel": true, "workers": [ { "id": "alice", "model": "claude", "prompt": "Implement the auth module." }, { "id": "bob", "model": "codex", "prompt": "Implement the auth module." } ], "session": { "worktree": "impl-{id}" } }, { "name": "cross-review", "type": "dialogue", "pairs": [ { "reviewer": "alice", "author": "bob" }, { "reviewer": "bob", "author": "alice" } ], "prompt_template": "Review {author}'s implementation. Compare with yours. Suggest improvements.", "rounds": 2 }, { "name": "merge", "model": "claude", "prompt": "Read both implementations and both reviews. Merge the best parts into final implementation." } ], "scratchpad": true }}
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.
One agent asks questions. The other explains. Together they find gaps.
{ "pipeline": { "phases": [ { "name": "exploration", "type": "dialogue", "participants": [ { "model": "opus", "role": "You are investigating a bug. Ask questions to understand the codebase." }, { "model": "haiku", "role": "You know this codebase well. Answer questions concisely. If you're not sure, say so." } ], "rounds": 5, "scratchpad": true }, { "name": "hypothesis", "model": "opus", "prompt": "Based on the Q&A session, form a hypothesis about the bug's root cause." } ] }}
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 ($$$$$$).
Unidirectional multi-agent is delegation: one AI telling others what to do.
Bidirectional multi-agent is collaboration: multiple AI reasoning together.
Delegation: Manager → Worker → Result One perspective. One approach.Collaboration: Agent A ↔ Agent B → Synthesis Multiple perspectives. Challenged assumptions. Better results through disagreement.
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.
Bidirectional communication uses the same PTY infrastructure:
1. Agent A writes response to PTY2. niia get-answer reads Agent A's response3. niia write sends it to Agent B's PTY4. Agent B writes response5. niia get-answer reads Agent B's response6. niia write sends it back to Agent A7. Repeat for N rounds
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.