Skip to main content
Back to how-to guides Use this guide when one conversational entry point must identify what the user needs, choose the right specialist, and pass enough context for that specialist to continue.

Concept

A supervisor is the front door for a multi-agent experience. Its job is to understand the request, choose the right owner, and transfer context. It does not solve every problem. A specialist agent owns one business capability. A good specialist has a narrow goal, the right tools or data access, clear limitations, and a completion path. Routing connects the user request to the correct owner. In ABL, the executable route is HANDOFF. The platform ignores the optional AGENTS: roster. Keep it only for readability. A project has one supervisor. A second SUPERVISOR in the same project fails to compile with error E728.

How routing works

Each HANDOFF entry becomes a routing action named handoff_to_<Target>. The supervisor model chooses among these actions on every turn.
  • The SUMMARY and the WHEN text appear in the action description. A WHEN written as plain language is guidance for the model.
  • A WHEN written as an expression is enforced. The platform checks it before it transfers the conversation and refuses the route when the condition is not met.
  • Each PASS field becomes a typed input on the action. The model fills it from what the customer already said.
  • When a WHEN reads intent.category, the action also requires the model to state the category. INTENTS: lists the categories and their descriptions.
  • ENABLED_WHEN removes a route from the model’s choices while the condition is false.

Decision guide: routing condition styles

Quote plain-language conditions. Unquoted text is read as variable names and produces undefined-variable warnings. A quoted phrase is treated as an expression when it contains uppercase AND, OR, or NOT, a comparison symbol such as > or ==, or the words contains, matches, startsWith, or endsWith. The platform then evaluates the phrase instead of using it as guidance. Write plain-language conditions in lowercase words and avoid those symbols. A // outside quotes starts a line comment in WHEN and ENABLED_WHEN. A condition that holds only a comment fails to compile. A // inside quotes stays part of the text.

Minimal working example: support supervisor project

This example is a project-level set. Put the supervisor and target agents in the same project. The specialists are short stand-ins for your real agents. agents/support-supervisor.agent.abl
agents/account-support-agent.agent.abl
agents/order-status-agent.agent.abl
agents/live-agent.agent.abl
HANDOFF targets are machine agents. Live_Agent 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. When a routing list has no matching entry, no transfer starts. See the ESCALATE reference. The supervisor lists customer_id as a PASS field. The model fills it from what the customer said. Each specialist also gathers customer_id, so a missing value is requested again. Do not depend on a supervisor GATHER to stop routing. RETURN: true on account support means bounded specialist work can return to the supervisor. RETURN: false on order status and live agent means the target keeps ownership. 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 to use summary_only, none, auto, or the last few messages for that route. INTENTS: is optional. Without it, the compiler takes the categories from the intent.category comparisons in your WHEN rules. When INTENTS: exists, the compiler warns with UNDECLARED_INTENT_CATEGORY if a WHEN uses a category that INTENTS: does not declare. This catches typos such as "acount".

Common variations

Plain-language routing variation

Use quoted semantic conditions when business users can describe a route more clearly in natural language than as a strict expression. Treat this as an alternative supervisor project. Do not add it to a project that already has a supervisor, because two supervisors fail with E728. agents/billing-supervisor.agent.abl
agents/pending-payments.agent.abl
agents/refund-guidance.agent.abl
Keep semantic routes distinct. If two routes could match the same request, customers may experience inconsistent routing.

Supervisor role variation

A supervisor without a BEHAVIOR: block can answer the customer directly and can use DELEGATE. Set a role to make the intent explicit. Add this block to the support supervisor above.
A supervisor accepts only these two roles. The value assistant fails to compile.

Route availability variation

Use ENABLED_WHEN when a route must exist only under a known condition, such as a channel. While the condition is false, the model does not see the route, and a call to it is refused. Add this to the account entry in the support supervisor.
Write ENABLED_WHEN as an expression over data the platform knows. A plain-language ENABLED_WHEN fails to compile with ENABLED_WHEN_SEMANTIC_REFERENCE. A condition that reads a missing value counts as false. If every route has ENABLED_WHEN, the compiler warns with ENABLED_WHEN_ALL_DISABLED_RISK because all routes can switch off. Read the channel through session.channel. channel.name is for behavior profiles. It has no value in ENABLED_WHEN, so a condition on it disables the route. The value must match exactly. Voice variants have their own names, such as voice_twilio, so use session.channel IN ["voice", "voice_twilio"] to match more than one. Use the channel name your project reports in traces.

Multiple requests variation

Multi-intent handling is on by default. With the default primary_queue strategy, the supervisor serves the main request first and queues the others. To ask the customer which request to handle first, set the strategy. Add this block to the support supervisor.

Designing the context package

Every handoff should answer three questions. Do not pass every field by default. Pass the context the target needs to continue safely.

Fallback and ambiguity design

Do not rely on the roster as a fallback. If the model selects no route, the supervisor stays active. A supervisor with no role can answer directly. A router supervisor can ask the customer one question to find the right route. For production supervisors:
  • Add a route for human help, unsupported requests, or unclear requests.
  • Use one WHEN: true route as the always-available default when one specialist can take every leftover request.
  • Make route descriptions mutually exclusive.
  • Add test utterances that intentionally look ambiguous.
  • Inspect traces to confirm the selected handoff target.
  • Decide how multiple requests in one message should behave, and set MULTI_INTENT if the default does not fit.

Verification

  1. Validate the supervisor and all target agents together.
  2. Send: “I forgot my password.” Expect Account_Support_Agent.
  3. Send: “Where is my order?” Expect Order_Status_Agent.
  4. Send: “I need to talk to someone.” Expect Live_Agent and an escalation.
  5. Check the handoff trace event. Confirm customer_id appears in its context when the customer stated it. In handoff_context_seed, check seededFields, and check that remainingWaitingFields lists customer_id when the customer did not state it.
  6. Inspect every handoff_condition_check entry for the turn. Confirm the matched route and the skipped routes.
  7. Inspect trace output for return behavior and the history strategy.

Production readiness checklist

  • Every TO target exists and has a clear owner.
  • Every PASS field is populated before handoff or requested again by the target.
  • Every route has a distinct condition and summary.
  • A human or fallback route exists, and a human-agent transfer is configured for your channels.
  • The project has exactly one SUPERVISOR.
  • Every category in a WHEN is declared in INTENTS:, and the compile shows no UNDECLARED_INTENT_CATEGORY warning.
  • Route tests cover success, no-match, ambiguous, and escalation paths.
  • Trace output is reviewed for each route before go-live.
  • Support owners agree on what RETURN: true and RETURN: false mean for their customer journey.

Common mistakes

Troubleshooting