# Create AI Assistant

## 1. **Create an AI Assistant**

Navigate to the "<mark style="color:blue;">AI Features</mark>" section in the left sidebar, then select "<mark style="color:blue;">AI Assistants</mark>". Click the "<mark style="color:blue;">+ Create AI Assistant</mark>" button in the upper right corner.

<figure><img src="/files/7xtUJTNAJ4pJhgKk8V30" alt=""><figcaption></figcaption></figure>

## **2. Name Your AI Assistant**

Select the "Basic Settings" tab and fill in the "<mark style="color:blue;">AI Assistant Name</mark>" field with the name of your AI assistant. You can name it based on the assistant's primary task, such as "XX AI Customer Service," "XX Regulation Query Assistant," or "XX Project Smart Assistant."

One account can create multiple AI assistants (subject to quantity limits based on your purchased plan).

<figure><img src="/files/xnRehIlOTocWBbQhH5RY" alt=""><figcaption></figcaption></figure>

## 3. Select RAG to Make Your AI Assistant Smarter and More Accurate

### What is RAG

You can think of RAG as a combination of "a conversational assistant + a skilled librarian who excels at finding information."

A typical AI assistant is like someone with excellent memory who's good at storytelling, but they can only share knowledge they've learned before. However, when an AI assistant is equipped with RAG technology, it's as if this assistant **first goes to the library to find the latest information** before answering questions, then organizes the findings into their own words and provides you with a clear response.

In the MaiAgent platform, this "library" is our **knowledge base**. The AI assistant will use RAG technology to retrieve relevant information from the knowledge base, making responses more accurate, timely, and aligned with needs.

The knowledge base configuration method will be explained in detail in the next section.

{% hint style="info" %}
MaiAgent RAG includes not only the RAG technology mentioned at OpenAI's developer conference but also combines various classic NLP algorithms with proprietary retrieval techniques. Compared with OpenAI RAG using internal datasets, both can achieve 95% response accuracy.
{% endhint %}

### RAG Configuration Method

Select the "<mark style="color:blue;">RAG Settings</mark>" tab and choose a different RAG (Retrieval-Augmented Generation) from the "<mark style="color:blue;">RAG</mark>" dropdown menu. If there are no special requirements, <mark style="color:green;">MaiAgent RAG is set as the default</mark>.

<figure><img src="/files/q7Mr4iyERzjpALwLDrSS" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Compared to OpenAI RAG, MaiAgent RAG provides more additional features, can flexibly apply to different deployment needs, handles more diverse data processing formats, and provides a more powerful retrieval and generation experience.

For a detailed comparison, please see [**What is RAG? Comparison Table of MaiAgent RAG and OpenAI RAG**](/tech/quickstart/rag.md)
{% endhint %}

## **4.** Select a Model to Choose a Smart Brain for Your AI Assistant!

### Purpose of Language Model Selection

Much of each AI assistant's performance depends on its brain—that is, the language model (LLM) it uses. In this step, you can select different types of models based on your needs, which will affect response speed, comprehension ability, and the depth and naturalness of answers.

Choosing the right model is like enabling high-efficiency mode for your AI assistant, creating the best experience tailored to your application scenario!

