Skip to main content
Back to how-to guides Use this guide when one customer-facing experience could be implemented either as one broad agent or as a supervisor with multiple specialist agents.

Concept

A single agent owns the conversation and the outcome. It can gather information, call tools, answer, and complete the request without transferring ownership. A specialist design separates the front door from the business owners. A supervisor receives the user request, chooses the right owner, and uses HANDOFF when another agent should take over. A specialist owns one capability, such as account access, order status, billing, claims, device care, or employee benefits. The design question is ownership. If one team, policy set, permission model, and success criteria can own the outcome, keep one agent. If different teams, tools, policies, or escalation paths own different parts of the experience, use specialists.

Decision guide

Do not split agents just because a domain is large. Splitting adds routing, context-passing, target-agent readiness, testing, monitoring, and fallback design.

Minimal working example: one agent owns the outcome

This example is one agent file. It is enough when order-status work has one owner and one required field.
Use this shape when the same agent can safely handle the full request. If refund, billing, or human escalation becomes part of the same entry point, add explicit boundaries or split ownership.

Working example: supervisor with specialist agents

This example is a project-level set. The supervisor and all referenced specialists must exist in the same project. The specialists are short stand-ins. Replace their COMPLETE rules with your real business logic. agents/support-supervisor.agent.abl
agents/account-support-agent.agent.abl
agents/order-status-agent.agent.abl
agents/live-agent.agent.abl
HANDOFF is the executable routing surface. The platform ignores AGENTS:. It does not route and does not check the names, so keep it only as a readable roster. Each HANDOFF entry becomes a routing action the supervisor model can choose. The WHEN rule is checked before the transfer. Each PASS field becomes a typed input on that routing action. The model fills it from what the customer already said. Each specialist also gathers customer_id, so a missing value is requested again. Live_Agent is a machine agent. It reaches a person through ESCALATE. Escalation reaches a person only when the project has a human-agent connection and the ESCALATE block has a routing block with connection, queue, or skills. See the ESCALATE reference. If a HANDOFF entry omits HISTORY, the specialist receives the full conversation history. A project-level coordination default can change this value. Set HISTORY on the entry when one route needs summary_only, none, auto, or the last few messages.

When to use handoff

Use HANDOFF when the target agent should own the next part of the conversation, including when it must ask the customer questions. Use RETURN: true when the specialist should do bounded work and return control to the supervisor. The specialist returns when its COMPLETE rule matches, or when it uses the built-in return action for a request outside its scope. Use RETURN: false when the target agent or human channel should keep ownership.

When to use delegate

Use DELEGATE when the parent agent keeps the conversation but asks another agent for a one-shot result. A delegate runs to completion and cannot wait for customer replies. Two rules follow from this:
  • Map every required field of the child agent in PASS. Otherwise the compiler reports DELEGATE_CHILD_GATHER_INPUT_UNMAPPED. If the child must ask the customer, use a RETURN: true handoff instead.
  • A supervisor with ROLE: router cannot use DELEGATE. The compiler reports AGENT_RETURNED_WORK_REQUIRES_ORCHESTRATOR.
This example is a two-agent project set. The child produces total_fee, and the parent maps that result into quoted_fee. The parent completes only after the fee returns. The fixed $25 fee is a stand-in. Replace it with a call to your fee tool. agents/booking-manager.agent.abl
agents/fee-calculator.agent.abl
Delegate settings to know:
  • RETURNS maps a child value to a parent variable. If the child returns none of the declared values, the delegate fails and ON_FAILURE runs.
  • USE_RESULT names a parent variable that stores the whole delegate result. Write a variable name, not an instruction. The platform ignores text with spaces.
  • Write TIMEOUT without quotes, for example 10s, 500ms, or 2m. A quoted value is ignored and the default of 30 seconds applies.
  • ON_FAILURE accepts continue, escalate, or RESPOND "text". The default is continue.

Verification

  1. Validate all files in the project together, not only the supervisor.
  2. Send an account access utterance and confirm the trace shows handoff_to_Account_Support_Agent and that ownership moves to Account_Support_Agent.
  3. Send an order-status utterance and confirm ownership moves to Order_Status_Agent.
  4. Send “I need a person” and confirm the route reaches Live_Agent and that the model escalates.
  5. Check the handoff trace event. Confirm customer_id appears in its context when the customer stated it. Check seededFields in handoff_context_seed to see which PASS fields reached the specialist.
  6. For the delegate example, send “What would it cost to change this booking?” and confirm the trace shows delegate_start and delegate_complete, the parent stays active, and the reply includes the fee.
  7. Force a delegate failure in a test project, for example with TIMEOUT: 1ms. Confirm the customer sees the ON_FAILURE text.

Production readiness checklist

  • Every HANDOFF TO and DELEGATE TO target exists in the project or is configured as an external or remote agent.
  • Every PASS field is gathered, read from memory, produced by a tool, or supplied by the channel before it is needed.
  • Every delegate child maps all its required fields in PASS.
  • Each route has a distinct business owner and success criteria.
  • A human route exists for unclear, unsupported, or high-risk requests, and a human-agent transfer is configured for your channels.
  • Test utterances cover every route, delegate failure, delegate timeout, and human escalation.
  • Trace review confirms selected route, target agent, return behavior, history strategy, and context passed.

Common mistakes

Troubleshooting