Concept
Keep clear deterministic or intent routes first, and put a quoted semantic fallback condition last for vague, unsupported, or conflicting requests. When the fallback should re-enter normal routing after clarifying, useEXPECT_RETURN: true with ON_RETURN: { action: resume_intent, MAP: {...} } — the fallback child gathers whatever’s missing, and MAP copies its result back into a parent-owned variable your supervisor can route on next turn.
One thing affects how this looks once you look past the syntax: HANDOFF history defaults to full when omitted. Every route below omits HISTORY, so each child (including the fallback) now receives the entire conversation by default.
Minimal working example
customer_id, account_id, issue_summary, and conversation_summary are shown as passed context with no declared source in this example — treat them as project-local assumptions (typically populated from authentication or an earlier turn) and declare them via MEMORY in your actual project.
How it works
- The fallback route’s
WHENis a quoted natural-language condition, evaluated only when neither deterministic route above it matched. EXPECT_RETURN: truemakesFallback_Triage_Agenta temporary child: it gathersclarified_intentfrom the user, then itsCOMPLETEfires once that fieldIS SET.ON_RETURN.action: resume_intenttells the supervisor to resume routing after the child returns.MAP: { clarified_intent: clarified_intent }copies the child’s gathered value (left side, child key) into the parent supervisor’s ownclarified_intentsession variable (right side, parent key) — declared here in the supervisor’s ownMEMORY.SESSION.- If you don’t need to map any fields back — the fallback child only needs to signal “done, try routing again” — you can use the simpler shorthand
ON_RETURN: "resume_intent"instead of the structuredaction/MAPblock. - Since
HISTORYis omitted from everyHANDOFF, each child (including the fallback) receives the full conversation history by default.
Common variations
- Clarify and return to the supervisor (shown above).
- Complete unsupported requests directly in the fallback agent with a safe explanation, without ever returning to the supervisor (
EXPECT_RETURN: false, or omitON_RETURNand let the fallback’s ownCOMPLETEend the conversation). - Escalate to a human after repeated clarification failures instead of looping the fallback indefinitely.
- Use the plain string shorthand
ON_RETURN: "resume_intent"when the fallback child doesn’t need to map any fields back.
Verification
- Parse and compile the ABL and confirm there are no parser or compiler errors/warnings.
- Test at least one matching utterance for each specialist route and one clearly ambiguous utterance that should hit the fallback.
- Confirm the fallback’s
COMPLETEfires onceclarified_intent IS SET, and that the parent’sclarified_intentreflects the child’s gathered value after return. - Inspect the trace for the selected target, the evaluated condition (matches your literal authored text for the deterministic routes), and the
ON_RETURN/MAPapplication on return.
Production readiness checklist
- Every specialist route has a clear owner and a concise context summary.
- The fallback’s
MAPtargets a variable the parent actually declares and routes on next turn. - Semantic conditions are quoted as natural-language
WHENtext. - Fallback behavior is explicit and does not hide missing intent coverage — use trace review to find requests that keep landing in fallback and add real routes for them.
- Any variable assumed to already exist (like
customer_idabove) has a real declared source in your project.