Multi-agent coordination prompt builder
Multi-agent systems fail in predictable ways: agents talk past each other in incompatible formats, the orchestrator loops forever without a stopping condition, and one worker’s ambiguous error reply causes the whole pipeline to stall. The root cause is almost always missing structure — no shared protocol, no role clarity, no defined termination. This builder writes a matched pair of system prompts (one orchestrator, one worker) that speak the same protocol from the start, so agents coordinate instead of collide.
How it works
You describe the overall task, list the worker roles (for example, “researcher,” “coder,” “verifier”), pick a handoff format (JSON or tagged blocks), define a termination condition, and specify an error-handling policy. The tool then generates two prompts:
The orchestrator prompt instructs the model to decompose the task into named subtasks, delegate each subtask to the appropriate worker role using the handoff format, collect structured replies, and aggregate results. Critically, it enforces the termination condition — the model is told exactly when to stop rather than deciding for itself.
The worker prompt instructs each model instance to accept one delegated subtask, focus only on that subtask, reply in the shared format, and return a structured error reply when it cannot complete rather than producing an unreliable free-form response.
Designing a good protocol
Handoff format matters most. If the orchestrator sends {"task": "...", "role": "coder"} but the worker expects a plain prose instruction, the worker will misparse or ignore the structure. JSON is the safer choice when your orchestration layer parses the reply; tagged blocks (<result>...</result>) work better in frameworks that stream plain text.
Termination conditions must be testable. “Stop when done” is not a condition — the model will fill “done” with whatever interpretation suits it. “Stop after 5 total iterations or when the verifier returns {"status":"PASS"}” is unambiguous.
Workers should fail visibly. A worker that says “I could not complete this” in free prose forces the orchestrator to parse natural language for failure signals. A worker that returns {"status": "error", "reason": "source not found"} lets the orchestrator handle the failure programmatically — retry, reroute, or escalate.
Common patterns
- Research → write → verify: three workers with clear roles; orchestrator runs until verifier returns PASS or iteration cap is reached.
- Parallel sub-tasks: orchestrator delegates to multiple workers simultaneously (if your framework supports parallel calls), then aggregates results in a final pass.
- Self-correcting loops: orchestrator delegates, worker replies, verifier checks, orchestrator instructs worker to revise if FAIL — with a max-revision cap to prevent infinite cycling.
Everything in the builder runs locally in your browser and outputs only text prompts. You wire them into your own framework — LangGraph, CrewAI, Autogen, or custom code — and supply the model and runtime.