What problem does the call_agent tool solve in multi-agent systems?
It lets one agent invoke another specialized agent and receive its result.
Why expose “call another agent” as a tool?
Tools are clean interfaces, making delegation modular, consistent, and easier to test.
What is the core input to call_agent besides ActionContext?
agent_name and task.
What does agent_name represent in call_agent?
Which registered agent to invoke.
What does task represent in call_agent?
The work request you want the invoked agent to complete.
What is the “agent registry” in this design?
A directory mapping agent names to their run functions.
Where does call_agent retrieve the agent registry from?
The ActionContext.
What happens if no agent registry exists in the ActionContext?
The tool raises an error (no registry found).
What happens if the requested agent_name is not found?
The tool raises an error (agent not found).
Why does call_agent create a fresh Memory for the invoked agent?
To isolate memory so each invocation starts clean and doesn’t mix histories.
What does “memory isolation” prevent?
Confusion and cross-contamination between different agents’ conversation histories.
What is the main thing call_agent returns on success?
A structured dict with success=True, the agent name, and the agent’s result.
In this design, where does the returned “result” come from?
The invoked agent’s final memory item (the last memory entry).
Why return the last memory item as the result?
It acts as the agent’s final conclusion/output in a consistent place.
What should an invoked agent put in its final memory item?
The clear, final answer/output intended for downstream use.
What is a benefit of returning a structured dict instead of raw text?
The coordinator can reliably parse and use the result.
What is ActionContext used for in call_agent?
Passing shared runtime resources (like auth or config) to the invoked agent safely.
What is “context management” in call_agent?
Carefully choosing which context fields get passed to the invoked agent.
Why not pass the entire ActionContext to the invoked agent?
It can leak unnecessary capabilities and increase risk or complexity.
Why does the example pass auth_token and user_config through?
The invoked agent may need them to access tools or follow user preferences.
Why does the example avoid passing agent_registry to the invoked agent?
To reduce the risk of infinite recursion and uncontrolled agent-calling loops.
What is “infinite recursion” in a multi-agent system?
Agents repeatedly calling each other in a loop without stopping.
What’s one simple guardrail against recursion shown here?
Do not pass the registry into invoked agents by default.
What is another guardrail you could add to prevent recursion?
A max delegation depth or a call budget (limit how many call_agent calls).