User messages duplication

Only a single instance of rasa can be running on a port: rasa shell or rasa x or rasa run. You can use either of them if the others are not already running.

Rasa X is just the interactive version for Rasa. All the files in your rasa directory will contain exactly what you have added in the rasa x interactive shell. The commands for rasa are also true for rasa x which means the debug will be common, in most of the cases.

I see, but I think that with Rasa X installed on a server with Integrated Version control things work differently, cause all my files are saved in a GitHub repository which is synchronized with Rasa X. Without Rasa X I don’t know how to access that files… just running rasa shell doesn’t work

Hi @tiziano! Awesome to see that you are using Rasa X to improve your assistant. @varunsapre10 is right that the best way to debug output is to use rasa run --debug.

As we talk about in this section of the Rasa X docs about improving an assistant, when improving your assistant, there are some things you should do on the Rasa X server and other things you should do on your local machine.

Because you are using Integrated Version Control, you should be able to just clone the most up to date version of your assistant locally from whatever solution you are using to manage your Git repo (e.g. GitHub, GitLab, Bitbucket, etc). The branch-based workflows enabled by Git even will let you continue to annotate data in Rasa X, while also making changes to it in your favorite text editor or IDE. You can read more about this in the most recent blog post on Integrated Version Control.

The point is that I’m not using a local machine, I’m running Rasa X on a server…

Ofcourse rasa x runs on a server. @tiziano Here the local machine means the localhost of the system you are working on. As @tyd says, you should try improving it on the localhost(rasa shell) and then to check it, try rasa x. Please correct me if i’m wrong.

Well, then I have some problems on my rasa setting, since I’m not able to run any of the rasa commands.

When I try to run rasa shell this is what I get:

Traceback (most recent call last):
  File "/usr/local/bin/rasa", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/rasa/__main__.py", line 76, in main
    cmdline_arguments.func(cmdline_arguments)
  File "/usr/local/lib/python3.6/dist-packages/rasa/cli/shell.py", line 101, in shell
    rasa.cli.run.run(args)
  File "/usr/local/lib/python3.6/dist-packages/rasa/cli/run.py", line 99, in run
    endpoints = AvailableEndpoints.read_endpoints(args.endpoints)
  File "/usr/local/lib/python3.6/dist-packages/rasa/core/utils.py", line 390, in read_endpoints
    nlg = read_endpoint_config(endpoint_file, endpoint_type="nlg")
  File "/usr/local/lib/python3.6/dist-packages/rasa/utils/endpoints.py", line 26, in read_endpoint_config
    content = rasa.utils.io.read_config_file(filename)
  File "/usr/local/lib/python3.6/dist-packages/rasa/utils/io.py", line 166, in read_config_file
    content = read_yaml(read_file(filename))
  File "/usr/local/lib/python3.6/dist-packages/rasa/utils/io.py", line 117, in read_yaml
    return yaml_parser.load(content) or {}
  File "/usr/local/lib/python3.6/dist-packages/ruamel/yaml/main.py", line 331, in load
    return constructor.get_single_data()
  File "/usr/local/lib/python3.6/dist-packages/ruamel/yaml/constructor.py", line 111, in get_single_data
    return self.construct_document(node)
  File "/usr/local/lib/python3.6/dist-packages/ruamel/yaml/constructor.py", line 121, in construct_document
    for _dummy in generator:
  File "/usr/local/lib/python3.6/dist-packages/ruamel/yaml/constructor.py", line 713, in construct_yaml_map
    value = self.construct_mapping(node)
  File "/usr/local/lib/python3.6/dist-packages/ruamel/yaml/constructor.py", line 430, in construct_mapping
    return BaseConstructor.construct_mapping(self, node, deep=deep)
  File "/usr/local/lib/python3.6/dist-packages/ruamel/yaml/constructor.py", line 245, in construct_mapping
    value = self.construct_object(value_node, deep=deep)
  File "/usr/local/lib/python3.6/dist-packages/ruamel/yaml/constructor.py", line 167, in construct_object
    data = constructor(self, node)
  File "/usr/local/lib/python3.6/dist-packages/rasa/utils/io.py", line 94, in env_var_constructor
    " variables: '{}'.".format(value, not_expanded)
ValueError: Error when trying to expand the environment variables in '${RASA_MODEL_SERVER}'. Please make sure to also set these environment variables: '['${RASA_MODEL_SERVER}']'.

I actually raised this issue one week ago here.

@tiziano @varunsapre10. Most people will set up Rasa X on a computer that is always running (or a “server”), frequently on Google Cloud Platform, Amazon Web Services, Microsoft Azure, Digital Ocean, etc. This is where they will capture and collect conversations users have with their assistant, annotate incoming messages, and add new stories based on where those conversations go wrong.

