Concept
An intent is a category the supervisor can route on. You declare it in theINTENTS: section. The supervisor’s handoff rules then test intent.category.
Two things decide how well classification works:
Know these limits before you write intents:
INTENTS:takes a category name and an optional description. It has no examples, keywords, patterns, or priority properties.- The language model sees the category name and the description. It never sees patterns.
- Keyword patterns come only from
NLU:categories:. NLU:intents:(withEXAMPLES,EXAMPLES_FILE, and intent-levelPATTERNS) is accepted by the compiler, but the runtime does not use it.
Minimal working example
A front desk supervisor classifies two intents with descriptions and keyword patterns. It routes each intent to a specialist. The specialists are short stand-ins in the same project. Replace them with your real agents.agents/support-front-desk.agent.abl
agents/billing-specialist.agent.abl
agents/order-specialist.agent.abl
intent.categoryis set by the classifier, or by the keyword fallback.human_helphas no description and no route. Add a route if the supervisor must act on it.
How it works
Syntax ofINTENTS::
If every entry is invalid, the section silently becomes “inferred” mode. In that mode the compiler builds the category list from the values in your
WHEN conditions, adds greeting, farewell, and escalation, and stops checking category spelling.
Syntax of the NLU: categories: list:
- Write
- NAME: categoryandPATTERNS: [...]with uppercase keys. Lowercase keys are ignored. - Write the pattern list on one line. A multi-line pattern list is silently empty.
- The
NAMEmust match a category inINTENTS:, or it adds a new category. - A trailing comment on
PATTERNScorrupts the list. A comma inside a quoted pattern splits it. - If an
INTENTS:entry has no description, the compiler writes one from the patterns, as “Examples: invoice, refund”.
- The classifier reads the message and the categories, with their descriptions, and returns a category and a confidence.
- A category that is not in the list is dropped.
- The supervisor evaluates its
HANDOFFrules in order. The first trueWHENwins.intent.categoryandintent.confidenceare available in the condition. - With a pipeline short-circuit, a single high-confidence category routes directly. See Configure EXECUTION.pipeline models, modes, thresholds, and fallbacks.
- It runs when the classifier is off or unavailable, subject to
LEXICAL_FALLBACK. - It matches whole words and phrases, without regard to case. It does not stem words or match plurals. “cancel order” does not match “cancel orders”.
- When several patterns match, an exact match wins, then more words, then longer text, then the category declared first.
- Its confidence is a fixed 0.5. That is below the default short-circuit threshold of 0.85, so a keyword match sets
intent.categoryfor the routes but does not short-circuit. - With
LEXICAL_FALLBACK: never, no keyword rescue runs.
HANDOFF rules, and by the keyword ordering above.
Common variations
Write examples in the description
Put contrasting examples in the description. Name what the intent includes and what it does not.INTENTS: section in the minimal example.
Use only a description, no keywords
Leave out theNLU: section when the classifier is always on. Keywords matter only for the fallback.
Gate a route on confidence
Add a condition to a route, such asintent.category == "billing_question" AND intent.confidence >= 0.8. A low-confidence match then falls to the next route.
Declare categories from routes
An agent with noINTENTS: and no NLU: section infers categories from its WHEN values. Prefer an explicit INTENTS: section, because the compiler then warns about a mistyped category with UNDECLARED_INTENT_CATEGORY.
Verification
- Run the validator on all three files. Expect no errors and no warnings.
- Say “I was charged twice for invoice 22”. Expect a handoff to
Billing_Specialist. - Say “where is my order”. Expect a handoff to
Order_Specialist. - In the trace, open the
pipeline_classifyevent for the category and confidence. Openpipeline_routing_resolvefor the rule that matched. - With the classifier off, say “refund please”. Expect the
pipeline_intent_bridgeevent with the sourcenative_lexicaland the matched pattern. - Say “refunds please” in the same setup. Expect no keyword match, because plurals do not match.
Production readiness checklist
- Every description is quoted, one line, and states what the intent excludes.
- No category name contains a hyphen.
- No line has a trailing comment.
NLU:categories:uses uppercase keys and one-line pattern lists.- Every category used in a
WHENis declared. The compiler warnsUNDECLARED_INTENT_CATEGORYotherwise. LEXICAL_FALLBACKis set on purpose.- Tests cover a clear request, an overlapping request, an off-topic request, and a plural keyword.
Common mistakes
Troubleshooting
Related articles: