Parallel Analysis and Synthesis
Turn the user's request into a temporary fan-out/fan-in workflow. Keep the number and focus of branches appropriate to the request; do not create roles just to make the workflow look larger.
Process
- Extract the decision or question, the relevant constraints, and the output format from the user's request.
- Choose two to four independent analysis angles that cover different evidence or reasoning needs. Give every branch the same core question and only the context it needs. Do not let one branch depend on another branch's unfinished answer.
- Run those branches in parallel. Each branch should return concise findings, assumptions, and unresolved uncertainty rather than a polished final answer.
- Pass the ordered branch results, the original request, and the explicit decision criteria to a separate synthesis role. The synthesizer must distinguish agreement, disagreement, and missing evidence; it must not silently turn an unsupported claim into a fact.
- If the request requires a decision, have the synthesizer return a small
structured object with
recommendation,reasons, anduncertainties. Keep branch content as text unless a later control-flow decision genuinely needs typed fields. - Return the synthesis and the key evidence trail. If a branch fails, keep that missing evidence explicit and follow the application's bounded failure policy; do not silently treat it as support or retry indefinitely.
Compilation Rules
- Express independent branches with
parallel([...]); preserve the input order when passing results to the synthesizer. - Use separate workflow-local Agent instances for each branch and for the synthesizer. Do not ask the synthesizer to redo every branch from memory.
- Pass the original question, constraints, and branch outputs explicitly as inputs. A later stage must not depend on context that was only present in a previous Agent's prompt.
parallelreturnsNonefor a failed independent branch. Handle that value explicitly, and let the workflow or its caller decide whether a single, bounded rerun is appropriate; do not rely on exception-catching syntax or unbounded retries.- Keep the glue code small: create roles, pass JSON-compatible values, fan out, fan in, and return the result. Delegate substantive analysis to Agents.
- Use
tools=[]for roles that only reason over supplied inputs. Select a declared tool only for a branch whose task genuinely needs it, and keep mutating tools out of parallel branches unless their independence is clear. - If a structured synthesis is requested, read the Agent result's explicit
structuredobject. Do not ask for JSON-looking text and parse it in the workflow.