{% hint style="info" %}
[**Key Factors When Choosing a Large Language Model**](https://docs.maiagent.ai/tech/quickstart/llm)
{% endhint %}

### Language Model Configuration Method

Select the "<mark style="color:blue;">RAG Settings</mark>" tab. In the "<mark style="color:blue;">LLM Model</mark>" dropdown menu, you can choose different large language models. If there are no special requirements, <mark style="color:green;">Claude 4.5 Sonnet is set as the default</mark>.

<figure><img src="/files/uMkppslKY5PRyNVXYvuE" alt=""><figcaption></figcaption></figure>

## 5. Create Role Instructions Based on Application Scenarios

To make your AI assistant more aligned with different application needs, you can set "role instructions" to make the AI's response style and content more contextually appropriate.

{% hint style="info" %}
[What are Role Instructions? Role Instruction Template Examples?](https://docs.maiagent.ai/tech/ai-agents/system-prompt)

[AI Tool for Generating Role Assistants](https://chat.maiagent.ai/web-chats/eb2c95ef-f022-4716-92aa-ec0d3ffbc80b/conversations/bc7ed5e6-b3cb-4c91-a465-a4e439c06db4)
{% endhint %}

### Hallucination-Free Generative AI Response Mechanism

MaiAgent's "hallucination-free generative AI response mechanism" ensures that AI maintains high accuracy when answering questions. When facing uncertain questions or topics beyond its knowledge scope, it will honestly express its limitations rather than generate fabricated answers, providing users with a more reliable and trustworthy AI interaction experience. The importance of this for various industries and public sector applications is explained below:

{% tabs %}
{% tab title="Industry Applications" %}
**Financial Industry Applications:**

When handling investment advice and risk assessment, AI must provide analysis based on solid data, avoiding false information that could lead to incorrect investment decisions. When information is insufficient or uncertain, the system will clearly indicate this to ensure the reliability of investment decisions.

**Medical Industry:**

When assisting with medical diagnosis and medication consultation, AI systems must strictly adhere to established medical knowledge and cannot generate advice that might mislead patients. For novel or unverified medical information, the system will clearly state that further professional consultation is needed.

**Manufacturing Industry:**

In applications such as production process optimization and quality control, AI must provide recommendations based on actual production data and validated methods, avoiding production losses due to inaccurate predictions.

**Education Industry:**

When assisting with teaching and answering student questions, AI needs to provide accurate knowledge rather than incorrect information that could mislead learning. For complex or ambiguous concepts, the system will acknowledge its understanding limitations.

**Legal Industry:**

When providing legal information and advice, AI must base responses on existing laws and precedents rather than providing speculative advice that could carry legal risks. The system will clearly indicate matters that require further confirmation by professional lawyers.

**Customer Service Consultation:**

When handling customer inquiries, AI must provide accurate product information and service descriptions. For questions that cannot be determined, it will immediately refer to relevant professionals to avoid misleading customers.
{% endtab %}

{% tab title="Public Sector Applications" %}
**Government Policy Consultation:**

When providing citizens with policy information and service guidance, AI must respond based on the latest and correct regulations and administrative procedures, avoiding outdated or incorrect information. When encountering complex issues requiring professional judgment, the system will clearly suggest that citizens seek assistance from relevant departments.

**Public Service Decision-Making:**

When assisting the government in evaluating public construction, social welfare, and other decisions, AI must analyze based on real data and research, clearly explaining uncertain predictions to ensure policy-making reliability.

**Emergency Response Management:**

When handling natural disasters, public health, and other emergencies, AI systems must provide accurate information and guidance, and cannot generate false information that might mislead the public, affecting disaster prevention and response effectiveness.
{% endtab %}
{% endtabs %}

### Select Appropriate Response Mode to Create Instructions

Select the <mark style="color:blue;">"Response Mode"</mark> tab. From free conversation to highly structured responses, it meets various business needs. Each mode has its own characteristics and applicable scope, allowing you to flexibly choose based on actual usage scenarios.

<figure><img src="/files/9QLuyPmPksyZc557FIGy" alt=""><figcaption></figcaption></figure>

{% tabs %}
{% tab title="Response Mode: General" %}
**Applicable Scenarios**

Freely answers based on questions. AI will generate the most appropriate response based on context and knowledge base content. Suitable for most Q\&A scenarios.

**Operation Process**

Select the "<mark style="color:blue;">Response Mode Settings</mark>" tab, choose <mark style="color:blue;">"General (Default)"</mark> as the response mode, and fill in the role instructions you've defined for the AI assistant in the "<mark style="color:blue;">Role Instructions</mark>" field. For output format, you can choose to output plain text or JSON format.

<figure><img src="/files/GSSPOT2GJYZD2DaccpSf" alt=""><figcaption></figcaption></figure>

**Application Scenario: Website Customer Service Assistant**

If you want to create a website customer service assistant for "MaiAgent - AI Assistant Development Platform," you can enter the AI's response settings in the "Role Instructions" field, clearly defining its response style and scope of responsibilities.

<figure><img src="/files/6Fa8vW4u7Bs0L4Gx8Ree" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Response Mode: Template" %}
When you select "<mark style="color:blue;">**Response Mode: Template**</mark>," the probability of hallucinated responses from your AI assistant will be reduced to zero, because the AI assistant will strictly respond to questions based on the knowledge base and FAQ content you've created, responding based on classification principles rather than having the LLM generate content. Using a template system to generate answers guarantees 100% hallucination-free responses.

**Applicable Scenarios**

Situations requiring unified answer formats, such as standard consultation processes, reports, etc.

**Case Operation**

Suppose you want to create a "Tainan City Government 1999" customer service AI assistant to respond to citizens' municipal questions in real-time.

**1. Select the "**<mark style="color:blue;">**Response Mode Settings**</mark>**" tab and choose&#x20;**<mark style="color:blue;">**"Template"**</mark>**&#x20;as the response mode**

<figure><img src="/files/oTgLZ8tVtyQZo0VkkJm2" alt=""><figcaption></figcaption></figure>

**2. Fill in the Response Template (use template system to generate answers)**

If you haven't created a knowledge base and FAQ yet, the default instruction content for the response template is as follows.

It is recommended that you first add a knowledge base or FAQ to use the response template, and the format **must be tabular files such as Excel, CSV, JSON, JSONL, etc.**

<figure><img src="/files/ETOmmN6AmNlkVkB5HX8x" alt=""><figcaption></figcaption></figure>

In this scenario, I have an AI assistant "Tainan City Government 1999" and added "Tainan 1999 FAQ" to the knowledge base.

The fields in the FAQ include questions, answers, department, category, and publication time.

It is recommended that you upload **Excel, CSV, JSON, JSONL** and other tabular format files. The fields must have **titles and corresponding content**.

![](/files/tWljHJPQ7GAOEqZq0DWz)

Now we return to editing the response template and click "<mark style="color:blue;">**Initialize Response Template**</mark>" in the upper right corner. You will see the system generate a response example based on the document you just uploaded to the knowledge base.

<figure><img src="/files/VgkrUmz2Y45WndCH0gFU" alt=""><figcaption></figcaption></figure>

Now you can edit and format the response text portion.

The parts with \[] {} are system instructions, so you only need to handle the text portions.

📍 **Loop: Fill in the corresponding document filename (specify which document to use for response generation)**

I modified the following parts:

* [x] **"Opening" content**
* [x] **"Question" content**
* [x] **"Category" content**
* [x] **Removed "Department"**
* [x] **Closing content**
* [x] **Line break formatting**

<figure><img src="/files/f0veTRyDt7FYolzNQyxy" alt=""><figcaption></figcaption></figure>

When we return to the AI assistant Q\&A interface and ask related questions, the AI assistant's response will completely follow the **template format** and **FAQ document content** we just edited.

<figure><img src="/files/6pUoSTlr6TgWPTBPY7i4" alt=""><figcaption></figcaption></figure>

**3. Fill in the Unable to Respond Template**

If the AI assistant determines there is no relevant information, it will respond according to the "<mark style="color:blue;">**Unable to Respond Template**</mark>."

Finally, click the "<mark style="color:blue;">**Save**</mark>" button.

<figure><img src="/files/PtIq6DXaifXGRe1CYwPV" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Response Mode: Hybrid" %}
**Applicable Scenarios**

Combines general answers with templates, using template format for some content and free answers for the rest. Suitable for situations requiring partially structured answers.

**Operation Suggestions**

At this point, the role instruction content may conflict with "Response Mode: Template," so when selecting "Response Mode: Hybrid," it is recommended to revise the role instruction content to focus on general directional principles.

For example, the role instruction's tasks, interaction principles, communication attitude, etc.

<figure><img src="/files/sD2o9dU9auPyuWPXWWix" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Response Mode: Workflow" %}
**Applicable Scenarios**

Suitable for specific work task scenarios, such as knowledge management, data summarization, project planning

**Operation Process**

Please go to the "Response Mode Settings" tab and select <mark style="color:blue;">**"Workflow"**</mark> as the response mode. This mode is suitable for task-oriented application scenarios such as:

* **Knowledge Management**: Assist in compiling, retrieving, or maintaining internal knowledge data
* **Information Summarization**: Quickly organize document highlights or meeting minutes
* **Project Writing**: Assist in brainstorming, drafting proposals, etc.

Based on actual business needs, select the corresponding workflow module to maximize the effectiveness of the AI assistant in specific tasks.

<figure><img src="/files/Taf5N6MdQoe82k8Mvwg3" alt=""><figcaption></figcaption></figure>

**Application Scenario: Copywriting Assistant**

Suppose you are a marketing staff member at a food company and are writing promotional copy for a newly launched healthy snack.

First, you can select "Writing Assistant" in "Workflow"

<figure><img src="/files/SMJ0EPYrpdMjXmEhaLqB" alt=""><figcaption></figcaption></figure>

Then, you can go to the AI assistant Q\&A interface and submit your writing needs. The AI assistant will guide you step by step to fill in key information needed for writing copy, such as:

* Copy theme
* Writing style
* Target audience
* Word count

AI will generate copy options that fit the context and communication needs based on your settings, helping you brainstorm quickly and improve writing efficiency.

<figure><img src="/files/AyD49nI4phsJv2AfdZbo" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/jjIL2poHboLwCEEVunHd" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Response Mode: Agent" %}
**Applicable Scenarios**

In daily enterprise operations, employees often need to organize data, conduct data analysis, and create reports and analytical reports based on routine business needs or tasks assigned by supervisors. Common query questions include:

* "Which product had the highest sales last month?"
* "Please list all customers with sales exceeding 100,000"
* "What is the revenue trend over the past three months?"

If these types of questions are handled by non-technical personnel, they often need to rely on data teams to help write SQL query statements, which is time-consuming and has limited efficiency.

Now, through MaiAgent's Agent mode, the system can use the Text to SQL tool to automatically convert natural language questions into corresponding SQL syntax and query the database in real-time, quickly providing analysis results.

{% hint style="info" %}
For an introduction to the Text to SQL function, please refer to: [Text to SQL Function](https://github.com/Playma-Co-Ltd/maiagent-user-guide-gitbook/blob/main/en/en/tools/text2sql.md)
{% endhint %}

This function is particularly suitable for scenarios requiring <mark style="color:blue;">**real-time queries and data insights**</mark>, such as report analysis, operational metric tracking, and data queries. It allows non-technical users to easily access data, achieving a more intuitive and efficient data-driven decision-making process.

**Text to SQL Operation Process**

1. Go to the "Response Mode Settings" tab and select <mark style="color:blue;">**"Agent"**</mark> as the response mode

<figure><img src="/files/2JSXE9uktXGm78LzwFdK" alt=""><figcaption></figcaption></figure>

2. Upload database content or select database URL

{% hint style="info" %}

* MaiAgent supports:
  * **MySQL**
  * **PostgreSQL**
  * **Oracle DB**
  * **Microsoft SQL Server (MSSQL)**
* The maiagent option applies Excel files you have uploaded in the MaiAgent knowledge base
  {% endhint %}

**Application Scenario: E-commerce Product Sales Data Query**

Suppose you are a marketing staff member at an e-commerce platform and want to quickly query data such as product sales

First, in the "Response Mode Settings" tab, select <mark style="color:blue;">**"Agent"**</mark> as the response mode

<figure><img src="/files/9Hk3k9PxuU0zvx5dc8ip" alt=""><figcaption></figcaption></figure>

Next, you can choose to upload an Excel file to the knowledge base, and the system will automatically convert it to a queryable database format

{% hint style="info" %}
For a detailed introduction to using MaiAgent knowledge base for Text to SQL, please refer to: [Using MaiAgent Knowledge Base for Text to SQL](https://github.com/Playma-Co-Ltd/maiagent-user-guide-gitbook/blob/main/en/en/tools/text-to-sql-maiagent.md)
{% endhint %}

<figure><img src="/files/jx8VxMUwTDpVsw92v3WL" alt=""><figcaption></figcaption></figure>

You can also directly ask the company's technical staff to provide a MySQL or PostgreSQL connection string.

Here, assuming a PostgreSQL connection string has been obtained, please select PostgreSQL from the database URL dropdown menu, paste the connection string, and click Save.

<figure><img src="/files/dDXHgnq1BEmmHMxR2ks3" alt=""><figcaption></figcaption></figure>

After setup is complete, you can go to the AI assistant Q\&A interface and enter a question, such as

"What are the top three items with the highest sales on the official website, excluding shipping fees?"

<figure><img src="/files/eUX1jCOt1Zf5gKI6DdxW" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## 6. Pre-assign Assistant Permissions

{% hint style="info" %}
[RBAC-Based Permission Management Architecture and Description](https://github.com/Playma-Co-Ltd/maiagent-user-guide-gitbook/blob/main/en/en/build/broken-reference/README.md)
{% endhint %}

Select the "<mark style="color:blue;">Permission Settings</mark>" tab, where you can set which members the assistant should be pre-assigned to for access. The default is to select all and add to all roles, which can be modified based on usage scenarios.

<figure><img src="/files/EPmnTU3IfCfrWz7IV2Ar" alt=""><figcaption></figcaption></figure>

## 7. Complete Your AI Assistant Creation

After entering the above steps, click the blue "<mark style="color:blue;">Confirm</mark>" button in the lower right corner of the dialog box to complete the setup 🎉.


---

# Agent Instructions: 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:

```
GET https://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-en/build/setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
