<commit_before>:desc: Define intents, entities, slots and actions in Rasa to build contextual
       AI Assistants and chatbots using open source bot framework Rasa.

.. _domains:

Domains
=======

.. edit-link::

The ``Domain`` defines the universe in which your assistant operates.
It specifies the ``intents``, ``entities``, ``slots``, and ``actions``
your bot should know about. Optionally, it can also include ``responses``
for the things your bot can say.

.. contents::
   :local:


An example of a Domain
----------------------

As an example, the ``DefaultDomain`` has the following yaml definition:


.. literalinclude:: ../../rasa/cli/initial_project/domain.yml
   :language: yaml

**What does this mean?**

Your NLU model will define the ``intents`` and ``entities`` that you
need to include in the domain. The ``entities`` section lists all entities
extracted by any `entity extractor <_entity-extraction>`_ in your
NLU pipeline.

For example:

.. code-block:: yaml

         entities:
            - PERSON          # entity extracted by SpacyEntityExtractor
            - time            # entity extracted by DucklingHTTPExtractor
            - membership_type # custom entity extracted by CRFEntityExtractor
            - priority        # custom entity extracted by CRFEntityExtractor



:ref:`slots` hold information you want to keep track of during a conversation.
A categorical slot called ``risk_level`` would be
defined like this:
<commit_msg>Update docs/core/domains.rst<commit_after>:desc: Define intents, entities, slots and actions in Rasa to build contextual
       AI Assistants and chatbots using open source bot framework Rasa.

.. _domains:

Domains
=======

.. edit-link::

The ``Domain`` defines the universe in which your assistant operates.
It specifies the ``intents``, ``entities``, ``slots``, and ``actions``
your bot should know about. Optionally, it can also include ``responses``
for the things your bot can say.

.. contents::
   :local:


An example of a Domain
----------------------

As an example, the ``DefaultDomain`` has the following yaml definition:


.. literalinclude:: ../../rasa/cli/initial_project/domain.yml
   :language: yaml

**What does this mean?**

Your NLU model will define the ``intents`` and ``entities`` that you
need to include in the domain. The ``entities`` section lists all entities
extracted by any :ref:`entity extractor<entity-extraction>` in your
NLU pipeline.

For example:

.. code-block:: yaml

         entities:
            - PERSON          # entity extracted by SpacyEntityExtractor
            - time            # entity extracted by DucklingHTTPExtractor
            - membership_type # custom entity extracted by CRFEntityExtractor
            - priority        # custom entity extracted by CRFEntityExtractor



:ref:`slots` hold information you want to keep track of during a conversation.
A categorical slot called ``risk_level`` would be
defined like this:

{'fraction_non_alphanumeric': 0.10553104852392263, 'fraction_numerical': 0.0, 'mean_word_length': 3.140449438202247, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7518416', 'n_tokens_mistral': 789, 'n_tokens_neox': 757, 'n_words': 336}