> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/maiagent-user-guide/en/serve/voicecs/ivr-intent-recognition.md).

# IVR Customer Intent Recognition

IVR customer service intent recognition example: customers state their needs by voice, and an Agent determines the intent and routes them to the right service, replacing keypad-based voice menus.

**IVR (Interactive Voice Response) customer service intent recognition** is an application of AI voice processing technology that lets users interact with a customer service system through voice commands and automatically recognizes the customer's intent to provide the appropriate service. In Taiwan, such systems are widely used in banking, telecommunications, healthcare, and other industries to improve service efficiency and customer experience.

## **Core Features and Workflow** <a href="#core-features-and-workflow" id="core-features-and-workflow"></a>

1. **Receive Voice Input**\
   After the customer calls, the system plays an automated voice prompt (for example: "Please briefly describe what you need, and we will assist you."). Instead of pressing keys to choose options, the customer states their needs directly by voice.
2. **Speech Recognition (ASR)**\
   The system uses Automatic Speech Recognition technology to convert speech into text. For example, if the customer says "I want to check my bill," the system converts the utterance into text input.
3. **Natural Language Understanding (NLU)**\
   The system uses Natural Language Understanding technology to analyze the meaning and determine the user's actual need. For example:
   * Vocabulary analysis: Keywords such as "check" and "bill" indicate that the need is related to billing.
   * Intent recognition: Determines that the customer's purpose is to "check the bill."
4. **Response and Routing**\
   Based on the results of the semantic analysis, the system provides the corresponding service. The possible options are:
   * **Direct response**: If the need can be handled automatically, for example, "Your bill amount is NT$1,200, and the payment due date is December 15."
   * **Transfer to a live agent**: If the need is more complex, the system automatically transfers the call to a customer service representative in the relevant department and provides a summary of the request, reducing repeated explanations.

## **Technical Challenges and Limitations** <a href="#technical-challenges-and-limitations" id="technical-challenges-and-limitations"></a>

1. **Difficulty understanding diverse expressions**
   * Users may not phrase things in a standard way. For example, "What's going on with my bill?" or "What do I do about the payment issue?" are somewhat vague, and models such as BERT sometimes <mark style="color:red;">**cannot precisely determine the specific need**</mark>.
   * In Taiwan, systems must also cope with a mix of languages and dialects (Mandarin, Taiwanese, Hakka), and language models still have insufficient support for data in these languages.
2. **Limits of fine-grained intent classification**
   * Although modern NLP models can process large amounts of text, they cannot fully grasp the specialized knowledge or particular intents of certain industries. For example, "I want to know the exact date of my last payment" may require connecting to different systems to answer correctly.
   * Even though BERT performs well on short conversation fragments, long sentences or complex expressions can confuse the model.
3. **Data bias and incomplete corpora**
   * Training a language model <mark style="color:red;">**requires a large amount of localized corpus data**</mark>. If the data is insufficient or skewed toward a single form of expression, the model adapts poorly to special contexts. For example, for expressions specific to Taiwan such as "top-up" (儲值) or "skip number" (跳號碼), the model may lack enough contextual corpus data.
4. **Context and memory limitations**
   * Customer conversations usually have contextual links. For example, in a multi-turn conversation such as "Regarding the payment we just discussed, I have another question," the system must remember the earlier intent. Existing NLP models perform only modestly in this area.
   * If the intent is determined incorrectly, users may have to restate their needs, which causes frustration.
5. **Low tolerance for errors**
   * Customers have limited patience with customer service systems. If the voice system misjudges, customers may feel frustrated and ultimately ask to speak with a real person directly.

## Industry Status Quo <a href="#industry-status-quo" id="industry-status-quo"></a>

Today, many companies' voice customer service systems still use traditional keypad-based flows. Take the **voice customer service system of SinoPac Bank** as an example: its design takes the diversity of services fully into account and guides users through multi-level menus. However, there is still plenty of room to optimize and improve the user interaction experience.

The emergence of LLMs (large language models) and RAG (Retrieval-Augmented Generation) has brought revolutionary change to semantic recognition and to IVR systems as a whole, making voice customer service systems smarter, more accurate, and more adaptable, and overcoming many limitations of traditional NLP techniques.

