# AI chatbot

An AI assistant is a true breakthrough: now you can configure AI-powered chatbots to interact with your customers using ready-made roles and preconfigured functions.

<div data-with-frame="true"><figure><img src="/files/eKMmSdEL9WtHqRMi1oXO" alt="" width="375"><figcaption></figcaption></figure></div>

By configuring an AI-powered chatbot, you will be able to:

1. Create a consultant for all the services available at your branch.
2. Generate texts for newsletters and presentations: simply provide the chatbot with a task and key message, then enjoy the result.
3. Develop an online store using Google Sheets.
4. Book clients online directly into your CRM system.
5. Combine different AI assistants with various configurations.

{% hint style="success" %}
It responds and generates answers precisely based on your unique settings — a powerful tool fully customized to meet your exact needs and demands.

Just explain your task to the bot (as if it were human), relax and enjoy its work!
{% endhint %}

{% hint style="warning" %}

## Important

One message from the AI assistant is equivalent to **10 regular messages** in your funnel builder usage.
{% endhint %}

{% hint style="success" %}

## Please note

The AI assistant is multilingual and can communicate with clients in various languages. Please note that for languages other than its primary training set, the accuracy of syntax and spelling may vary.
{% endhint %}

{% hint style="danger" %}

## Attention

The system prioritizes funnel builder blocks above the AI assistant. All blocks in the funnel builder are executed prior to any AI assistant response, including blocks without conditional logic.
{% endhint %}

{% hint style="danger" %}

## Attention&#x20;

The testing interface is shared between the **AI Assistant** and the **chatbot builder**.

**Key behavior to understand:**

1. **Unified system:** The **AI Assistant** and **Chatbot builder** are not separate tools; they function together as a single, **unified chatbot**.
2. **Processing priority:** **Chatbot builder blocks always take precedence.** If you receive an unexpected message during testing, it is likely because a block in the Funnel Builder was triggered first.
3. **Troubleshooting step:** if the AI assistant behaves unexpectedly or sends messages that do not match its settings, always **check the Funnel Builder blocks first**, as they override the assistant's responses.
   {% endhint %}

{% hint style="warning" %}

## Please note

The AI assistant doesn't work in group chats.
{% endhint %}

## What are chatbot roles

Roles define the specific functional tasks and behavioral characteristics that the AI assistant is configured to perform and exhibit during user interactions.

<div data-with-frame="true"><figure><img src="/files/gF3mgl70zufiMQHh3a0V" alt="" width="563"><figcaption></figcaption></figure></div>

For your convenience, the MaviBot team has already configured several roles ready to use in your projects.

However, if these bots don’t fit your specific needs and you know how to work with AI, feel free to choose the **"No preset settings" option**.

If you need an AI chatbot tailored to a specific behavior model, you can choose from the following standard roles

### **Text-based responses assistant**

The model is strictly limited to the knowledge and information contained within its settings. It answers questions related only to the text embedded in its configuration.

<div data-with-frame="true"><figure><img src="/files/J71MYfhAl0uouWGHQeZE" alt="" width="563"><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="/files/ZuPIRU5zvdv7sQV8rS1F" alt="" width="375"><figcaption></figcaption></figure></div>

### **Universal assistant**&#x20;

This model has minimal restrictions on text generation, making it well-suited for tasks that require creativity, such as copywriting.

<div data-with-frame="true"><figure><img src="/files/FihwQGdnU4LEUcyUWr6p" alt=""><figcaption></figcaption></figure></div>

Video overview

{% embed url="<https://www.youtube.com/watch?v=DDleWZYuyR0>" %}

### **Sales assistant**

In this role, the bot can showcase products to clients, share details about available items, and—if configured—calculate the final cost.

<div data-with-frame="true"><figure><img src="/files/MRk6830uuyrVbqVwKKOl" alt=""><figcaption></figcaption></figure></div>

This model is built around the command **"Sell by any means."** It works especially well in combination with a table or the "bot knowledge" setting, making it ideal for dynamic product listings and price calculations.

