Skip to main content

Configuring Your Assistant

By default, running rasa init will still create an NLU-based assistant. To create a CALM assistant, use:

rasa init --template calm

This command initializes a project with the recommended defaults for a CALM assistant, including the right pipeline and policies in config.yml. If you need to migrate from an older NLU-based assistant, refer to our Migrating from NLU guide.

Configuration File

The CALM assistant’s configuration file (config.yml) defines which components, policies, and language settings your bot will use. Below is the minimal configuration required to run a CALM assistant:

config.yml
recipe: default.v1
language: en

pipeline:
- name: SingleStepLLMCommandGenerator

policies:
- name: FlowPolicy

Key Properties

  • recipe: Specifies the graph recipe. In most cases, keep this as default.v1. For more information on the Graph Recipe, head over to Graph Recipe reference
  • language: A two-letter ISO code for the assistant’s language.

Pipeline

The pipeline section lists the components that process the latest user message and produce commands for the conversation. For example:

config.yml
# ...
pipeline:
- name: SingleStepLLMCommandGenerator
llm:
model_group: openai_llm
flow_retrieval:
embeddings:
model_group: openai_embeddings
user_input:
max_characters: 420
# ...

In this example:

  • SingleStepLLMCommandGenerator uses an LLM to parse the conversation context and generate the next commands.
  • Other pipeline components can be included before or after this if you need additional functionality (e.g., combining classic NLU with LLM).

Policies

The policies section specifies which dialogue policies are used to decide what action the assistant should take. For CALM, you typically need at least the FlowPolicy:

config.yml
# ...
policies:
- name: FlowPolicy

The FlowPolicy does not require additional configuration. It tracks the conversation state as a stack of executed flows, combines it with the commands extracted from the user message to pick the next best action for the system to execute.

Advanced configuration

For detailed information on additional configuration parameters in your config.yml, head over to Configuration reference.

Configuring Domain

In Rasa, the domain defines the “universe” your assistant operates in. It typically includes:

  • Responses: Templated messages the assistant can send.
  • Slots: Key pieces of information the assistant remembers.
  • Custom Actions: Code that runs any extra logic or service calls.
  • Session Configuration: Defines how conversations “reset” after inactivity.
domain.yml
version: "3.1"

session_config:
session_expiration_time: 60 # value in minutes, 0 means no timeout
carry_over_slots_to_new_session: true

responses:
utter_greeting:
- text: "Hello! How can I help you today?"

slots:
user_name:
type: text
initial_value: null

actions:
- action_greet_user

Multiple Domain Files

If you have a large assistant, you can split your domain across multiple YAML files in a directory. Rasa will automatically merge them during training:

rasa train --domain path_to_domain_directory

Session Configuration

You can define how conversations “reset” after inactivity using session_config:

  • session_expiration_time: Time (in minutes) of user inactivity after which a new session is started.
  • carry_over_slots_to_new_session: Whether to keep slot values when a new session starts.

Custom Actions

If your assistant uses custom actions, add them under actions: in the domain.

Advanced Configuration

For advanced configuration—such as selectively sending the domain to particular custom actions—refer to the domain reference.

Further Reading