Orchestration maps for multi-agent systems
Agent builders wire orchestrators, subagents, tools, and memory — and the wiring changes weekly. An mdd orchestration map is agent-native documentation: the JSON model is ground truth the system itself can read and update, and the ASCII renders in the README, the context file, and the terminal.
An orchestrator and its subagents
An orchestrator dispatching to three subagents inside a cluster boundary, with shared memory and a tool sandbox below. The JSON beside it is what your agent edits when the wiring changes.
<!-- mdd:begin id=agents src=docs/agents.diagram.json -->
```
┌──────────────┐
│ Orchestrator │
└───────┬─────▲┘
┌───────────────────┤ verdict──┐
│ │ └─────┤
┌┄ subagents ┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┼┄┄┄┄┄┄┄┄┄┄┄┼┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┐
┆ ┌────────▼───────┐ ┌───────▼──────┐ ┌▼─────────────┐ ┆
┆ │ Research Agent │ │ Coding Agent │ │ Review Agent │ ┆
┆ └────────▲───────┘ └───────┬──────┘ └──────────────┘ ┆
└┄┄┄┄┄┄┄┄┄┄┼┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┼┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┘
│ │
│ │
┌───────▼───────┐ ┌───────▼──────┐
│ Shared Memory │ │ Tool Sandbox │
└───────────────┘ └──────────────┘
```
[diagram source](docs/agents.diagram.json)
<!-- mdd:end -->The model your agent edits
{
"version": 1,
"boxes": [
{
"id": "orchestrator",
"label": "Orchestrator",
"row": 0,
"connections": [
{
"to": "researcher",
"arrow": "to"
},
{
"to": "coder",
"arrow": "to"
},
{
"to": "reviewer",
"arrow": "to"
}
]
},
{
"id": "researcher",
"label": "Research Agent",
"row": 1,
"connections": [
{
"to": "memory",
"arrow": "both"
}
]
},
{
"id": "coder",
"label": "Coding Agent",
"row": 1,
"connections": [
{
"to": "sandbox",
"arrow": "to"
}
]
},
{
"id": "reviewer",
"label": "Review Agent",
"row": 1,
"connections": [
{
"to": "orchestrator",
"arrow": "to",
"label": "verdict"
}
]
},
{
"id": "memory",
"label": "Shared Memory",
"row": 2
},
{
"id": "sandbox",
"label": "Tool Sandbox",
"row": 2
}
],
"clusters": [
{
"id": "workers",
"label": "subagents",
"members": [
"researcher",
"coder",
"reviewer"
]
}
]
}Your agent draws it, you review it
- Model the orchestration — agents, hand-offs, tools, memory — as JSON in the repo.
- Splice the map into your README or AGENTS.md with mdd render.
- When you add an agent or rewire a hand-off, your agent edits the JSON and re-renders.
- mdd check in CI fails when the map goes stale relative to the model.
A prompt to hand your agent
Maintain the orchestration map in AGENTS.md with mdd. When agents, tools, or hand-offs change, edit docs/agents.diagram.json, then run: npx mdd render --json docs/agents.diagram.json --file AGENTS.md --id agents.
Why mdd here
A multi-agent system is the most agent-native thing there is to document — the maintainer of the diagram can be the system it describes. mdd gives it a structured model with a validation loop instead of a hand-drawn sketch, cluster boxes group the subagent pool, and the output reads identically in every terminal and diff.
More use cases
- AGENTS.md architecture maps — An architecture map in your agent context file: ASCII for humans, JSON ground truth for the agent.
- Diagrams in code comments — Header-comment state machines and layouts, computed from JSON and spliced behind // or #.
- Runbook flowcharts — Decision flows and failure maps readable in any terminal, drafted and updated by your incident tooling.
- Design docs, RFCs & ADRs — RFC and ADR system diagrams that stay legible in diffs across every revision round.
- ASCII sequence diagrams — Auth flows and call chains as plain text: message order in the JSON is the layout.
- Data pipeline lineage maps — A curated lineage map your agent keeps current as pipeline models change.
- Docs-as-code threat models — Data-flow diagrams with trust boundaries, drafted from the code and reviewed in the diff.
- Tutorials & conceptual docs — Conceptual diagrams that survive every downstream medium: docs site, README, PDF, chat.
- mdd API for agents & CI