а) create a table and add the necessary product details;

б) embed the values from your table into the bot’s knowledge using a function specifically designed for Google Sheets.

{% hint style="info" %}
Instructions on how to use [the Google Sheets](/chatbot/ai/google-sheets-for-ai-assistant.md) function or [the MaviBot table function](/chatbot/ai/tables.md) can be found in the section with the same name.&#x20;
{% endhint %}

### **Algorithm-based assistant**

This model requires a clear step-by-step action plan — similar to a structured bot built in a funnel constructor.&#x20;

**Configuring algorithm-based behavior and responses bot settings**

<div data-with-frame="true"><figure><img src="/files/imLtabaTdNDtBGvEj4Fq" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}

## **Please note**

Writing a custom algorithm is a time-intensive process that requires meticulous attention to detail.

If you need algorithmic logic for your AI assistant, we strongly recommend using a **pre-built chatbot template** from the funnel builder. You can then activate and customize it through the **AI assistant integration** function.
{% endhint %}

#### How to work with square brackets

Square brackets are used to let the model insert the necessary word at its own discretion. Primarily, the model will rely on information from the context and dialogue history.

Examples:

1. **Tell me more about \[product]**\
   In this example, the model will provide more details about the product mentioned in the dialogue. If no product is mentioned in the context or conversation, it will invent one.
2. **Help me write a letter to a \[friend/colleague/relative]**\
   Here, the slash is used so the model writes a universal letter that can be sent to anyone from the list.
3. **The response should not exceed \[30-50] words**\
   This sets boundaries for the model, limiting the length of its response.
4. **Tell me about \[city]**\
   **The model will generate text about a random city if no specific city has been mentioned before.**
5. **You are a seller in a shop. Your task is to sell the client a \[product/service]**\
   The bot will act like a sales manager and help sell the product.

Square brackets can also be used when writing an algorithm for the bot

### **Online booking assistant**

The assistant with the "Online booking" role automates client appointments by utilizing values embedded through variables and functions.

This bot is designed to work with Online booking system and uses a pre-configured booking branch to guide clients through available services, open dates, and time slots—while automatically creating appointments in the calendar section of Services.

<div data-with-frame="true"><figure><img src="/files/KowEVXGkyWkBVDB1SJM5" alt=""><figcaption></figcaption></figure></div>

### **RAG assistant** <a href="#rag-assistent" id="rag-assistent"></a>

The RAG assistant will be needed for working with documents to provide accurate answers based on your context.

<div data-with-frame="true"><figure><img src="/files/Bm2xoGtCYFShmqvhIheX" alt="" width="375"><figcaption></figcaption></figure></div>

Add files: FAQs, instructions, articles, or internal materials. The assistant uses them to find answers to users' questions.

<div data-with-frame="true"><figure><img src="/files/JVpV5YpTTMKnIUB5C9Na" alt="" width="563"><figcaption></figcaption></figure></div>

How it works:

* **Preliminary search:** Before answering, the assistant looks for the necessary information directly in the uploaded document.
* **Accurate answers:** Users receive answers directly from your materials.

### A chunk setup (for the RAG role)

A chunk is a block/fragment of a document.

<div data-with-frame="true"><figure><img src="/files/Ijxcf77AHTtqFaHZLHO1" alt="" width="563"><figcaption></figcaption></figure></div>

RAG splits a document into pieces (chunks), performs a preliminary search among these pieces, finds the piece(s) most similar to the original query, and adds only several chunks to the context instead of the entire document. There is a high probability that the needed answer will be found within the attached chunks.

**How the RAG role works:** the document is divided into pieces (chunks). By default, one chunk is approximately 500 characters.

The recommended size of a text fragment is from 1000 to 2000 characters (specified in the chunk size field).

Document splitting is done automatically, and it is better for the assistant if one piece contains a meaningful fragment: for example, one question and one answer from an FAQ, or one/two complete paragraphs of a document.

<div data-with-frame="true"><figure><img src="/files/umfDd4nzEcjnfIpbqmIU" alt="" width="563"><figcaption></figcaption></figure></div>

