Build a coordinator that sends each task to the right specialist agent. A router classifies the task, then the matching specialist (each just a model call with its own system prompt) handles it.
A single general-purpose prompt does many things adequately and nothing excellently. The multi-agent pattern splits work across specialists, each with a focused role, and uses a coordinator to route. The router is the key piece: it reads the task and picks the specialist, the same way a team lead assigns work to the right person.
code expert and a writing expert.code or writing.The coding task goes to the code specialist; the rewrite goes to the writing specialist.
The coordinator splits one decision (route) from the work (handle), so each specialist can have a tightly focused prompt instead of one prompt trying to cover everything. Routing with a cheap classification call keeps the system simple and cheap, and the design scales by adding entries to the specialists map. This same shape underlies larger multi-agent systems, where specialists may themselves use tools or hand work to one another.
Routing sends a whole task to one specialist; a manager pattern goes further by breaking a task into subtasks, handling each, and combining the results. Build a planner that splits a task in two, a worker that completes each subtask, and a synthesis step that merges them into one result.
plan(task) that asks the model for two subtasks.do_subtask(subtask) that completes a single subtask.The task splits into writing the announcement and the example, each is done separately, and the synthesis merges them.
Decomposition lets each subtask get the model's full attention with a focused prompt, instead of one prompt juggling everything. The synthesis step is where the parts become a coherent whole, and giving the synthesizer the original task plus all the parts keeps the result on target. This plan-delegate-synthesize loop is the backbone of manager-style multi-agent systems, where the subtasks might themselves go to different specialists or use tools.