---
title: "Entities"
description: "Define entities with values, synonyms, and patterns so that an AI agent can capture specific details from user messages."
---

# Entities

> Define entities with values, synonyms, and patterns so that an AI agent can capture specific details from user messages.

Entities are terms or objects that provide context for an [intent](https://docs.moveo.ai/docs/ai-agents/intents.md)
(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

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`**

|  Values  |  Type   |          Synonyms/Patterns           |
| :------: | :-----: | :----------------------------------: |
| **card** | Synonym | `visa` `mastercard` `credit` `debit` |
| **bank** | Synonym |           `bank transfer`            |
| **web**  | Synonym |               `PayPal`               |

### Patterns

Patterns control the way information is captured. Patterns are written in the form
of [regular expressions](https://en.wikipedia.org/wiki/Regular_expression) with 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`**

|   Values   |  Type   | Synonyms/Patterns |
| :--------: | :-----: | :---------------: |
| **e-mail** | Pattern |     `\S+@\S+`     |
| **phone**  | Pattern |     `\d{10}`      |

## Add a new entity

1. While in your AI agent, open the **Workflows** tab and click **Entities**.
2. Click **Create entity** and change the name and description of your entity.
3. Add the entity values along with their synonyms or patterns.

:::note
Each value can contain either synonyms or patterns, not both.
:::

## Import an entity

To import an entity, open the menu on the top right and select **Import** to choose 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.

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, the entity matches only **one** of the values.

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

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

**Entity**

**Dialog**

**Chat**

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

## Next steps

- [Intents](https://docs.moveo.ai/docs/ai-agents/intents.md)
- [Dialogs](https://docs.moveo.ai/docs/ai-agents/dialogs.md)
- [Context and variables](https://docs.moveo.ai/docs/ai-agents/context.md)
