> For the complete documentation index, see [llms.txt](https://docs.chatlayer.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chatlayer.ai/nlp/natural-language-processing-nlp/detect-information-with-entities.md).

# Detect information with entities

Chatlayer has 4 types of entities: match, contextual, system, and composite.

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="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&amp;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 ](/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="/nlp/natural-language-processing-nlp/detect-information-with-entities/match-entities.md">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="/nlp/natural-language-processing-nlp/detect-information-with-entities/contextual-entities.md">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="/nlp/natural-language-processing-nlp/detect-information-with-entities/composite-entities.md">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="/nlp/natural-language-processing-nlp/detect-information-with-entities/system-entities.md">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&amp;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 %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
