Version: Latest

Policy Overview

Policies decide the next action in a conversation.

In Rasa, policies are the components responsible for dialogue management. In a CALM-based assistant, the FlowPolicy is responsible for executing your business logic. If you're building an NLU-based assistant, you can read about the relevant policies here.

Policies in CALM

Because the Dialogue Understanding component in CALM already accounts for the context of a conversation, the role of the dialogue manager is simpler than it is in an NLU-based assistant.

You can customize the policies your assistant uses by specifying the policies key in your project's config.yml. In most cases, the default configuration should meet your needs, customization is there for advanced use-cases.

There are different policies to choose from, and you can include multiple policies in a single configuration. Here's an example of what a list of policies might look like:

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

Action Selection

At every turn, each policy defined in your configuration gets a chance to predict a next action with a certain confidence level. A policy can also decide not to predict any action. The policy that predicts with the highest confidence decides the assistant's next action.

Maximum number of predictions

By default, your assistant can predict a maximum of 10 next actions after each user message. To update this value, you can set the environment variable MAX_NUMBER_OF_PREDICTIONS to the desired number of maximum predictions.