You can adjust these chunks after the automatic splitting through the interface: trim some, add information to others, delete some, or add completely new ones.

#### **How to set it up**

**Step 1:** Upload the document.

<div data-with-frame="true"><figure><img src="/files/2q7cC2rwMIN84jCGHBxA" alt="" width="563"><figcaption></figcaption></figure></div>

And, if needed, specify the chunk size and chunk overlap.

**Step 2:** Click "Upload document" (this will start processing your document and splitting it into pieces (chunks)).

<div data-with-frame="true"><figure><img src="/files/fgcmamM6MMeEoos9Zpb2" alt="" width="563"><figcaption></figcaption></figure></div>

**Step 3:** You can check the chunks: for example, if one piece of an answer is split mid-word, you can edit it.

<div data-with-frame="true"><figure><img src="/files/ntwhx9uugneNEI56e0eG" alt="" width="563"><figcaption></figcaption></figure></div>

After that, you can test the assistant in the chat window on the right.

{% hint style="warning" %}

#### **Important**

* You can delete any chunk (piece) in the assistant settings at any time.
* You can also add additional information without having to re-upload the entire document each time: simply upload a txt file and create chunks.
* You can replace outdated information directly within a chunk without uploading documents.
  {% endhint %}

{% hint style="info" %}
You can enter a phrase in the "Bot Knowledge" field, such as: "The names of documents are indicated in parentheses in the context; refer to them whenever possible." This way, the assistant will add in parentheses the name of the document where it found the information.
{% endhint %}

## Pre-configured settings

Pre-configured settings are predefined instructions that guide the chatbot's behavior.

<div data-with-frame="true"><figure><img src="/files/DIdUcp9kkgQl6ZXsM5cU" alt="" width="360"><figcaption></figcaption></figure></div>

**Buttons**\
This option is essential for creating buttons when the response requires choosing from multiple options. It works great for sales and online booking roles.

Example:

<div data-with-frame="true"><figure><img src="/files/vGciqO2uuEijerKwWzlW" alt="" width="375"><figcaption></figcaption></figure></div>

This option is also convenient for the client: they don’t need to type anything extra, as continuing the conversation simply requires selecting and clicking the button they’re interested in.

**Avoid discussing politics**\
The bot will remain silent or refuse to answer questions related to politics, religion, territorial claims, and other sensitive topics.

**Beautify responses**\
This feature enables the bot to use lists and neat formatting when replying to customer messages.

**Minimize creativity**\
This option helps limit the bot’s creative responses.

**Step-by-step data input**\
This feature collects user data step by step—for example, to create variables and pass them to the system (these variables can later be found in the customer’s profile).

This approach is used for processing orders and filling out forms that require step-by-step input of information.

{% hint style="info" %}
To create variables and correctly pass them to the system, please refer to the section "[Data transfer format.](#data-transfer-format)"
{% endhint %}

**Do not learn from messages**\
This option limits the impact of user messages on the bot, protecting it from attempts by malicious users to deliberately distort the prompt you have set.  &#x20;

## Trigger conditions

<div data-with-frame="true"><figure><img src="/files/V83ZAy06EPk4HiufWYVS" alt="" width="563"><figcaption></figcaption></figure></div>

You can configure trigger conditions by either manually entering variable values or by using the visual condition builder.

{% hint style="success" %}
What is this for?

You can configure multiple assistants to work within a single chatbot and switch between them using conditions. How to create two or more assistants and coordinate their work in one chat is explained below.
{% endhint %}

### Trigger builder

<div data-with-frame="true"><figure><img src="/files/zUwpnKghZnGqkbzXGDmh" alt=""><figcaption></figcaption></figure></div>

You can manually set variables with specific values and choose a comparison operator. The comparison operators are standard, just like in all MaviBot triggers: equal, not equal; greater than, greater than or equal to; less than, less than or equal to, respectively.

<figure><img src="/files/8TX8GgDrwVx5BzebWPVm" alt="" width="360"><figcaption></figcaption></figure>

