Chitchat or rules not working after a slot was set

Hi, I have a problem with chitchat and rules after a slot was set. I am using rasa 2.8.14 and I had the problem also with previous versions and also with rasa 3.0.

More detailed description of the problem: I want to create a chatbot which gives the user information about the address and requirements depends on the the1 vehicle_type. And also chitchat should be possible. So when I start a conversation chitchat is working fine. There is no problem.

When I start with a question for the requirementse.g. and the slot was set to bike, the answer is correct. But when I asking after that chichat the bot ignores the chitchat and gaves a wrong answer (no utter_chitchat). I used the debug mode, and the nlu detects the intent correct in all cases, but the core ignores the rules.

I am confused because at rasa docs there was the following informations. And on my point of view it contradicts.

Now, your assistant should be able to respond correctly and consistently to FAQs or chitchat, even if these interjections happen while your assistant is helping the user with another task.

If I use influence_conversation: false for the vehicle_type chitchat is working fine every time, but than I didn’t get the right answer depending on the entity/slot value.

Details from rules and the domain file, I also used stories

# rules
version: "2.0"
- rule: always_greet_nameless
  - slot_was_set:
    - user_name: null
  - intent: phrase_greeting
  - action: utter_phrase_greeting

- rule: always_greet_withname
  - slot_was_set:
    - user_name: true
  - intent: phrase_greeting
  - action: utter_phrase_greeting_name

- rule: respond_to_chitchat
  - intent: chitchat
  - action: utter_chitchat

# domain
- address
- requirements
- phrase_greeting
- chitchat

- user_name
- vehicle_type 

    type: text
  vehicle_type :
    type: categorical
    #influence_conversation: false
    initial_value: car
    - car
    - bike
    - scooter

  - text: You need xxx.
  - text: You need yyy.
  - text: You need zzz.
  - text: The address is xxx.
  - text: The address is yyy.
  - text: The address is zzz.
  - text: Hello.
  - text: Hello {user_name}
  - text: I am fine. 
  - text: I am a bot.

Leave influence_conversation: false and use a form to hande the requirements intent.

1 Like

Hi, I solved it on another way. I added the chitchat to the stories. I wrote some stories where chitchat is inside. But I’m a bit confused, that it works on that way, because on rasa docs there are no informations about adding chichat to the stories.

influence_conversation: false of slot1 helped for the case with a rule and condition

  • rule: rule 1 condition:
    • slot_was_set: slot1

is it also relevant in the case of steps within a rule? steps: - or: - intent: inform_measurement entities: - slot1: 1

Hi there Julia! I’m having the same problem with my rules after a slot was set. Did you understand why this is happening? Checking the debug logs, it seems that there is no rule to apply (I didn’t figure out why it don’t find the right rule only after the slot was set).

For me, the solution was to duplicate rules by adding a condition statement with the two options of the boolean slot:

- rule: rule greet 1
  - slot_was_set:
    - my_bool_slot: true
  - intent: greet
  - action: utter_greet

- rule: rule greet 2
  - slot_was_set:
    - my_bool_slot: false
  - intent: greet
  - action: utter_greet

Adding the rules to the stories works fine too. I would like to understand why this is happening though.

I’m using rasa 2.8 and the default policies pipeline.


1 Like

Hi Andrés, thanks for your answer. Interesting to hear that others have these problems too. Unfortunately I don’t understand why this happend. I saw the same in the debug logs, and it was very confusing.

Thanks for our solution :slight_smile: hopefully we can help some other people with this issue.

I also found another solution. For my use case it was possible to use conditional responses like descriped in

1 Like

Hi Andrés, How does your intent list in the domain.yml look like?

Like this:

- chitchat
- faq

or like that:

- chitchat:
    is_retrieval_intent: true
- faq:
    is_retrieval_intent: true

I never saw it with is_retrieval_intent: true. I took a look in the domain file after I did some interactive learning and saw it. I could not found it in the documentation. But maybe this could also solve the probleme. I did not try it because I use the conditional responses at the moment.

Hi Julia,

I’ve tried the is_retrieval_intent configuration, but it didn’t solve the problem. I get the following error when testing the affected intents:

ERROR    rasa.core.actions.action  - Couldn't create message for response 'utter_None'.

Maybe is something you already know, but I noticed that the rules only fail if the slot is set in a custom action. I mean that you can create a slot, with an initial value, and use that slot to influence the conversation without problems. Once the slot is set in a custom action, the response predictions starts to fail.

Thanks for your reply!