{% embed url="<https://bank.sinopac.com/MMA8/bank/service/cs-phonecall.html>" %}

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-f74eb3f1cbee204c4d67bbd4a0f7abdc1e2a9776%2Fimage%20(6)%20(1).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

## Solution <a href="#solution" id="solution"></a>

Below, we will use MaiAgent's powerful and precise LLM and RAG capabilities to walk you step by step through building an excellent semantic recognition assistant.

### Steps <a href="#operation-steps" id="operation-steps"></a>

#### 1. Prepare the Data <a href="#step1-data-preparation" id="step1-data-preparation"></a>

{% hint style="info" %}
In the past, BERT required large amounts of labeled data to train for NLP tasks such as intent recognition and sentiment analysis. Labeled data is usually produced manually, for example by tagging sentences with intent categories or keywords, which is both time-consuming and expensive. Even with high-quality labeled data, the model's ability to generalize may be limited. When business needs or usage habits change, the data must be relabeled and the model retrained, which takes a long time.

The advantage of LLMs and RAG is that they combine generative language ability with the dynamic nature of real-time retrieval. They remove the dependence on labeled data, improve the accuracy of semantic recognition, lower development and maintenance costs, and greatly improve the user experience. This combination of technologies sets a new industry standard for intelligent customer service and voice interaction, and is a key driver of future automated and personalized service.
{% endhint %}

The introduction of LLMs and RAG greatly simplifies the preparation of labeled data. Now you only need to organize your data into an Excel spreadsheet, list the intent categories simply, and upload this **bank customer service list** to the Agent's knowledge base to support the intelligent semantic recognition system.

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-b51c7052b561e2da03555b7a46e2cd7362bd876e%2F%E6%88%AA%E5%9C%96%202024-12-02%20%E6%99%9A%E4%B8%8A11.14.49.png?alt=media" alt=""><figcaption><p>Bank service list (for intent recognition)</p></figcaption></figure>

#### **2. Define the Role Instructions** <a href="#step2-define-system-prompt" id="step2-define-system-prompt"></a>

```markdown
# Role
You are MaiAgent Bank's semantic understanding bot

# Output Format
Based on the user's conversation, understand the service intent the customer wants, determine from the knowledge base which service intent the user wants, and output it

When the intent is clear, output only one intent; if there are multiple similar intents that cannot be distinguished, list up to 3 of the closest intents

<example>
-<code>:<category> - <subcategory>
</example>

<example>
-<code>:<category> - <subcategory>
-<code>:<category> - <subcategory>
...
</example>

<example>
N/A
</example>

# Output Restrictions
- Reply in Traditional Chinese
- Do not answer with information outside the scope of the knowledge base
- Output the text inside <example> and </example> directly, without any other description
- The output does not include <example> and </example>
- Answer based on the knowledge base; when the intent cannot be determined, answer with the text in the <example> below
```

#### 3. Get Started <a href="#step3-get-started" id="step3-get-started"></a>

### Usage Examples <a href="#usage-examples" id="usage-examples"></a>

#### Single-Turn Conversation <a href="#single-turn-conversation" id="single-turn-conversation"></a>

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-910668dec14fc1c02eb38cd458210fdf5ab90f69%2F%E6%88%AA%E5%9C%96%202024-12-03%20%E5%87%8C%E6%99%A812.29.05.png?alt=media" alt=""><figcaption><p>Intent recognition example</p></figcaption></figure>

#### Multi-Turn Conversation <a href="#multi-turn-conversation" id="multi-turn-conversation"></a>

LLMs and RAG solve the bottleneck that BERT has in recognizing intent across multi-turn conversations.

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-cec0212cfd074e95697d756eef976f3231d7ff35%2F%E6%88%AA%E5%9C%96%202024-12-03%20%E5%87%8C%E6%99%A812.29.53.png?alt=media" alt=""><figcaption><p>Intent recognition multi-turn conversation example</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.maiagent.ai/maiagent-user-guide/en/serve/voicecs/ivr-intent-recognition.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