The **"Bot selection" tab** contains bots connected to the project from various messengers, allowing you to choose which specific chatbot will execute the AI settings.

<div data-with-frame="true"><figure><img src="/files/HJGxYt9dGlZyjL1nHxfp" alt="" width="563"><figcaption></figcaption></figure></div>

It’s important to mention that within the builder, you can set triggers to operate only in the testing window for debugging purposes.

<div data-with-frame="true"><figure><img src="/files/UrsCwRFe5UgIIKHlPBy9" alt=""><figcaption></figcaption></figure></div>

To use this functionality, select the "Testing window" tab and click "Add trigger," then test your bot in the testing panel on the right.

<div data-with-frame="true"><figure><img src="/files/mHrS9LZJ3HiE4lte5nbS" alt=""><figcaption></figcaption></figure></div>

This helps prevent awkward situations where a client messages your bot during your debugging, and the AI responds instead of you.

## Bot settings

<div data-with-frame="true"><figure><img src="/files/W1j8TCZzmEnkHE4gvi8v" alt=""><figcaption></figcaption></figure></div>

In this field, you need to specify:

1. The role the bot should take on;
2. How it should behave;
3. What actions you expect from it.

Settings should be written as requests to a person. For example:

*"You are a support specialist who knows only the information provided to you in the context. Your task is to answer users' questions. You should be proactive and friendly."*

{% hint style="success" %}
If the model doesn’t follow instructions correctly, you can add example questions and answers to clarify:\
\&#xNAN;*"You should not respond to meaningless messages unrelated to the context. Here are a couple of examples:*\
*Context — a hare is a fluffy mammal*\
*Question — Hello*\
*Answer — I don’t know the answer to your question.*\
*Context — Coal is extracted from a mine*\
*Question — Turn off the water*\
*Answer — I don’t know the answer to your question."*
{% endhint %}

If you’ve configured the bot to respond to certain messages but set the same conditions in a funnel builder block, the funnel builder block will have priority!

This happens because funnel builder blocks have higher priority than the assistant’s settings.

{% hint style="danger" %}

## Important

The AI assistant has **lower processing priority** than blocks in the Funnel Builder. **Funnel Builder blocks are always executed first.**

**Key behavior:**

* Blocks such as **"Trigger," "Start,"** or **"Fallback"** will execute **even if they have no conditions**, taking precedence over the AI assistant.
* Only after the relevant Funnel Builder blocks have been processed will the client proceed through the configured chatbot flow.
* The **AI assistant engages afterward**, based on the resulting state of the conversation.
  {% endhint %}

Example:

You have specified certain words/phrases in the block’s triggers:

<div data-with-frame="true"><figure><img src="/files/eAFz1yHgVLLKxFV3CrbD" alt=""><figcaption></figcaption></figure></div>

You have also set triggers in the assistant’s settings:

<div data-with-frame="true"><figure><img src="/files/j3DuDi8i7QR3fmQO5L2m" alt=""><figcaption></figcaption></figure></div>

The AI assistant operates as a complementary layer within your existing chatbot funnels.

**How It Works:**

1. **Primary Flow:** The funnel builder's configured blocks are always executed first according to their logic and priority.
2. **AI Assistant's Role:** The assistant activates to handle cases **not covered** by the predefined funnel conditions. It responds to client questions that fall outside the main flow.

**Key Benefit:**\
This integration ensures all client inquiries are addressed, enhancing user satisfaction and fostering greater loyalty.

## Bot knowledge

The underlying AI model is trained on a broad, general dataset from the internet. While powerful, it lacks specific knowledge about **your unique project details**, such as:

* Your brand's product catalog
* Your specific service offerings
* Your internal policies or procedures

**Why this field is essential:**

<div data-with-frame="true"><figure><img src="/files/D1rZZwkiAUyFhnpmlW2A" alt=""><figcaption></figcaption></figure></div>

