# Detect information with entities

Entities are pieces of information that can be extracted from something that the user says.

When an entity is detected, it is saved as a [variable](https://docs.chatlayer.ai/navigation/settings/secure-variables-gdpr), which means that you can re-use that piece of information later.

Access your entities under the [**Entities**](https://docs.chatlayer.ai/navigation/natural-language-processing-nlp/synonym-entities) tab.

<figure><img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FmScejyLUyMvIOhXRHC9A%2FScreenshot%202024-08-23%20at%2011.31.51.png?alt=media&#x26;token=9f0d155f-ae79-4dec-8b1c-beb7cefc0393" alt=""><figcaption><p>Detect information from what the user says by using entities.</p></figcaption></figure>

{% hint style="info" %}
On Chatlayer text fields, entities are noted with an`@`sign in front of them.
{% endhint %}

{% hint style="warning" %}
All entities are only detected after you've [trained your NLP ](https://docs.chatlayer.ai/nlp/natural-language-processing-nlp/train-your-nlp)at least once. Every time you change, add, or delete an entity, you should train the NLP again.
{% endhint %}

## Entity types

Chatlayer offers 4 types of entities;

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Match entities</strong></td><td><p>If the user states something that is part of a predefined list or matches a certain pattern, it will be detected as a match entity.</p><p><br>E.g.: <em>I want to know more about the Premium pack</em> → <code>@product</code>: Premium<br></p></td><td></td><td><a href="detect-information-with-entities/match-entities">match-entities</a></td></tr><tr><td><strong>Contextual entities</strong></td><td><p>Train your NLP so it can recognise entities that depend on the context of an expression.</p><p><br>E.g.: <em>Book a train ticket from Brussels to Amsterdam</em> → <code>@origin</code>: Brussels, <code>@destination</code>: Amsterdam</p></td><td></td><td><a href="detect-information-with-entities/contextual-entities">contextual-entities</a></td></tr><tr><td><strong>Composite entities</strong></td><td><p>A combination of different, but related entities.</p><p><br>E.g.: <em>Two fries please</em> → <code>@order</code> consists of <code>@sys.number</code> (2) and <code>@foodItem</code> (fries)</p></td><td></td><td><a href="detect-information-with-entities/composite-entities">composite-entities</a></td></tr><tr><td><strong>System entities</strong></td><td><p>Entities that are pre-built on Chatlayer and that match a certain widely used pattern, like email or phone number.</p><p><br><em>E.g.: My email address is ilovebots@chatlayer.ai</em> → <code>@sys.email</code>: ilovebots@chatlayer.ai</p></td><td></td><td><a href="detect-information-with-entities/system-entities">system-entities</a></td></tr></tbody></table>

## How to choose an entity

<figure><img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FE6H3Hv8YA5UKc7OeWJXO%2FScreenshot%202024-08-23%20at%2011.16.48.png?alt=media&#x26;token=2cce5708-391a-4402-abfb-1dc076912417" alt=""><figcaption><p>Decision tree on when to use which entities.</p></figcaption></figure>

{% hint style="warning" %}
**Entities should only be used if their value is needed in bot conversations**. For example, if your bot helps users find information about a specific product, you should use entities to get the product name for database queries. However, if your bot merely redirects users to a webpage with all products, entities are unnecessary.
{% endhint %}
