Skip to main content

Entities

Entities are terms or objects that provide context for an intent (question category). An entity is the tool that lets you drill down to the options (values) you want your end user to choose from.

Values

Values are the options that derive from an entity. These choices dig further into specific information your AI Agent needs to resolve any issue. Values can also provide more context, allowing you to delve deeper into specific information.

Synonyms and Patterns

In the Entity | Value | Synonym/Pattern triad, synonyms and patterns represent the last layer.

Synonyms

You can use synonyms to declare different ways the user can refer to each value. The following table shows a possible implementation of an entity that uses synonyms.

Entity @payment_methods

ValuesTypeSynonyms/Patterns
cardSynonymvisa mastercard credit debit
bankSynonymbank transfer
webSynonymPayPal

Patterns

You can use patterns to control the way you ask for information. Patterns can be written in the form of regular expressions. Patterns have very specific structures like dates, telephone numbers, email addresses, credit card numbers, ZIP codes, and more.

The following table shows a possible implementation of an entity that uses patterns:

Entity @contact_info

ValuesTypeSynonyms/Patterns
e-mailPattern\S+@\S+
phonePattern\d{10}

Add a New Entity

  1. While in your AI Agent, click on the Entities tab.
  2. Click on the + icon and change the name and description of your entity.
  3. Add the entity values along with their synonyms or patterns.
Each value can contain either synonyms or patterns, not both.

Import an Entity

To import an entity, click on the import icon on the top right to select a local CSV file. The CSV file must have the following format:

  • Four columns with headers Entity, Type, Value, Synonyms/Patterns.
  • Optional: Under Entity, include the name of your imported entity.
  • Under Type, write either synonym or pattern.
  • Under Value, include the value of the entity.
  • Under Synonyms/Patterns, include the comma-separated synonyms or patterns.

Once you upload the file, the values with their synonyms and/or patterns are visible. Save to add the entity to your AI Agent.

You can also download an example CSV file containing an entity.

Troubleshooting

An entity can only take one value in an end user's sentence. This means that if a single sentence contains two or more values of an entity, only one of the values will be matched.

In the example below, the entity @payment_methods contains two values (card, cash). If the user's sentence contains both of those values, then only one value will be matched to the entity. More specifically, only the last value in the sentence will be matched to the entity. In this example, the entity @payment_methods only takes the value cash, since it is the last one referenced in the sentence.

In general, it is not good practice to anticipate that an entity will have multiple values in a user's sentence. If this is anticipated, you would need to create separate entities.

While you edit and try giving new names in Entities, you are allowed to use only alphanumeric or underscore characters.