Skip to content

Intent Recognition

Intent recognition classifies what a customer wants from a message, such as tracking an order or a refund, with a confidence score that picks the handler.

Also called: Intent classification · Intent detection · Intent matching

Reviewed

Interactive lab

Hands on: use the controls to explore. Anything that plays on its own pauses while you are working inside it.

Route messages by recognised intent

10 / 10

Only agents with the required skill are eligible; the least busy of them wins.

Incoming · 0 left

  1. All 10 conversations have been routed.

Conversation 10 of 10 · Skills-based

Diwali timings? · 0.84(needs store_hours)goes toFAQ answers

Skills: needs store_hours, and only FAQ answers has it.

  • Order bot

    3 of 4 open

    • track_order
    • cancel_order
    1. Where's my parcel? · 0.93needs track_order
    2. Cancel order 48213 · 0.88needs cancel_order
    3. Parcel kidhar hai · 0.81needs track_order
  • Returns flow

    2 of 3 open

    • refund_request
    1. Refund kab milega? · 0.86needs refund_request
    2. Money back, item damaged · 0.79needs refund_request
  • FAQ answers

    2 of 2 open

    Full
    • store_hours
    1. Open on Sunday? · 0.95needs store_hours
    2. Diwali timings? · 0.84needs store_hours
  • Agent Priya

    1 of 2 open

    • talk_to_agent
    1. Talk to a human · 0.97needs talk_to_agent
  • Fallback menu

    2 of 2 open

    Full
    • fallback
    1. Hello?? · 0.38needs fallback
    2. asdf ok · 0.22needs fallback

Waiting · 0

  1. Nobody waiting: every conversation found an agent.
Same 10 conversations, each strategy
StrategyRoutedWaitingSkill mismatches
Skills-based1000
Round-robin1007
Each message carries the intent the classifier recognised and its confidence. Skills-based routing sends it to the handler for that intent; switch to round-robin to see routing without intent recognition.

Conversation 10 of 10, Diwali timings? · 0.84: Skills: needs store_hours, and only FAQ answers has it.

01What is intent recognition?

Intent recognition — also called intent classification or intent detection — is the part of a chatbot's natural language understanding (NLU) that decides what the customer is trying to do. Given "where's my parcel, it's been 6 days", it returns an intent such as track_order with a confidence score, say 0.93, and the bot routes the message to the handler for that task.

An intent set is the list of goals the bot supports, each defined by a name, a description and example phrases: track_order, cancel_order, refund_request, store_hours, talk_to_agent. Classic classifiers are trained on labelled phrases for each intent, often comparing messages as vectors (embeddings); large language models can classify with no training at all, from a prompt listing the intents and their descriptions, returning a label from a fixed list. Many production bots combine both: a fast classifier for the common intents and an LLM for the long tail.

Confidence is what makes recognition safe to act on. If the top intent clears a threshold and leads the runner-up clearly, the bot proceeds; otherwise it falls back — asks the customer to rephrase, offers a menu or hands off. Intent recognition captures the goal only. The details needed to complete it — which order, which date — come from entity extraction, and a single message can hold two intents ("cancel this and refund me") that the bot must handle one after the other.

Key takeaways

  • Intent recognition maps a free-text message to one of a defined set of goals, such as track_order or refund_request.
  • Every prediction carries a confidence score; below the threshold, the message goes to the fallback intent.
  • Intents capture the goal; entity extraction captures the details — the order ID, the date, the city.
  • Classic classifiers learn from labelled example phrases; LLMs can classify from intent descriptions alone.
  • On WhatsApp, button and list replies carry IDs you defined, so only free text needs classifying.

02 · How it works, step by step

How does intent recognition work?

  1. Step 1

    Define a small, distinct intent set

    Start with the 10–20 goals that cover most of your traffic, plus talk_to_agent. Merge intents that lead to the same action and split ones that need different handling.

  2. Step 2

    Collect real example phrases

    Use masked messages from your inbox, including Hinglish, regional scripts, typos and voice-note transcripts. Variety beats volume; 20–50 varied phrases per intent is a common starting point for a trained classifier.

  3. Step 3

    Classify with a score

    A trained classifier or an LLM returns the top intents with a confidence each. With an LLM, ask for a label from a fixed list through structured output, never free text.

  4. Step 4

    Route by threshold

    Above the threshold with a clear margin, run the intent's handler; otherwise use the fallback intent. Treat interactive button and list replies as already classified by their IDs.

  5. Step 5

    Measure and retrain

    Track accuracy on a labelled test set, review low-confidence and fallback messages weekly, and add phrases or intents as customers' language shifts.

03Intent recognition in code

