Skip to main content
Back to how-to guides Use this pattern when a supervisor must classify what the customer wants, and you need to write the definitions that drive that classification.

Concept

An intent is a category the supervisor can route on. You declare it in the INTENTS: 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: (with EXAMPLES, EXAMPLES_FILE, and intent-level PATTERNS) is accepted by the compiler, but the runtime does not use it.
Write your examples inside the description, as phrases the model can learn from.

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
Variable sources:
  • intent.category is set by the classifier, or by the keyword fallback.
  • human_help has no description and no route. Add a route if the supervisor must act on it.

How it works

Syntax of INTENTS:: 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: category and PATTERNS: [...] with uppercase keys. Lowercase keys are ignored.
  • Write the pattern list on one line. A multi-line pattern list is silently empty.
  • The NAME must match a category in INTENTS:, or it adds a new category.
  • A trailing comment on PATTERNS corrupts 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”.
How classification runs:
  1. The classifier reads the message and the categories, with their descriptions, and returns a category and a confidence.
  2. A category that is not in the list is dropped.
  3. The supervisor evaluates its HANDOFF rules in order. The first true WHEN wins. intent.category and intent.confidence are available in the condition.
  4. With a pipeline short-circuit, a single high-confidence category routes directly. See Configure EXECUTION.pipeline models, modes, thresholds, and fallbacks.
The keyword fallback:
  • 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.category for the routes but does not short-circuit.
  • With LEXICAL_FALLBACK: never, no keyword rescue runs.
The platform has no priority setting for intents. Overlap is settled by the order of 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.
This is a section snippet. Replace the INTENTS: section in the minimal example.

Use only a description, no keywords

Leave out the NLU: 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 as intent.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 no INTENTS: 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

  1. Run the validator on all three files. Expect no errors and no warnings.
  2. Say “I was charged twice for invoice 22”. Expect a handoff to Billing_Specialist.
  3. Say “where is my order”. Expect a handoff to Order_Specialist.
  4. In the trace, open the pipeline_classify event for the category and confidence. Open pipeline_routing_resolve for the rule that matched.
  5. With the classifier off, say “refund please”. Expect the pipeline_intent_bridge event with the source native_lexical and the matched pattern.
  6. 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 WHEN is declared. The compiler warns UNDECLARED_INTENT_CATEGORY otherwise.
  • LEXICAL_FALLBACK is set on purpose.
  • Tests cover a clear request, an overlapping request, an off-topic request, and a plural keyword.

Common mistakes

Troubleshooting

Related articles: