← Table of Contents · Page 462 of 868

COORDINATION MECHANICS

Part 3 of 11

SUBAGENTS CALLED AS TOOLS BY A MAIN AGENT A different style of coordination keeps the main agent in charge the whole time. In this style, the main agent treats another agent as just another tool. You learned in Part Four that a tool is a function the agent can call, such as a calculator or a web search, which returns a result. A subagent used as a tool works the same way from the main agent's point of view. The main agent calls it with an input, waits, and receives an output. What happens inside the subagent, including its own reasoning and its own tool calls, is hidden from the main agent, much like you do not need to know how a calculator performs its arithmetic internally. The difference from a handoff is control. With a handoff, the receiving agent takes over the conversation. With a subagent-as-tool, the main agent keeps control, gets a result back, and continues its own work. Think of a manager who asks a colleague, "Could you summarize this report for me?" The colleague returns a summary, and the manager carries on. The manager never stopped being in charge. This style has important benefits. It keeps the main agent's context clean, because only the final result comes back, not the subagent's long internal reasoning, which is the context isolation idea from Chapter 42. It also makes the subagent reusable, because anyone can call it with the right input. The main agent should give the subagent a clearly defined task and a clearly defined output format, just as a well-designed tool has a clear description, as you saw in Chapter 15.
Advertisement
Read Aloud:
0:00 / 0:00