{% hint style="success" %}
By providing a brief description of your products or services, you enable the bot to promote them in a more engaging, vivid, and effective way.
{% endhint %}

In this field, you need to provide the main information about your product that the bot will rely on when responding. You can either write this as text or use a variable.

<div data-with-frame="true"><figure><img src="/files/wLDm48JHd8Vm2Lho5Asl" alt="" width="438"><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="/files/ZD8WyBxvhIIejH3qhxV8" alt="" width="563"><figcaption></figcaption></figure></div>

When using a variable, the funnel builder block specifies the data that the bot should know:

<div data-with-frame="true"><figure><img src="/files/GH4GjiVD80qKjyA8KnhB" alt="" width="498"><figcaption></figcaption></figure></div>

The example above shows the range of services configured in the corresponding "[Bookings](/booking/settings.md)" section.

<figure><img src="/files/eKMmSdEL9WtHqRMi1oXO" alt="" width="375"><figcaption></figcaption></figure>

<div data-with-frame="true"><figure><img src="/files/scubXF6FfBR4YxFq9JBl" alt=""><figcaption></figcaption></figure></div>

{% hint style="success" %}
You can also feed the bot knowledge with values specified in a Google Sheet—for example, for an online store.

The AI understands the data from the table perfectly and uses it in its responses.

For more details, see the section "[Working with Google Sheets](/chatbot/ai/google-sheets-for-ai-assistant.md)."
{% endhint %}

## Data transfer format

In the data transfer format, you specify the actual data being collected (for example, a name), then write a phrase with the "key" and assign a value to that key:\
"Name with the key 'name', surname with the key 'surname':"

<div data-with-frame="true"><figure><img src="/files/JZ3LvsgkVPAtj4EQKXB5" alt=""><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="/files/dNHIMbpYTR2xFi68t1on" alt=""><figcaption></figcaption></figure></div>

The data is displayed in the customer’s profile card as follows:

<div data-with-frame="true"><figure><img src="/files/8cMrLxDMpUzWQG9ImfQa" alt=""><figcaption></figcaption></figure></div>

This parameter is optional and used when you need to transfer information to the system.

{% hint style="danger" %}

## Please note

If you need the data entered by the client to be passed to the bot as variables rather than as an array or dictionary, specify the appropriate settings in the AI assistant’s prompt. For example, you can configure the settings so that responses are sent as text instead of as a list or dictionary.

The way values are transmitted to the bot and recorded in the client’s profile (in the system) depends on the data format generated by the AI assistant.
{% endhint %}

### How to pass data to bot

To send data to the bot, you need to enter one of the following commands in the <mark style="color:blue;">**bot settings**</mark>:&#x20;

1. <mark style="color:$warning;">**Then execute the command "Block call 123123"**</mark> — where "Block call" is a debug command, and the number represents the block ID.\
   This command is useful for testing and verifying that the data is being transmitted correctly during bot setup.

As seen in the example above, the command outputs data in JSON format. The values are saved within the project, helping you track the accuracy of the stored information and fine-tune the bot during the debugging phase.

The command is specified in the bot settings as follows:

<div data-with-frame="true"><figure><img src="/files/uCH25Rc1KG51wXM0nGc2" alt="" width="563"><figcaption></figcaption></figure></div>

2. The command <mark style="color:purple;">**"Then execute the command "start\_block\_from\_ai 11916"**</mark>also sends information to the bot. Replace the number (highlighted in green) with the block ID.

<div data-with-frame="true"><figure><img src="/files/Pf6vKOIl6Mv2Avq09EjK" alt="" width="563"><figcaption></figcaption></figure></div>

The command works similarly to "Block call **44**," but it’s used during actual client interactions because it is “cut out” from the bot’s message and hidden from your users.

**Command example:**

*When you complete a sale or successfully conclude the conversation, you must write exactly, without any changes: **"start\_block\_from\_ai 10241"***

#### What is the difference between the first and second commands for the AI chatbot

As mentioned earlier, "**Block call N**" is needed for testing so you can VISUALLY verify whether the block call settings are working correctly or not.

