# Split : domain.yml

**URL:** <https://forum.rasa.com/t/split-domain-yml/21018>\
**Category:** Rasa Open Source\
**Created:** [November 7, 2019, 9:55pm UTC](https://forum.rasa.com/t/split-domain-yml/21018 "2019-11-07T21:55:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sten](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@sten](https://forum.rasa.com/u/sten)\
**Post date:** [November 7, 2019, 9:55pm UTC](https://forum.rasa.com/t/split-domain-yml/21018/1 "2019-11-07T21:55:07Z")

</div>

Is there a plans to be able to divide the domain.yml the same way we can split the intent and stories in multiple .md files ? What is this good for ?

- the file will be less cluttered
- it will be easy to switch on/off big portions of train data
- you can do incremental development of the bot
- easy to import data from other people

- name collisions : you should think of allowing hierarchical IDs

dir structure of data dir :

```
+base - domain.yaml, nlu.md, stories.md
+prod- domain.yaml, *.md's
+new- .... test data
+banter - ...
+greet
+ ...

```

> rasa train --data=base,prod,new

---

<div class="post-metadata">

**Author:** ![jonathanpwheat](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/jonathanpwheat/32/4880_2.png) [@jonathanpwheat](https://forum.rasa.com/u/jonathanpwheat)\
**Post date:** [November 8, 2019, 12:13pm UTC](https://forum.rasa.com/t/split-domain-yml/21018/2 "2019-11-08T12:13:39Z")

</div>

Hi @sten, I hacked together a way to do this. It is not ideal, but works pretty well, for me at least.

In a similar fashion, you can create a data/domain directory and split your files up. Then run my script right before you train and it will merge together all of those files into a single domain.yml file

The script is here - [Rasa domain Assembler · GitHub](https://gist.github.com/jwheat/9a2611b738127f45d32254117fe3b959)

I just added this into a script I run whenever I train.

Hope that helps until it is a feature of Rasa.

---

<div class="post-metadata">

**Author:** ![sten](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@sten](https://forum.rasa.com/u/sten)\
**Post date:** [November 8, 2019, 4:10pm UTC](https://forum.rasa.com/t/split-domain-yml/21018/3 "2019-11-08T16:10:45Z")

</div>

thanks …

hiyapyco - cool…

i searched for yaml&markdown lib and there was none that you can use to manipulate the structure in python …

it seems also the markdown parser the rasa uses, doesn’t support multi-lines like this : [markdown-multiline](https://stackoverflow.com/questions/3790454/how-do-i-break-a-string-over-multiple-lines#21699210)

---

<div class="post-metadata">

**Author:** ![sten](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@sten](https://forum.rasa.com/u/sten)\
**Post date:** [November 10, 2019, 6:34pm UTC](https://forum.rasa.com/t/split-domain-yml/21018/4 "2019-11-10T18:34:24Z")

</div>

I just also figured out I can use C/C++ preprocessor 🙂

```
cpp -P included.inc > output.file
```

---

<div class="post-metadata">

**Author:** ![jonathanpwheat](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/jonathanpwheat/32/4880_2.png) [@jonathanpwheat](https://forum.rasa.com/u/jonathanpwheat)\
**Post date:** [November 11, 2019, 9:12pm UTC](https://forum.rasa.com/t/split-domain-yml/21018/5 "2019-11-11T21:12:49Z")

</div>

interesting, I haven’t had any problems with multi line entries, at least not yet, and I have quite a few

---

<div class="post-metadata">

**Author:** ![erohmensing](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/erohmensing/32/1789_2.png) [@erohmensing](https://forum.rasa.com/u/erohmensing)\
**Post date:** [November 11, 2019, 9:54pm UTC](https://forum.rasa.com/t/split-domain-yml/21018/6 "2019-11-11T21:54:47Z")

</div>

@jonathanpwheat you might be interested in the experimental MultiProjectImporter: [Training Data Importers](https://rasa.com/docs/rasa/api/training-data-importers/#multiprojectimporter-experimental)

---

<div class="post-metadata">

**Author:** ![snek](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/snek/32/13510_2.png) [@snek](https://forum.rasa.com/u/snek)\
**Post date:** [March 11, 2021, 8:14am UTC](https://forum.rasa.com/t/split-domain-yml/21018/7 "2021-03-11T08:14:06Z")

</div>

Maybe this thread is a bit stale now but I stumbled across it while searching for a way to divide the domain file. It is now possible. 🙂

## Multiple Domain Files[#](https://rasa.com/docs/rasa/domain/#multiple-domain-files)

> The domain can be defined as a single YAML file or split across multiple files in a directory. When split across multiple files, the domain contents will be read and automatically merged together.
> 
> Using the [command line interface](https://rasa.com/docs/rasa/command-line-interface#rasa-train), you can train a model with split domain files by running:
> 
> `rasa train --domain path_to_domain_directory`
