A multi-agent document processing system has a planner, an extraction agent, a validation agent, and a formatting agent. In production, the planner sometimes issues malformed tool calls to the extraction agent (missing required parameters). These errors cascade: the extraction agent fails, the validation agent receives empty input, and the formatting agent produces a malformed report. Where is the most leverage to prevent this cascade?
Select an answer to reveal the explanation.
Short Explanation
Here's the deal — you want to stop the cascade at the extraction agent's tool-call intake layer by validating required parameters before execution. That gives the planner a structured error so it can retry with a corrected call.
Full Explanation
Parameter validation at the extraction agent's tool-call intake layer provides the best leverage for two reasons: it prevents the cascade by catching errors at their entry point before they propagate downstream, and it creates a structured feedback loop where the planner receives a precise error description and can self-correct with a retry, rather than requiring human intervention. This is the 'fail fast and inform' pattern for multi-agent systems. Adding error handling to the formatting agent is wrong because it only detects failures after they have fully cascaded through the pipeline; it cannot prevent the cascade or enable self-correction. Adding more examples to the planner's prompt is wrong because prompt improvement reduces the frequency of malformed calls but does not eliminate them; LLM outputs are probabilistic and prompt-level prevention alone is insufficient for production reliability. Implementing a global try-catch at the pipeline level that restarts the entire pipeline on any agent failure is wrong because full pipeline restarts are expensive, destroy any intermediate valid results, and do not address the root cause; a restarted pipeline will fail again if the planner generates the same malformed call.