Provides raw financial documents
AI Models & Assistants / Knowledge library
Agent Delegation Loop
Keeps a manager in control while it invokes specialist agents as bounded tools
Why learn Agent Delegation Loop?
It uses focused expertise while preserving centralized synthesis, policy, and final-answer ownership.
The problem it solves
It lets one agent obtain specialist work without transferring the entire run to that specialist.
Where it came from
In delegation, the manager retains the user-facing task and combines specialist results. Specialists return outputs rather than taking ownership of the conversation, which differs from a handoff.
Build your understanding
Work through these exercises in order. Try the task before opening a reference.
- Define Agent Delegation Loop and identify its place in an agent architecture.
- Choose a task where Agent Delegation Loop improves an agent system.
- Diagnose one failure caused by misusing Agent Delegation Loop.
- Interpret a trace or state transition involving Agent Delegation Loop.
- Explain one operational tradeoff of Agent Delegation Loop.
Documentation and sources
- OpenAI Agents SDK: Agent orchestration (openai.github.io)
Connect the ideas
Explore next
Real World Example
Automated Compliance Audit Orchestration
Financial institutions requiring strict adherence to regulatory reporting standards.
The business problem
Generalist agents often hallucinate complex compliance logic or fail to maintain the required audit trail when handling multi-step document verification.
How this topic solves it
Implement a manager agent that maintains control of the user session, utilizing specialized compliance agents as bounded tools via Agent.as_tool() to perform isolated verification tasks without losing the overall audit context.
- Define a Manager Agent with high-level oversight instructions and session state management.
- Create specialized agents for specific tasks like 'Tax Code Validator' and 'Identity Verifier'.
- Expose these specialized agents to the Manager Agent using the Agent.as_tool() method.
- Configure the Manager Agent to invoke these tools sequentially or conditionally based on document type.
- Aggregate tool outputs into a final, human-readable compliance report within the Manager Agent.
The Manager Agent orchestrates the flow by calling specialists as tools.
Maintains session and audit state
Bounded tool for tax logic
Bounded tool for identity logic
- User → Submits request → Manager Agent
- Manager Agent → Invokes as tool → Tax Specialist
- Manager Agent → Invokes as tool → ID Specialist
- Tax Specialist → Returns verification → Manager Agent
- ID Specialist → Returns verification → Manager Agent
Implementation example
This maps to the scenario by allowing the Manager Agent to treat the TaxValidator as a bounded tool, ensuring the manager retains control of the final output.
# Define the specialist agent
tax_agent = Agent(name="TaxValidator")
# Expose as a tool to the manager
manager.add_tool(tax_agent.as_tool())
# Manager retains control of the conversation flow
response = manager.run(user_input)Expected business outcome
Improved accuracy in regulatory reporting and a centralized, traceable audit log managed by a single point of authority.
Limitations and checks
The manager agent may become a bottleneck if it attempts to process too many concurrent tool calls; monitor latency by checking the time elapsed between tool invocation and result aggregation.