domain defines the universe in which your assistant operates.
Specifically, it lists:
- The
responsesthat can be used as templated messages to send to a user. - The custom
actionsthat can be predicted by dialogue policies. - The
slotsthat act as your assistant’s memory throughout a conversation. - Session configuration parameters including inactivity timeout.
Multiple Domain Files
The domain can be defined as a single YAML file or split across multiple files in a directory. When split across multiple files, the domain contents will be read and automatically merged together. You can also manage your responses, slots, custom actions in Rasa Studio. Using the command line interface, you can train a model with split domain files by running:Responses
Responses are templated messages that your assistant can send to your user. Responses can contain rich content like buttons, images, and custom json payloads. Every response is also an action, meaning that it can be used directly in anaction step in a flow.
Responses can be defined directly in the domain file under the responses key.
For more information on responses and how to define them,
see Responses.
Actions
Actions are the things your bot can do. For example, an action could:- respond to a user,
- make an external API call,
- query a database, or
- just about anything!
Slots
Slots are your assistant’s memory. They act as a key-value store which can be used to store information the user provided (e.g. their home city) as well as information gathered about the outside world (e.g. the result of a database query). Check out the Slots reference for more information.Session configuration
A conversation session represents the dialogue between the assistant and the user. Conversation sessions can begin in three ways:- the user begins the conversation with the assistant,
- the user sends their first message after a configurable period of inactivity, or
- a manual session start is triggered with the
/session_startintent message.
session_config key.
Available parameters are:
session_expiration_timedefines the time of inactivity in minutes after which a new session will begin.carry_over_slots_to_new_sessiondetermines whether existing set slots should be carried over to new sessions.start_session_after_expiry(new in 3.16, defaulttrue) determines whetheraction_session_startruns when the next user message arrives after the session timer fires. Whenfalse, slots are preserved without a session boundary. See Session Timer.
session_expiration_time to 0 means
that sessions will not end (note that the action_session_start action will still
be triggered at the very beginning of conversations).
A session start triggers the default action
action_session_start. Its default
implementation moves all existing slots into the new session. Note that all
conversations begin with an action_session_start. Overriding this action could
for instance be used to initialize the tracker with slots from an external API
call, or to start the conversation with a bot message. The docs on
Customizing the session start action shows you how to do that.Select which actions should receive domain
New in 3.4.3You can control if an action should receive a domain or not.
action_endpoint in endpoints.yml.
endpoints.yml
{send_domain: true} to custom action in the list
of actions in domain.yml:
domain.yml