const INTENTS = {
track_order: "Where an order or parcel is, or when it will arrive",
cancel_order: "Cancel an order that has not been delivered",
refund_request: "Money back for a returned, cancelled or failed order",
store_hours: "Opening times or location of a store",
talk_to_agent: "Wants a person, not the bot",
};
const schema = {
type: "object",
properties: {
intent: { type: "string", enum: [...Object.keys(INTENTS), "none"] },
confidence: { type: "number", minimum: 0, maximum: 1 },
},
required: ["intent", "confidence"],
additionalProperties: false,
};
const system = [
"Classify the customer's WhatsApp message into exactly one intent.",
...Object.entries(INTENTS).map(([name, desc]) => "- " + name + ": " + desc),
"- none: anything else",
"Messages may be in English, Hindi or Hinglish. Return JSON only.",
].join("\n");
export async function recognise(text, llm) {
const { intent, confidence } = await llm.json({ system, user: text, schema });
// Self-reported confidence is rough: calibrate this threshold on labelled messages
return intent !== "none" && confidence >= 0.6 ? intent : "fallback";
}

A fixed label set and a schema keep the output routable; the threshold decides when to fall back.

04Why does intent recognition matter?

Intent recognition is a bot's switchboard: every wrong decision sends a customer down the wrong path, and every unrecognised message costs a fallback or an agent's time. Getting it right is what lets a bot contain routine volume — order status, timings, returns — while passing everything else to people quickly. It also gives operations a live map of demand: intent counts per day show what customers are asking about, often before any report does.

05Intent recognition: key facts and limits

Output
An intent label plus a confidence score from 0 to 1
Common starting threshold
Around 0.6, tuned on labelled data
Training data
Often 20–50 varied phrases per intent for a trained classifier
Interactive replies
Buttons and list rows return IDs — no classification needed
Below the threshold
Fallback intent: rephrase, menu or handoff
Languages to cover in India
English, Hindi, Hinglish in Latin script and regional scripts

06Example: Hinglish at a Bhubaneswar broadband provider

A Bhubaneswar broadband provider's WhatsApp bot receives about 6,000 messages a day (illustrative). Intent recognition sends "net nahi chal raha since morning" to outage_report (0.91), "bill zyada aaya" to billing_dispute (0.84) and "plan upgrade karna hai 200 mbps" to plan_change (0.95), each to its own handler: the outage handler checks the area-status API, while billing disputes go to the accounts team with the bill attached. "Hello??" scores 0.38 for everything and gets a menu instead of a guess. The weekly review of low-confidence messages turns up dozens of "wifi password" questions, so the team adds a router_help intent with its own guided answer, and the fallback rate drops the following week.

07 · Common mistakes, and the fix

Common mistakes with intent recognition

  • Overlapping intents

    refund_status and refund_request trained on near-identical phrases confuse the classifier and the team. Merge them, or split only where the handlers really differ, and check the confusion matrix.

  • Testing on clean English only

    Real WhatsApp text is Hinglish, abbreviated and misspelt. Accuracy on tidy test sentences overstates live performance; test on masked real messages.

  • Trusting an LLM's stated confidence

    A model asked for its confidence produces a number, not a calibrated probability. Calibrate the threshold on labelled messages, or use a classifier's probabilities for routing.

  • Classifying what is already structured

    Running button and list replies through NLU adds latency and errors. Route interactive replies straight from their IDs.

  • Ignoring messages with two intents

    "Cancel the order and refund me" holds two goals. Handle the main one, keep the second in conversation state and pick it up next.

08 · Tips from the bench

Best practices for intent recognition

  • Keep a talk_to_agent intent that bypasses every fallback counter.
  • Log the intent, score and runner-up for each message; small margins reveal intents that need merging or clearer examples.
  • Re-train or re-prompt monthly — launches and campaigns change how customers write.
  • Run language detection first if different languages go to different models or agents.

09Intent Recognition FAQs

What is the difference between intent recognition and entity extraction?+
Intent recognition finds the goal; entity extraction finds the details. In "cancel order 48213", the intent is `cancel_order` and the entity is the order ID. A bot needs both: the intent chooses the task and the entities let it run.
Do I still need intent recognition if I use an LLM?+
Usually yes, in some form. Even LLM-based agents benefit from an explicit routing step that maps messages to known tasks with a confidence, so business-critical journeys run predictable code and anything unclear falls back or reaches a person.
How accurate does intent recognition need to be?+
Accurate enough that wrong actions cost less than asking. High-impact intents such as cancellations deserve a higher threshold or a confirmation step, while low-risk FAQs can tolerate more errors. Measure on a labelled sample of real messages, not on invented ones.
How do I handle Hindi and Hinglish messages?+
Train or prompt with real examples in every language and script your customers use. Hinglish typed in Latin script is very common on WhatsApp, so include it explicitly rather than relying on translating everything to English first.

From definition to your first message

InfiQ is an official Meta Business Partner. Start a 7-day free trial — no card needed — and see this running on your own number.