Entities hold pieces of information that have specific meaning. The advanced AI agent recognizes information as an entity and treats it in a particular way. You can add an entity to an AI agent by using a preset entity or by creating your own custom entity.
About entities
An entity represents information in a customer message that has a defined pattern, such as
an email address. In that example, email
is a preset entity. The
information is attached to the conversation session and is available for later use by the AI
agent.
- Sanitizing personally identifiable information (PII)
- Collecting and verifying a piece of information, such as an order number, so it can be used in a conversation flow
- Understanding and identifying product-specific descriptions in customer messages
After an entity is added, anything in customer messages that match the entity pattern can be identified and acted upon. For example, you might mask an email address with the placeholder <EMAIL>. Or you might ask for verification or security information, which can be sanitized before escalation. You can use the entity to validate that customer-entered information follows a format or is part of a list.
You can refer to this data later in the flow. For example, you can collect an email address from the user and save it to the conversation data for later use via conditional blocks and customer messages. You can then apply an action using the information.
It’s recommended that you organize the entities list so that the highest priority and least sensitive ones are at the top.
When using numbers to represent scenarios in a channel where the customer can't use buttons, such as WhatsApp, you can create multilingual entity lists, including typos of each of the number scenarios. These should be ordered towards the top of the lists as they represent the greatest sensitivity.
If you're using entity recognition of numbers in your scenarios, ensure they’re not confused with other entities or intent predictions. Therefore, check the most specific first, in case you want to include an intent predicted, such as "wait a moment," in that customer message. Then check for the numbers. Otherwise, if a user says "wait a second," it would trigger scenario one instead of the intent.
Adding a preset entity
- International bank account number (IBANs)
- Credit card
- United States Social Security number (SSN)
- Personal identity codes for various countries
To add a preset entity
- In AI agents - Advanced, in the top-right corner, use the AI agent drop-down field to select the AI agent you want to add the entity for.
- In the left sidebar, click Settings > Entities.Note: If you’re adding a preset entity for an AI agent with agentic AI, select Content > Entities instead.
- Click Add preset.
- Hover over the preset you want to add and click Add entity.
- Go back to the Entities page, click the options menu (
) in the upper-right corner, then select Reorder entities to change the order of the entities.
Creating a custom entity
You can create a custom entity in order to build one with your own set of rules.
To create a custom entity
- In AI agents - Advanced, in the top-right corner, use the AI agent drop-down field to select the AI agent you want to create the entity for.
- In the left sidebar, click Settings > Entities. Note: If you’re adding a preset entity for an AI agent with agentic AI, select Content > Entities instead.
- Select New entity.
- Enter a name and optional description for your custom entity.
The name can contain no spaces and alphanumeric characters only, in addition to underscores (_) and hyphens (-).
- Click Sanitize if you want the model to replace the detected custom information with a placeholder in order to protect PII.
- Select a Rule type and create the rule.
Types include the following options:
- Regular expression: Also known as RegEx, this is a text string that appears as part of a repetitive pattern. It should represent all the possible patterns, formats, and length of the information you want to identify. See RegEx reference for advanced AI agents.
- Expression list: A list of words to look for. For example, Berlin, Helsinki, Paris, Rome. You can implement partial words to identify a word as part of another word (such as "play" within "playing"), or whole words when the expression represents the whole word. Lemmatization recognizes when there are multiple ways to express the entity, such as "am," "are," "is," "was," "were," or "been" as the other forms of the verb "to be."
-
Synonym list: A list of word combinations provided in a CSV file. For
example, product types or product colors. This cannot be mixed with other rules. Use
the following example file format:
item1, "item1-synonym1, item1-synonym2, item1-synonym3, item1-synonym4" item2, "item2-synonym1, item2-synonym2, item2-synonym3, item2-synonym4" item3, "item3-synonym1, item3-synonym2, item3-synonym3, item3-synonym4"
- Select Case sensitive if the entity is case sensitive.
- For expression lists, select Whole words if the expression represents the entire word.
- Click Add rule to create additional rules as needed.
- Click Test and save.
The Validate rules pane opens.
- Enter sample text and click Test to make sure the entity is working as expected.
- Click Save.