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

# Tutorial: Rasa Basics

This page explains the basics of building an assistant with Rasa and shows the structure of a Rasa project. You can test it out right here without installing anything. You can also [install Rasa](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/installation/#installation) and follow along in your command line.

The [glossary](/content/docs/rasa/glossary/index.html) contains an overview of the most common terms you’ll see in the Rasa documentation.

## Steps

- [1. Create a New Project](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/rasa-tutorial/#create-a-new-project)
- [2. View Your NLU Training Data](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/rasa-tutorial/#view-your-nlu-training-data)
- [3. Define Your Model Configuration](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/rasa-tutorial/#define-your-model-configuration)
- [4. Write Your First Stories](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/rasa-tutorial/#write-your-first-stories)
- [5. Define a Domain](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/rasa-tutorial/#define-a-domain)
- [6. Train a Model](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/rasa-tutorial/#train-a-model)
- [7. Test Your Assistant](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/rasa-tutorial/#test-your-assistant)
- [8. Talk to Your Assistant](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/rasa-tutorial/#talk-to-your-assistant)
- [Next Steps](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/rasa-tutorial/#next-steps)

In this tutorial, you will build a simple, friendly assistant which will ask how you’re doing and send you a fun picture if you are sad.

## 1. Create a New Project

The first step is to create a new Rasa project. To do this, run:
```
rasa init --no-prompt
```

The `rasa init` command creates all the files that a Rasa project needs and trains a simple bot on some sample data. If you leave out the `--no-prompt` flag you will be asked some questions about how you want your project to be set up.

This creates the following files:

|     |     |
| --- | --- |
| `__init__.py` | an empty file that helps python find your actions |
| `actions.py` | code for your custom actions |
| `config.yml` | configuration of your NLU and Core models |
| `credentials.yml` | details for connecting to other services |
| `data/nlu.md` | your NLU training data |
| `data/stories.md` | your stories |
| `domain.yml` | your assistant’s domain |
| `endpoints.yml` | details for connecting to channels |
| `models/<timestamp>.tar.gz` | your initial model |

The most important files are marked with a ‘*’. You will learn about all of these in this tutorial.

## 2. View Your NLU Training Data

The first piece of a Rasa assistant is an NLU model. NLU stands for Natural Language Understanding, which means turning user messages into structured data. To do this with Rasa, you provide training examples that show how Rasa should understand user messages, and then train a model by showing it those examples.

Run:
```
cat data/nlu.md
```

The lines starting with `##` define the names of your `intents`, which are groups of messages with the same meaning.

## 3. Define Your Model Configuration

The configuration file defines the NLU and Core components that your model will use. In this example, your NLU model will use the `supervised_embeddings` pipeline. You can learn about the different NLU pipelines [here](https://legacy-docs-v1.rasa.com/1.10.24/nlu/choosing-a-pipeline/#choosing-a-pipeline).

Take a look at your model configuration file:
```
cat config.yml
```

The `language` and `pipeline` keys specify how the NLU model should be built.

## 4. Write Your First Stories

At this stage, you will teach your assistant how to respond to your messages. This is called dialogue management, handled by your Core model.

Run the command below to view example stories inside the file `data/stories.md`:
```
cat data/stories.md
```

## 5. Define a Domain

The next thing we need to do is define a [Domain](https://legacy-docs-v1.rasa.com/1.10.24/core/domains/#domains). The domain defines the universe your assistant lives in, what user inputs it should expect, what actions it should be able to predict, how to respond, and what information to store.

Display the domain:
```
cat domain.yml
```

## 6. Train a Model

Anytime we add new NLU or Core data, or update the domain or configuration, we need to re-train a neural network. To do this, run:
```
rasa train
```

## 7. Test Your Assistant

After you train a model, you always want to check that your assistant behaves as expected. You use end-to-end tests to run through test conversations.
```
rasa test
```

## 8. Talk to Your Assistant

Congratulations! 🚀 You just built an assistant powered entirely by machine learning. Try out your assistant:
```
rasa shell
```

## Next Steps

Now you’ve built your first Rasa bot. Explore more advanced Rasa features:

- Learn how to implement business logic using [forms](https://legacy-docs-v1.rasa.com/1.10.24/core/forms/#forms)
- Learn how to integrate other APIs using [custom actions](https://legacy-docs-v1.rasa.com/1.10.24/core/actions/#actions)
- Learn to connect your bot to different [messaging apps](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/messaging-and-voice-channels/#messaging-and-voice-channels)
- Learn about customizing the [components](https://legacy-docs-v1.rasa.com/1.10.24/nlu/components/#components) in your NLU pipeline
- Read about custom and built-in [entities](https://legacy-docs-v1.rasa.com/1.10.24/nlu/entity-extraction/#entity-extraction)

You can also use Rasa X to collect more conversations and improve your assistant:

[Try Rasa X](https://legacy-docs-v1.rasa.com/rasa-x/)
