iamengrakz/multiagent-orchestration-ref
Production reference implementation for multi-agent orchestration — companion repo for book proposal
Platform-specific configuration:
{
"mcpServers": {
"multiagent-orchestration-ref": {
"command": "npx",
"args": [
"-y",
"multiagent-orchestration-ref"
]
}
}
}Add the config above to .claude/settings.json under the mcpServers key.
Companion to Chapter 6 (Loop Detection) and Chapter 8 (Idempotency) of *Multi-Agent Orchestration in Action* — Aimal Khan (Manning In Action series).
| Pattern | Chapter | CLI flag | |---|---|---| | Normal orchestration: planner → search → summarise → answer | Ch. 5 | *(default)* | | Loop detection: same fingerprint caught before re-invocation | Ch. 6 | --demo loop | | Idempotency: duplicate side-effect suppressed via SET-NX | Ch. 8 | --demo idem |
# From repo root — all three patterns in one run:
python examples/research_agent/run.py
# Custom research topic:
python examples/research_agent/run.py --query "transformer attention mechanisms 2025"
# Structured JSON logs (book §9 observability pattern):
python examples/research_agent/run.py --verbose
# Isolate a single pattern:
python examples/research_agent/run.py --demo loop # 🔁 LOOP PREVENTED
python examples/research_agent/run.py --demo idem # ♻️ IDEMPOTENT RETRY HANDLED
# Combine:
python examples/research_agent/run.py --demo loop --verbose🔁 LOOP PREVENTED — orchestrator terminated before infinite tool call ✓
♻️ IDEMPOTENT RETRY HANDLED — duplicate email prevented ✓Both lines will appear in the default run. In --verbose mode they are also tagged as "BOOK_PATTERN" in the structured JSON log stream for easy grepping.
Replace the execute() body of WebSearchTool or SummariseTool in run.py with your actual API clients. The orchestrator, loop detection, and idempotency middleware require no changes — that is the point of the contract layer.
Loading reviews...