# GAI

**Why do we need GAI?**

As data becomes increasingly vast and diverse, have you ever faced the challenge of handling unstructured information? MantaGO’s latest GAI feature integrates the popular RAG (Retrieval-Augmented Generation) technology to provide you with a comprehensive solution! With simple operations, you can upload files or provide URLs for data training, enabling your chatbot to deliver more precise and fluent responses tailored to your queries. This tutorial will guide you step-by-step on how to activate this feature and unleash the full value of your data effortlessly!

1. I**n the applications section, select "GAI"**

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

#### 2. Configure Basic Settings

* Set the **keywords** to enter or exit GAI mode
* Fill in the **message content** displayed upon entering GAI mode
* Fill in the **message content** displayed upon exiting GAI mode

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

Select the **model** and **language** you want to use

{% hint style="info" %}
Model selection usually represents different versions, capabilities, and application scenarios. Choosing different models affects the quality of generated content, language understanding, creativity, and computational efficiency.
{% endhint %}

{% hint style="info" %}
Language selection determines the language of the system's responses, which corresponds to the language set by the user.

MantaGO currently supports Chinese, English, Japanese, Thai, and Korean.
{% endhint %}

<div><figure><img src="/files/eCAIZcr5R7O7ri8blhT3" alt=""><figcaption></figcaption></figure> <figure><img src="/files/uBQf5rEbhSuCQ7LfHVuh" alt=""><figcaption></figcaption></figure></div>

Once the setup is complete, click into **Response Settings**

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

For each response, you can customize how the system replies or choose from your message pack

<figure><img src="/files/XX31jU9RKi0fBhSYAC5d" alt=""><figcaption><p>After completing this process, it's time to feed the system with knowledge!!</p></figcaption></figure>

\
3\. Next, go to Advanced Settings.

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

Here, you can customize the chatbot's personality, specify topics and content to avoid, set file segmentation sizes, and configure other details.

<div><figure><img src="/files/yL5Lc2x4kXe3yXjapceq" alt="" width="563"><figcaption></figcaption></figure> <figure><img src="/files/31ygliDE5nWEzsTipyFK" alt="" width="477"><figcaption></figcaption></figure></div>

#### Response Randomness (Temperature)

Controls the balance between **creativity** and **consistency** in the bot's responses. A value of **0.4** is generally recommended as a starting point.

> **Decision principle:** Does this question have a "correct answer"? If yes → lower the temperature; if no → raise it.

| Range     | Characteristics                               | Best For                                                              |
| --------- | --------------------------------------------- | --------------------------------------------------------------------- |
| 0.0 – 0.2 | Highly consistent, precise, minimal variation | Medical advice, legal information, order lookups, policy explanations |
| 0.3 – 0.6 | Natural tone, slight variation                | Customer support Q\&A, product recommendations, menu introductions    |
| 0.7 – 1.0 | Creative, diverse, flexible                   | Itinerary planning, outfit suggestions, copywriting                   |

***

#### Number of Data to Retrieve (Top-K)

Controls how many records the AI retrieves from the knowledge base before generating a response, affecting the **breadth and depth** of the answer.

> **Decision principle:** How many distinct *types* of information does this question require? More types → increase the count.
>
> **Note:** Retrieving more records increases both token consumption and response latency.

| Range   | Characteristics                                  | Best For                                                            |
| ------- | ------------------------------------------------ | ------------------------------------------------------------------- |
| 3 – 5   | Concise and focused, addresses the core question | Order inquiries, return processes, simple FAQs                      |
| 6 – 8   | Covers key aspects, moderately comprehensive     | Product recommendations, post-procedure care, service consultations |
| 10 – 15 | Broad retrieval, suited for complex questions    | Itinerary planning, policy comparisons, regulatory explanations     |

4\. Return to the previous page and click on **"Knowledge Base Management"** in the top-right corner

<figure><img src="/files/4C2icr4iyRwF9rUbrEgC" alt=""><figcaption></figcaption></figure>

