# 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](/navigation/settings/secure-variables-gdpr.md), which means that you can re-use that piece of information later.

Access your entities under the [**Entities**](/navigation/natural-language-processing-nlp/synonym-entities.md) tab.

<figure><img src="/files/V5BLPMm4Ft2lOkCQaF7V" 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 ](/nlp/natural-language-processing-nlp/train-your-nlp.md)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="/pages/xLctKX8kVf7oyDHUaInb">/pages/xLctKX8kVf7oyDHUaInb</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="/pages/4LAOIk9zx808igd5k2ob">/pages/4LAOIk9zx808igd5k2ob</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="/pages/Cmp0Z5k8phsww7xMDtnp">/pages/Cmp0Z5k8phsww7xMDtnp</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="/pages/o1Q5kUhIuEOvOKERe1cW">/pages/o1Q5kUhIuEOvOKERe1cW</a></td></tr></tbody></table>

## How to choose an entity

<figure><img src="/files/FGMLnRxvoY0WDWeQpYnk" 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chatlayer.ai/nlp/natural-language-processing-nlp/detect-information-with-entities.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
