An orchestrator agent in a legal research pipeline delegates document summarization to a subagent. The subagent must return a structured summary and a list of cited cases. The orchestrator then uses the cited cases list to queue additional lookups. The subagent currently returns its response as free-form text. What communication pattern change makes the orchestrator's dependency on subagent output most robust?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal — b is correct because requiring the subagent to invoke a structured_output tool with a defined JSON schema as its final action produces machine-parseable output with strong type guarantees. The orchestrator reads tool_use.arguments rather than applying regex or string parsing to free-form text.
Full explanation below image
Full Explanation
B is correct because requiring the subagent to invoke a structured_output tool with a defined JSON schema as its final action produces machine-parseable output with strong type guarantees. The orchestrator reads tool_use.arguments rather than applying regex or string parsing to free-form text. This is robust to variations in phrasing, ordering, or formatting that would break delimiter-based parsing. The JSON schema can specify required fields (summary_text, cited_cases array) and field types, enabling validation. A is wrong because delimiter-based parsing is brittle — the model may include the delimiter string in the content (e.g., quoting a case name that contains dashes), change whitespace, or fail to generate the delimiter in edge cases. C is wrong because requiring a follow-up message doubles the API call count, adds latency, and still relies on free-form parsing of the follow-up response. D is wrong because using a shared key-value store adds infrastructure dependency and asynchronous complexity for what is essentially a synchronous communication pattern; it does not change the parsing robustness problem.