Using Integrated Version Control, they will sync any changes they make periodically with their repository on GitHub, GitLab, BitBucket, etc. They will then have a clone of this repo on their own local machines, frequently laptops, where they will improve their assistant in ways that Rasa X is not built to do. For example, they will use their favorite text editor or IDE to write action code, push this other branch to the remote repo, and then make sure their deployment is using the latest version of the action code.

Is it more clear what I mean by “local machine” and “server” now?

Yes, it’s quite clear thanks, and it’s actually what I’m doing (I set up Rasa X on my own server and used Integrated Version Control with GitHub). What I was wondering is if I’m supposed to be able to run the rasa commands from my server

Ok, so, coming back to the problem of this topic…

I’m gonna use another example and provide all the debug logs.

These are the stories related to the greetings.whatsup intent: image image image

And these are the logs:

rasa-production_1  | {"sender_id": "8626464957b044a8ba3180335b357e22", "event": "user", "timestamp": 1579710125.916969, "text": "ok then", "parse_data": {"intent": {"name": "greetings.whatsup", "confidence": 0.7943424582481384}, "entities": [], "intent_ranking": [{"name": "greetings.whatsup", "confidence": 0.7943424582481384}, {"name": "confirmation.yes", "confidence": 0.04298349469900131}, {"name": "appraisal.good", "confidence": 0.03764909505844116}, {"name": "greetings.bye", "confidence": 0.03428162261843681}, {"name": "appraisal.thank_you", "confidence": 0.024739138782024384}, {"name": "agent.acquaintance", "confidence": 0.006430179812014103}, {"name": "greetings.hello", "confidence": 0.006332729943096638}, {"name": "greetings.nice_to_talk_to_you", "confidence": 0.00534297339618206}, {"name": "greetings.nice_to_see_you", "confidence": 0.005224165972322226}, {"name": "time_remaining", "confidence": 0.0050596268847584724}], "text": "ok then"}, "input_channel": "rasa", "message_id": "a8cc46ae66fe4f6799e6f11ae0d310d0", "metadata": {}}
rasa-production_1  | 2020-01-22 16:22:05 DEBUG    rasa.core.brokers.pika  - Published Pika events to queue 'rasa_production_events' on host 'rabbit':
rasa-production_1  | {"sender_id": "8626464957b044a8ba3180335b357e22", "event": "action", "timestamp": 1579710125.9411058, "name": "action_revert_fallback_events", "policy": "policy_3_TwoStageFallbackPolicy", "confidence": 1.0}
rasa-production_1  | 2020-01-22 16:22:05 DEBUG    rasa.core.brokers.pika  - Published Pika events to queue 'rasa_production_events' on host 'rabbit':
rasa-production_1  | {"sender_id": "8626464957b044a8ba3180335b357e22", "event": "rewind", "timestamp": 1579710125.941121}
rasa-production_1  | 2020-01-22 16:22:05 DEBUG    rasa.core.brokers.pika  - Published Pika events to queue 'rasa_production_events' on host 'rabbit':
rasa-production_1  | {"sender_id": "8626464957b044a8ba3180335b357e22", "event": "rewind", "timestamp": 1579710125.9412255}
rasa-production_1  | 2020-01-22 16:22:05 DEBUG    rasa.core.brokers.pika  - Published Pika events to queue 'rasa_production_events' on host 'rabbit':
rasa-production_1  | {"sender_id": "8626464957b044a8ba3180335b357e22", "event": "action", "timestamp": 1579710125.9413865, "name": "action_listen", "policy": null, "confidence": null}
rasa-production_1  | 2020-01-22 16:22:05 DEBUG    rasa.core.brokers.pika  - Published Pika events to queue 'rasa_production_events' on host 'rabbit':
rasa-production_1  | {"sender_id": "8626464957b044a8ba3180335b357e22", "event": "rewind", "timestamp": 1579710125.9413915}
rasa-production_1  | 2020-01-22 16:22:05 DEBUG    rasa.core.brokers.pika  - Published Pika events to queue 'rasa_production_events' on host 'rabbit':
rasa-production_1  | {"sender_id": "8626464957b044a8ba3180335b357e22", "event": "rewind", "timestamp": 1579710125.9414659}
rasa-production_1  | 2020-01-22 16:22:06 DEBUG    rasa.core.brokers.pika  - Published Pika events to queue 'rasa_production_events' on host 'rabbit':
rasa-production_1  | {"sender_id": "8626464957b044a8ba3180335b357e22", "event": "rewind", "timestamp": 1579710125.9420357}
rasa-production_1  | 2020-01-22 16:22:06 DEBUG    rasa.core.brokers.pika  - Published Pika events to queue 'rasa_production_events' on host 'rabbit':
rasa-production_1  | {"sender_id": "8626464957b044a8ba3180335b357e22", "event": "action", "timestamp": 1579710125.9421299, "name": "action_listen", "policy": null, "confidence": null}
rasa-production_1  | 2020-01-22 16:22:06 DEBUG    rasa.core.brokers.pika  - Published Pika events to queue 'rasa_production_events' on host 'rabbit':
rasa-production_1  | {"sender_id": "8626464957b044a8ba3180335b357e22", "event": "user", "timestamp": 1579710125.9421377, "text": "ok then", "parse_data": {"intent": {"name": "greetings.whatsup", "confidence": 1.0}, "entities": [], "intent_ranking": [{"name": "greetings.whatsup", "confidence": 0.7943424582481384}, {"name": "confirmation.yes", "confidence": 0.04298349469900131}, {"name": "appraisal.good", "confidence": 0.03764909505844116}, {"name": "greetings.bye", "confidence": 0.03428162261843681}, {"name": "appraisal.thank_you", "confidence": 0.024739138782024384}, {"name": "agent.acquaintance", "confidence": 0.006430179812014103}, {"name": "greetings.hello", "confidence": 0.006332729943096638}, {"name": "greetings.nice_to_talk_to_you", "confidence": 0.00534297339618206}, {"name": "greetings.nice_to_see_you", "confidence": 0.005224165972322226}, {"name": "time_remaining", "confidence": 0.0050596268847584724}], "text": "ok then"}, "input_channel": "rasa", "message_id": "a8cc46ae66fe4f6799e6f11ae0d310d0", "metadata": {}}
rasa-production_1  | 2020-01-22 16:22:06 DEBUG    rasa.core.brokers.pika  - Published Pika events to queue 'rasa_production_events' on host 'rabbit':
rasa-production_1  | {"sender_id": "8626464957b044a8ba3180335b357e22", "event": "action", "timestamp": 1579710125.9625773, "name": "utter_greetings.whatsup", "policy": "policy_0_AugmentedMemoizationPolicy", "confidence": 1.0}
rasa-production_1  | 2020-01-22 16:22:06 DEBUG    rasa.core.brokers.pika  - Published Pika events to queue 'rasa_production_events' on host 'rabbit':
rasa-production_1  | {"sender_id": "8626464957b044a8ba3180335b357e22", "event": "bot", "timestamp": 1579710125.9625936, "text": "You know, just here, waiting to help someone.", "data": {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, "metadata": {}}
rasa-production_1  | 2020-01-22 16:22:06 DEBUG    rasa.core.brokers.pika  - Published Pika events to queue 'rasa_production_events' on host 'rabbit':
rasa-production_1  | {"sender_id": "8626464957b044a8ba3180335b357e22", "event": "action", "timestamp": 1579710125.9763262, "name": "action_listen", "policy": "policy_0_AugmentedMemoizationPolicy", "confidence": 1.0}
rasa-production_1  | 2020-01-22 16:22:06 DEBUG    rasa.core.tracker_store  - Tracker with sender_id '8626464957b044a8ba3180335b357e22' stored to database
rasa-production_1  | 2020-01-22 16:22:06 DEBUG    rasa.core.lock_store  - Deleted lock for conversation '8626464957b044a8ba3180335b357e22'.

Anybody? @stephens? @tyd?

Hi @tiziano what does your action greetings.whatsup do? It seems like it’s reverting events, which causes the two messages to show up.

greetings.whatsup is the intent, utter_greetings.whatsup is a regular response defined in the domain as follows:

 utter_greetings.whatsup:

  - text: Not a whole lot. What's going on with you?

  - text: Not much. What's new with you?

  - text: You know, just here, waiting to help someone.

Right. Then I think it’s related to the fallback action jumping in. On an external UI to Rasa X I don’t think you’d see the message twice.

But you should probably fix your stories so the fallback event doesn’t happen. What do the debug logs say about confidence levels?

I provided all the logs here:

3 messages before

this seems to be the issue - your intent is classified with a confidence lower than your threshold and therefore the fallback policy jumps in

My thresholds are set to 0.1, it’s not lower than that…

And if it was so, why the fallback policy is not actually triggered? (the message that it’s displayed it’s actually the response for greetings.whatsup)

Could be that the Core confidence is too low as well.

I doubt that for such examples Core scored a confidence lower than 0.1, but even so, it should then display the fallback message, which doesn’t actually happen

do you have the debug logs from this conversation?

Yes, these: