> 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/application/text.md).

# Text Customer Service

Build AI text customer service assistants for external use with knowledge bases and FAQ, connect to websites and messaging platforms, and hand off to human agents when needed

In enterprise customer service operations, handling a large volume of frequent customer inquiries through manual responses not only leads to delays but also places excessive burden on customer service staff, affecting overall service efficiency. Many repetitive questions appear over and over again, consuming significant time to handle, making it difficult for teams to focus their energy on more complex customer needs and problem resolution.

Now, you can leverage MaiAgent to build an AI text customer service assistant for external-facing enterprise use, effectively reducing customer service costs while improving service quality and customer satisfaction!

## Use Cases <a href="#use-cases" id="use-cases"></a>

* **Website & Messaging Platform Customer Service**: Embed the AI assistant on your website, or connect it to LINE, Facebook Messenger, WhatsApp, and other messaging platforms your customers use, providing 24/7 instant responses.
* **Regulatory & Policy Inquiries**: Government agencies or highly regulated industries that need to help the public and internal staff quickly find answers from large volumes of regulatory announcements, with responses that must include source citations.
* **Product Specifications & Recommendations**: Catalogs, spec sheets, and comparison tables are voluminous and frequently updated, with diverse customer questions that are time-consuming to look up manually.
* **Order & After-Sales Inquiries**: Real-time queries for order status, warranty coverage, repair progress, and other external system data that cannot be answered from static documents alone.

{% hint style="info" %}
A single knowledge base can serve multiple AI assistants simultaneously. A common approach is to create one AI assistant for "external-facing customers" and another for "internal customer service staff," sharing the same knowledge base but with different system prompts so their response detail and tone differ.
{% endhint %}

## How It Works <a href="#how-it-works" id="how-it-works"></a>

| Step                            | Description                                                                                                                                                        |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **1. Customer Asks a Question** | The customer submits a question through a connected channel such as the website Web Chat, LINE, or Facebook Messenger                                              |
| **2. AI Assistant Takes Over**  | Based on the system prompt, the assistant determines which data sources to use for the response                                                                    |
| **3. Find the Answer**          | Semantically retrieves relevant passages from the knowledge base, matches against FAQ entries; calls tools to query external systems when real-time data is needed |
| **4. Generate Response**        | Synthesizes retrieval results into a response, including citation sources as configured                                                                            |
| **5. When Unable to Answer**    | Triggers handoff to a human agent, transferring the conversation to customer service staff                                                                         |

After receiving a question, the AI assistant performs semantic retrieval from the knowledge base to find relevant passages, then has the language model synthesize a response, including [citation sources](/maiagent-user-guide/en/conversations/web-chat/citation-display.md) as configured so customers can trace back to the original content. If the question falls outside the knowledge scope, [human handoff notifications](/maiagent-user-guide/en/conversations/human-handoff/handoff-notification.md) can be configured to transfer the conversation to customer service staff, preventing the AI from providing incorrect answers.

## Setup Workflow <a href="#setup-workflow" id="setup-workflow"></a>

### 1. Create an AI Assistant <a href="#step1-create-agent" id="step1-create-agent"></a>

On the <mark style="color:blue;">AI Assistants</mark> page, enter a name, select the RAG and language model, and configure the response mode. For general text customer service, "Standard Mode" is sufficient. See [Create an AI Assistant](/maiagent-user-guide/en/build/setup.md) for details.

### 2. Write the System Prompt <a href="#step2-system-prompt" id="step2-system-prompt"></a>

The system prompt defines the AI's identity, output format, and response boundaries — it is the key to customer service quality. It is recommended to explicitly state "do not answer questions outside the knowledge base scope" and provide standard fallback responses for unanswerable questions. Refer to the [System Prompt Design Guide](/maiagent-user-guide/en/build/system-prompt.md) for writing tips.

### 3. Build Knowledge Bases and FAQ <a href="#step3-knowledge-base" id="step3-knowledge-base"></a>

Upload catalogs, spec sheets, announcements, and other documents to build a [knowledge base](/maiagent-user-guide/en/km/km.md), or use the [web crawler](/maiagent-user-guide/en/km/scrape-website.md) to automatically extract website content. For high-frequency questions with fixed answers, create a separate [FAQ](/maiagent-user-guide/en/km/faq.md) to ensure consistent responses. Before going live, use [search testing](/maiagent-user-guide/en/km/test-search-result.md) to verify retrieval results.

### 4. Configure Tools (Optional) <a href="#step4-configure-tools" id="step4-configure-tools"></a>

If customer service requires querying real-time data such as orders or inventory, [configure tools for the AI assistant](/maiagent-user-guide/en/tools/configure_tools.md) to let the AI directly call internal enterprise APIs for the latest results.

### 5. Connect Messaging Platforms and Go Live <a href="#step5-connect-channel" id="step5-connect-channel"></a>

[Choose the messaging platforms](/maiagent-user-guide/en/conversations/choose-channel.md) to connect based on your customers' preferred channels. You can simultaneously connect Web Chat, LINE, Facebook Messenger, Telegram, Microsoft Teams, WhatsApp, Email, and Slack.

### 6. Monitor and Optimize <a href="#step6-monitor" id="step6-monitor"></a>

After going live, perform [automated evaluation and AI assistant monitoring](/maiagent-user-guide/en/agent-ops/evaluations.md) in AgentOps, and follow the recommendations in the [AI Customer Service Quality Guide](/maiagent-user-guide/en/build/ai-quality-guide.md) to continuously supplement the knowledge base and refine the system prompt.

## Application Examples <a href="#examples" id="examples"></a>

* [Regulatory Inquiry Assistant](/maiagent-user-guide/en/application/text/lawsearch.md): Using government regulatory announcements as an example, learn how to design two different response approaches for internal staff and the general public using a single knowledge base.
* [Product Inquiry Assistant](/maiagent-user-guide/en/application/text/productsearch.md): Using a computer brand product catalog as an example, walk through the complete process from creating an assistant, uploading the catalog, to embedding it on a website.

The following sections demonstrate the setup process with real-world examples to help you quickly apply these capabilities to your own business scenarios.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.maiagent.ai/maiagent-user-guide/en/application/text.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
