Intent detection
Intent classification: detect what users want, reliably
Short answer
Intent classification maps a user's message to what they want to do, such as track an order, return an item or talk to a human. With a decision model you describe each intent in plain language, get a probability per intent, and ask a clarifying question when confidence is low instead of guessing.
Intent detection is the first step of almost every conversational product. Traditional NLU platforms trained a model per intent from dozens of example phrases, which made adding or changing intents slow. LLMs made description-based intents possible, but a chat model returns a label without a trustworthy confidence, which is exactly what you need to decide when to ask a follow-up question.
A decision model gives you both: intents defined by description, and a probability for each.
Get Early Access to ClassifierHub: 2× credits in your first paid month.
Designing an intent list
- Name intents after the action the user wants (return_item), not the topic (returns).
- Describe each intent in one sentence that separates it from its neighbors.
- Include talk_to_human and other. Users who want a person should never be trapped.
- Keep the list short at the top level. If you need 40 intents, classify into 5 groups first.
Implementation
Send the latest user message (plus a short summary of the conversation if context matters) and your intent map. Use the confidence to choose between acting, asking a clarifying question and handing off.
import os
import requests
INTENTS = {
"track_order": "Asks where an order is or when it will arrive",
"return_item": "Wants to return or exchange a product",
"cancel_subscription": "Wants to cancel or pause a subscription",
"product_question": "Asks about features, sizes, compatibility",
"talk_to_human": "Explicitly asks for a person",
"other": "Anything else",
}
def detect_intent(message: str) -> str:
r = requests.post(
"https://classifierhub.com/v1/classify",
headers={"Authorization": f"Bearer {os.environ['CLASSIFIERHUB_API_KEY']}"},
json={
"input": message,
"instructions": "What does the customer want to do?",
"options": INTENTS,
},
timeout=5,
)
r.raise_for_status()
result = r.json()
# Below the threshold, ask a clarifying question instead of guessing.
return result["label"] if result["confidence"] >= 0.6 else "clarify"The ClassifierHub API opens to Early Access members first.
Handling ambiguity
Look at the top two probabilities, not just the winner. When two intents are close (for example return_item 0.48 and track_order 0.44), ask a question that separates them: "Do you want to return the order, or find out where it is?". This single change usually improves the experience more than tuning the model.
Beyond chatbots
The same pattern routes inbound email, contact forms, voice transcripts and in-app feedback. For agents, intent classification decides which tool or sub-agent should handle a request before the expensive planning step runs.
Frequently asked questions
Related guides
Last updated . ClassifierHub is an independent product built on top of the Jev decision model, accessed through OpenRouter. It is not affiliated with or endorsed by TypeSafe or OpenRouter.