> For the complete documentation index, see [llms.txt](https://docs.suvvy.ai/en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.suvvy.ai/en/main-settings/dopolnitelnye-nastroiki/user-variables.md).

# User variables

The "Custom Variables" option allows you to create one or more variables yourself. Creating variables can be useful when you need the bot to remember specific information that can be later transmitted, referenced, or used to generate correct responses.\
Variables allow you to reduce context and save tokens.

This option is located in the "**Additional Settings**" section.

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

There are 2 variable options available:

* **Fixed variables**
* **Dynamic variables**

Fixed variables allow you to create variables with a known data type. We choose them when we know in advance what information we need to collect from the user, and what type and format it should be. In other words, when data typing and validation are important. The data contained in such variables can be used to transfer data to another service via an API.

**Let's look at an example:**

The following information is required to correctly fill out the fields: name, date of birth, and email. The data format must be as follows: Name, 01/15/1990, <pochta@mail.ru>. We'll enter the variables name, birth\_date, and email, with the data type "String." In the instructions, we'll specify the format in which the data should be passed to the variables. "Ask the user for their name, date of birth, and email. The data must be passed in the following format: Name, 01/15/1990, <pochta@mail.ru>. If the information doesn't match the format, request it again, specifying the required format. Once the information is in the correct format, save it as a string in the variables set\_fields\_values(name, birth\_date, email) accordingly." If the user enters any information incorrectly, the bot will request it again to ensure that the correct information is passed in the correct type and format. The end service will then receive information that won't cause an error.

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

The user provides information in an incorrect format, the bot clarifies the format and asks to resend it:

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

Once the information is received in the correct format, it is validated and stored in variables:

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

**Dynamic variables** allow you to store any information, of any size. The information is always stored as a string; dynamic variables have no type definition. These variables can be used more flexibly. The neural network automatically determines the important information and defines the variable. We cannot pass this type of variable to other services. Dynamic variables allow for higher-quality generation by the bot. If necessary, we can specify the information to be stored.

**Let's look at an example:**

We need to store a user's goals for financial planning. We'll specify this in the instructions: "Ask the user for financial goals. Pass the financial goals to the memorize function. Use the financial goals to build a budget."

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

#### Fixed variables

To create a Fixed Variable, follow these steps:

{% stepper %}
{% step %}

### Step 1

To create one, click the "Add variable" button

<figure><img src="/files/RlV3VxB6ygolZinmUQRi" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Step 2

Then specify the variable name, description, and data type.

There are 4 types of variables:

* String - any information that should be interpreted by the system as text ("watermelon", "suvvy", "+79001234567")
* Integer - a whole number (1, 2, 5, -1)
* Integer or fractional - a whole number or fractional number (1, 1.0, 3.4, -1.2)
* Boolean - true or false (yes or no)

When choosing, carefully consider the type of information that will be contained in the variable.

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

In our example, we will select the "**Integer**" type.
{% endstep %}

{% step %}

### Step 3

After entering all parameters, click on the "Save" icon

<figure><img src="/files/fWdqAwVCj8lV7MdajySt" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

**Fixed variables are associated with a function**

```
set_fields_values
```

In the instructions, specify which data should be saved to which variable. It's best to specify the data type that will be saved to avoid confusion and to avoid passing numeric data as a "String" data type.&#x20;

For example: "Ask the user for their age and save the numeric data to the variable set\_fields\_values(age)"

#### Dynamic Variables

To enable **Dynamic Variables**, activate the corresponding switch. Specify the information you want to save in the instructions.

**Describe in detail** what exactly needs to be saved.

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

Once Dynamic Variables are enabled, an additional option will appear to **remove information from these variables when clearing**.

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

Dynamic variables are associated with a function

```
memorize
```

When **Dynamic Variables** are enabled, the neural network automatically decides which information to remember. However, if we need specific information to be saved, we can specify exactly what needs to be remembered. To do this, we add the phrase "Pass this information to the **memorize function**" to the instruction.

If necessary, we can retrieve information about variables. To do this, we request the following:\
"Return the information saved in the **memorize** function."

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