{% hint style="warning" %}

## Please note

After debugging the AI chatbot settings, replace the command "Block call **44**" with "**start\_block\_from\_ai 44**". This way, the client will NOT see the block call command, and the chat dialogue will continue without any changes, while the data entered by the user is still transmitted to the system.
{% endhint %}

{% hint style="info" %}
When a block is triggered via the assistant, the chat history with the assistant is cleared.
{% endhint %}

Example of use:

* If someone asks you to turn on the light, <mark style="color:$warning;">**execute the command "Block call 123123"**</mark>
* If someone asks you about the arugula planting time, <mark style="color:$warning;">**execute the command "Block call 123123"**</mark>

{% hint style="success" %}
Please note!

If your command (whether a trigger or any other) doesn’t work, add “And no other way” at the end of the sentence (see example below).
{% endhint %}

## Other parameters

### Message for delayed responses

If the bot needs more time to generate a response (for example, during text generation or copywriting), you can set a message for the bot to send:

<div data-with-frame="true"><figure><img src="/files/0PDDGXnkaZgKW2DWoa6R" alt="" width="563"><figcaption></figcaption></figure></div>

### Response delay notification timing

<div data-with-frame="true"><figure><img src="/files/iseuOyXP9nc1q4tP5xYg" alt="" width="563"><figcaption></figcaption></figure></div>

This field, which accepts a numeric value, is related to the previous setting: it defines the delay after which a message about the delayed response is sent.

It accepts a numerical value in seconds, ranging from 2 to 25.

### **Model creativity**

This is a key parameter that reveals the model’s creative potential and enables it to generate original ideas that go beyond its training.

<div data-with-frame="true"><figure><img src="/files/cJHpxiA56ST3JHgcZBg0" alt="" width="428"><figcaption></figcaption></figure></div>

The parameter is set to a value between 0.0 and 1 (e.g., 0.1, 0.2, etc.).

{% hint style="success" %}
For tasks that require reliance on text and accurate answers, it is preferable to set values close to zero, as this prevents the model from misleading your clients. <br>

In contrast, for creative tasks where imagination is not an issue, a value close to 0.9 is recommended.
{% endhint %}

{% hint style="success" %}
If you're unsure what value to set for the assistant role you've chosen, simply leave the field blank — each role has optimal default values already configured.
{% endhint %}

### Maximum word count

<div data-with-frame="true"><figure><img src="/files/dLwTc4LUuox9TTeMMn9V" alt="" width="378"><figcaption></figcaption></figure></div>

This field, accepting only numerical values, sets the maximum number of words for the chatbot’s response.

Such a limit is especially useful for messengers where the number of characters per message is strictly restricted, as it prevents the AI bot from being cut off mid-sentence and helps deliver the most precise and concise answer within the message.

{% hint style="warning" %}
Character limits in messengers:

* Telegram – **4096** characters
* Instagram – **1000** characters
* WhatsApp – **4096** characters
* Viber – **1000** characters
  {% endhint %}

## About useful advice

### Token limit

The model accepts up to **128,000** tokens as input, where one token is roughly equivalent to two characters.

### Preventing user misinformation

If the model misleads clients by mentioning non-existent services or products, you can enable the "Minimize fantasies" option and also try reducing the model’s creativity.

### How to make the AI Assistant stay silent

Enter the following command text into the bot’s settings field:

"If someone asks you about \_\_\_\_\_\_\_, you must respond that you don’t know the answer.\
If someone asks you about events you are unaware of, you must respond that you don’t know the answer."

Example:

<div data-with-frame="true"><figure><img src="/files/ol5MXiIsOEyYQ2qvkorC" alt=""><figcaption></figcaption></figure></div>

{% hint style="warning" %}

## Please note

The bot remembers the chat history.

If you change its settings, it’s recommended to delete the current conversation and start a new one. Otherwise, the bot will continue responding based on previous messages, as the chat history takes priority over new settings.
{% endhint %}


---

# 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.mavibot.ai/chatbot/ai/assistant.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.
