Slots

These docs are for version 1.x of Rasa Open Source.

User Guide

NLU

Core

Conversation Design

API Reference

Migrate from (beta)

Reference

Slots

Slots are your bot’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).

Most of the time, you want slots to influence how the dialogue progresses. There are different slot types for different behaviors.

For example, if your user has provided their home city, you might have a text slot called home_city. If the user asks for the weather, and you don’t know their home city, you will have to ask them for it. A text slot only tells Rasa Core whether the slot has a value. The specific value of a text slot (e.g. Bangalore or New York or Hong Kong) doesn’t make any difference.

If the value itself is important, use a categorical or a bool slot. There are also float, and list slots. If you just want to store some data, but don’t want it to affect the flow of the conversation, use an unfeaturized slot.

Example of slots in usage.

You can provide an initial value for a slot in your domain file:

slots:
  name:
    type: text
    initial_value: "human"

There are multiple ways that slots are set during a conversation:

Slot Types

  1. Text Slot: For user preferences where the existence of a value matters.
  2. Boolean Slot: For true/false settings.
  3. Categorical Slot: For options among a set of predefined values.
  4. Float Slot: For continuous values.
  5. List Slot: For a list of items.
  6. Unfeaturized Slot: For data that shouldn’t impact the dialogue flow.