Select **“Add Knowledge”** from the top-left corner.

<figure><img src="/files/32bwgv7zBAn4O50qGGd4" alt=""><figcaption></figcaption></figure>

There are various options for creating your knowledge base.

Below, we’ll walk you through setting up each type

**Option 1: Adding PDFs**

1. Enter a **name** for your knowledge base
2. Provide a **description** of the knowledge base
3. Upload your PDF files
4. Click **Save**

<figure><img src="/files/Te7pvdmffZNB3zo02j8H" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/yilWtvzrfYPIygfecymn" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="info" %}
Currently, you can upload up to 20 PDF files, with a maximum size of 20MB per file
{% endhint %}

**Option 2: Adding Webpages**

1. Enter a **name** for your knowledge base
2. Provide a **description** of the knowledge base
3. Paste the **URL** of the webpage
4. Click **Extract Content**

<figure><img src="/files/gB8as8zsRv17z7ll2djj" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/lJYfjKW5F8okV5cr9keR" alt="" width="563"><figcaption></figcaption></figure>

**Option 3: FAQ**

1. Enter a **name** for your knowledge base
2. Provide a **description** for the knowledge base
3. Select **FAQ**
4. Input the **questions**

<figure><img src="/files/jUkkHozvSM6Xo25zhviu" alt="" width="563"><figcaption></figcaption></figure>

<div align="left"><figure><img src="/files/iLPTEwlcUQT5IdNQWd2S" alt=""><figcaption></figcaption></figure> <figure><img src="/files/IGGDfvquWsRglXMPu7po" alt=""><figcaption></figcaption></figure></div>

**Option 4: Unanswered Question**

1. Enter a **name** for your knowledge base.
2. Provide a **description** for the knowledge base.
3. Select the **questions**.
4. Input the **answers**.

<figure><img src="/files/AU7AzDOOvTRb4CmjjeIr" alt="" width="563"><figcaption></figcaption></figure>

<div><figure><img src="/files/nPEsxI9zROOZhtt7YLF5" alt=""><figcaption></figcaption></figure> <figure><img src="/files/oU9SMwiP27KWJ8uzqxCw" alt=""><figcaption></figcaption></figure></div>

<figure><img src="/files/1DQI7zXkoxEa1ySz5Qdg" alt="" width="563"><figcaption></figcaption></figure>

**Option 5: Optimize Unhelpful Responses**

1. Enter the **name** of the knowledge base
2. Provide a **description** for the knowledge base
3. Select the **questions**
4. Input the **answers**

<figure><img src="/files/6snsCRBsxyt1H0ZpQRuV" alt="" width="563"><figcaption></figcaption></figure>

<div><figure><img src="/files/9aM2O0YzMRJfcKFLnRtA" alt="" width="563"><figcaption></figcaption></figure> <figure><img src="/files/hyibLLjqrdAdztfbN8Fu" alt="" width="563"><figcaption></figcaption></figure></div>

The GAI feature can be used across multiple platforms, including LINE, Messenger, Instagram, and your official website’s LiveChat!

After setting up GAI, let's take a look at how the user will operate:

1. First, enter the keyword to enter GAI mode: RAG
2. Start asking questions
3. The response will appear
4. Select "Helpful" or "Not Helpful"
5. End

<div><figure><img src="/files/zE0wWDWdZ4OSJe3jUmby" alt=""><figcaption></figcaption></figure> <figure><img src="/files/ZY8bCkyPsOSAqYQQUN5D" alt=""><figcaption></figcaption></figure> <figure><img src="/files/hesVcMpGnqAOGGVEx39M" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
The response after clicking "Helpful" and "Not Helpful" can be customized\~

Response Settings → Adjust the response when the bot is asked whether the response is helpful or not.
{% endhint %}

Register MantaGO now!!!


---

# 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://blog.mantago.cc/en/applications/gai.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.
