Concept
The language model classifier is the only semantic matcher for routing in production. It reads your intent descriptions. You improve routing by improving what it reads and by tuning the thresholds around it. Two settings that other tools use for matching are not active in this release:- Embeddings and a domain glossary in the
NLU:section compile, but nothing in the runtime reads them. NLU:intents:withEXAMPLESorEXAMPLES_FILEis parsed and ignored.
GLOSSARY: section is a compile error, E105.
Use the settings below instead.
Minimal working example
A help desk supervisor writes specific descriptions, adds a keyword fallback, raises the short-circuit threshold, and gates the billing route on confidence. The specialists are short stand-ins in the same project. Replace them with your real agents.agents/help-desk.agent.abl
agents/billing-agent.agent.abl
agents/shipping-agent.agent.abl
How it works
Write descriptions the classifier can separate
- State what each intent includes and what it excludes. “Not delivery or tracking” helps more than a longer list of examples.
- Use distinct vocabulary in each description.
- Keep each description to one quoted line. See Define intents with examples and keyword patterns.
- Write clear tool descriptions. The classifier reads them.
Keyword patterns
Patterns inNLU: categories: are a fallback. They run when the classifier is off or unavailable, and only when LEXICAL_FALLBACK allows it.
- Matching is by whole word or phrase, without regard to case. There is no stemming. Add each plural form.
- A keyword match sets
intent.categorywith a fixed confidence of 0.5. That is below the default short-circuit threshold of 0.85. - A pattern does not guide the language model. It reaches the model only as an “Examples:” description when the intent has no description.
Thresholds
Write the pipeline keys in camelCase in an agent file. The project runtime configuration holds the master switch, the classifier model, and the range-checked values from 0 to 1.
Entity matching
Entity values match better withSYNONYMS, VALUES, DESCRIPTION, and EXTRACTION_HINTS. The project extraction mode sets the stages. The values are auto, pattern_ml, ml, pattern_llm, llm, and pattern. The project extraction confidence threshold defaults to 0.5. See Use enum entities with synonyms.
Not available
These are not configurable in ABL today:- Few-shot examples for the classifier.
- Per-intent keywords for the model.
- An embedding index.
- A classifier prompt, temperature, or timeout.
- A per-language classifier.
- A glossary that reaches the model.
Common variations
Add keyword patterns for a safety net
AddNLU: categories: for the intents you must never miss. Keep LEXICAL_FALLBACK: when_unavailable.
Gate a sensitive route on confidence
Writeintent.confidence >= 0.8 in the WHEN of a route that has a cost, such as a refund. A weaker match falls to the next route, such as a clarification.
Turn the keyword fallback off
SetLEXICAL_FALLBACK: never when a keyword match is worse than no match.
Verification
- Run the validator on all three files. Expect no errors and no warnings.
- Build a test set of 20 real messages per intent, plus 10 off-topic messages.
- Run each message. In the trace, open
pipeline_classifyand record the category and confidence. - Open
pipeline_routing_resolveto see which route matched. - Open
llm_callfor the raw classifier reply when a result looks wrong. - Change one description or threshold. Run the set again. Compare.
- With the classifier off, say “refund please”. Expect
pipeline_intent_bridgewith the sourcenative_lexical.
Production readiness checklist
- Every description separates its intent from the closest one.
- Every intent has a test set, and the results are recorded.
- The short-circuit threshold is set from test data.
- Costly routes have an
intent.confidencegate and a clarification route after them. - Keyword patterns exist for the intents that must not be missed, in singular and plural forms.
- No setting in the
NLU:section that the runtime ignores is relied on. - Pipeline keys are camelCase.
Common mistakes
Troubleshooting
Related articles: