# Data Retention

You can create data retention rules to specify how long a customer's input is stored within Studio. Expiry lengths can vary from immediate to 30 Days, in addition to custom durations depending on your data rules.

A data retention rule can only be set when information is being captured from the customer and stored within either an entity or a variable, this will typically be within a flow.

{% hint style="info" %}
**Terminology -**&#x20;

**Entities** - An entity refers to pre-defined pieces of information that a chatbot extracts to understand and process in order to provide accurate responses and outcomes to a user. Think of an entity as a noun or keyword that the chatbot identifies within a user’s query, for example, if a user asks “What is the weather like in New York?”, the entity is “New York”, which represents the specific location the user is referring to.

**Variables** - A variable can be thought of as a flexible placeholder or container that holds a specific value or information needed to provide accurate and meaningful responses. They are used to remember and track important information that can change or be updated as the conversation progresses.
{% endhint %}

To set data retention rules for your Assistant, click on the Enhanced Features menu item and then the ‘Data Retention’ card. Enter or select from the dropdown the Entity or Variable where the information you wish to set the rule for.

<figure><img src="https://3188851580-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3elAnByAW96PMS7Npi2k%2Fuploads%2FlDQzzCxwmWG3VBGZr4xW%2Fdata%20retention.png?alt=media&#x26;token=d4db057d-0bb9-407f-a224-3dbbee47e2c0" alt=""><figcaption></figcaption></figure>

Then in the Expiry Period drop-down, select the time period for the information to be held in Studio before being deleted.

If you require a custom time period, select this option and enter the details.

Once you have finished, click on ‘Create Rule’.
