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

## User Guide

- [Installation](https://legacy-docs-v1.rasa.com/1.4.6/user-guide/installation/)
- [Rasa Tutorial](https://legacy-docs-v1.rasa.com/1.4.6/user-guide/rasa-tutorial/)
- [Command Line Interface](https://legacy-docs-v1.rasa.com/1.4.6/user-guide/command-line-interface/)
- [Architecture](https://legacy-docs-v1.rasa.com/1.4.6/user-guide/architecture/)
- [Messaging and Voice Channels](https://legacy-docs-v1.rasa.com/1.4.6/user-guide/messaging-and-voice-channels/)
- [Evaluating Models](https://legacy-docs-v1.rasa.com/1.4.6/user-guide/evaluating-models/)
- [Validate Data](https://legacy-docs-v1.rasa.com/1.4.6/user-guide/validate-files/)
- [Running the Server](https://legacy-docs-v1.rasa.com/1.4.6/user-guide/running-the-server/)
- [Running Rasa with Docker](https://legacy-docs-v1.rasa.com/1.4.6/user-guide/running-rasa-with-docker/)
- [Cloud Storage](https://legacy-docs-v1.rasa.com/1.4.6/user-guide/cloud-storage/)

## NLU

- [About](https://legacy-docs-v1.rasa.com/1.4.6/nlu/about/)
- [Using NLU Only](https://legacy-docs-v1.rasa.com/1.4.6/nlu/using-nlu-only/)
- [Training Data Format](https://legacy-docs-v1.rasa.com/1.4.6/nlu/training-data-format/)
- [Choosing a Pipeline](https://legacy-docs-v1.rasa.com/1.4.6/nlu/choosing-a-pipeline/)
- [Language Support](https://legacy-docs-v1.rasa.com/1.4.6/nlu/language-support/)
- [Entity Extraction](https://legacy-docs-v1.rasa.com/1.4.6/nlu/entity-extraction/)
- [Components](https://legacy-docs-v1.rasa.com/1.4.6/nlu/components/)

## Core

- [About](https://legacy-docs-v1.rasa.com/1.4.6/core/about/)
- [Stories](https://legacy-docs-v1.rasa.com/1.4.6/core/stories/)
- [Domains](https://legacy-docs-v1.rasa.com/1.4.6/core/domains/)
- [Responses](https://legacy-docs-v1.rasa.com/1.4.6/core/responses/)
- [Actions](https://legacy-docs-v1.rasa.com/1.4.6/core/actions/#)
- [Policies](https://legacy-docs-v1.rasa.com/1.4.6/core/policies/)
- [Slots](https://legacy-docs-v1.rasa.com/1.4.6/core/slots/)
- [Forms](https://legacy-docs-v1.rasa.com/1.4.6/core/forms/)
- [Retrieval Actions](https://legacy-docs-v1.rasa.com/1.4.6/core/retrieval-actions/)
- [Interactive Learning](https://legacy-docs-v1.rasa.com/1.4.6/core/interactive-learning/)
- [Fallback Actions](https://legacy-docs-v1.rasa.com/1.4.6/core/fallback-actions/)
- [Knowledge Base Actions](https://legacy-docs-v1.rasa.com/1.4.6/core/knowledge-bases/)

## Conversation Design

- [Dialogue Elements](https://legacy-docs-v1.rasa.com/1.4.6/dialogue-elements/dialogue-elements/)
- [Small Talk](https://legacy-docs-v1.rasa.com/1.4.6/dialogue-elements/small-talk/)
- [Completing Tasks](https://legacy-docs-v1.rasa.com/1.4.6/dialogue-elements/completing-tasks/)
- [Guiding Users](https://legacy-docs-v1.rasa.com/1.4.6/dialogue-elements/guiding-users/)

## API Reference

- [Action Server](https://legacy-docs-v1.rasa.com/1.4.6/api/action-server/)
- [HTTP API](https://legacy-docs-v1.rasa.com/1.4.6/api/http-api/)
- [Jupyter Notebooks](https://legacy-docs-v1.rasa.com/1.4.6/api/jupyter-notebooks/)
- [Agent](https://legacy-docs-v1.rasa.com/1.4.6/api/agent/)
- [Custom NLU Components](https://legacy-docs-v1.rasa.com/1.4.6/api/custom-nlu-components/)
- [Events](https://legacy-docs-v1.rasa.com/1.4.6/api/events/)
- [Tracker](https://legacy-docs-v1.rasa.com/1.4.6/api/tracker/)
- [Tracker Stores](https://legacy-docs-v1.rasa.com/1.4.6/api/tracker-stores/)
- [Event Brokers](https://legacy-docs-v1.rasa.com/1.4.6/api/event-brokers/)
- [Lock Stores](https://legacy-docs-v1.rasa.com/1.4.6/api/lock-stores/)
- [Training Data Importers](https://legacy-docs-v1.rasa.com/1.4.6/api/training-data-importers/)
- [Featurization](https://legacy-docs-v1.rasa.com/1.4.6/api/featurization/)
- [Migration Guide](https://legacy-docs-v1.rasa.com/1.4.6/migration-guide/)
- [Rasa Change Log](https://legacy-docs-v1.rasa.com/1.4.6/changelog/)

## Migrate from (beta)

- [Dialogflow](https://legacy-docs-v1.rasa.com/1.4.6/migrate-from/google-dialogflow-to-rasa/)
- [Wit.ai](https://legacy-docs-v1.rasa.com/1.4.6/migrate-from/facebook-wit-ai-to-rasa/)
- [LUIS](https://legacy-docs-v1.rasa.com/1.4.6/migrate-from/microsoft-luis-to-rasa/)
- [IBM Watson](https://legacy-docs-v1.rasa.com/1.4.6/migrate-from/ibm-watson-to-rasa/)

## Reference

- [Glossary](https://legacy-docs-v1.rasa.com/1.4.6/glossary/)

# Actions

Actions are the things your bot runs in response to user input. There are four kinds of actions in Rasa:

1. **Utterance actions**: start with `utter_` and send a specific message to the user.
2. **Retrieval actions**: start with `respond_` and send a message selected by a retrieval model.
3. **Custom actions**: run arbitrary code and send any number of messages (or none).
4. **Default actions**: e.g. `action_listen`, `action_restart`, `action_default_fallback`.

## Utterance Actions

To define an utterance action (`ActionUtterTemplate`), add an utterance template to the domain file that starts with `utter_`:

```
templates:
  utter_my_message:
    - "this is what I want my action to say!"
```

It is conventional to start the name of an utterance action with `utter_`. If this prefix is missing, you can still use the template in your custom actions, but the template cannot be directly predicted as its own action. See [Responses](https://legacy-docs-v1.rasa.com/1.4.6/core/responses/#responses) for more details.

## Retrieval Actions

Retrieval actions make it easier to work with a large number of similar intents like chitchat and FAQs.

## Custom Actions

An action can run any code you want. Custom actions can turn on the lights, add an event to a calendar, check a user’s bank balance, or anything else you can imagine.

Rasa will call an endpoint you can specify when a custom action is predicted. This endpoint should be a webserver that reacts to this call, runs the code, and optionally returns information to modify the dialogue state.

To specify your action server use the `endpoints.yml`:

```
action_endpoint:
  url: "http://localhost:5055/webhook"
```

### Custom Actions Written in Python

For actions written in Python, we have a convenient SDK which starts this action server for you.

The only thing your action server needs to install is `rasa-sdk`:

```
pip install rasa-sdk
```

The file that contains your custom actions should be called `actions.py`. Alternatively, you can use a package directory called `actions` or manually specify an actions module or package with the `--actions` flag.

If you have `rasa` installed, run this command to start your action server:

```
rasa run actions
```

In a restaurant bot, if the user says “show me a Mexican restaurant”, your bot could execute the action `ActionCheckRestaurants`, which might look like this:

```python
from rasa_sdk import Action
from rasa_sdk.events import SlotSet

class ActionCheckRestaurants(Action):
   def name(self) -> Text:
      return "action_check_restaurants"

def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
      cuisine = tracker.get_slot('cuisine')
      q = "select * from restaurants where cuisine='{0}' limit 1".format(cuisine)
      result = db.query(q)
      return [SlotSet("matches", result if result is not None else [])]
```

### Execute Actions in Other Code

Rasa will send an HTTP `POST` request to your server containing information on which action to run. All modifications are done using events.

## Proactively Reaching Out to the User Using Actions

You may want to proactively reach out to the user, for example, to display the output of a long-running background operation or notify the user of an external event.

## Default Actions

There are eight default actions:

|     |     |
| --- | --- |
| `action_listen` | Stop predicting more actions and wait for user input. |
| `action_restart` | Reset the whole conversation. Can be triggered during a conversation by entering `/restart`. |
| `action_default_fallback` | Undo the last user message and utter a message that the bot did not understand. |
| `action_deactivate_form` | Deactivate the active form and reset the requested slot. |
| `action_revert_fallback_events` | Revert events that occurred during the TwoStageFallbackPolicy. |
| `action_default_ask_affirmation` | Ask the user to affirm their intent. |
| `action_default_ask_rephrase` | Ask the user to rephrase their intent. |
| `action_back` | Undo the last user message. |

All the default actions can be overwritten by adding the action name to the list of actions in your domain:

```
actions:
- action_default_ask_affirmation
```
