# Using Custom NLU with Rasa X

**URL:** <https://forum.rasa.com/t/using-custom-nlu-with-rasa-x/21100>\
**Category:** \[Deprecated\] Rasa X Community Edition\
**Created:** [November 11, 2019, 11:52am UTC](https://forum.rasa.com/t/using-custom-nlu-with-rasa-x/21100 "2019-11-11T11:52:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![maria.p](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@maria.p](https://forum.rasa.com/u/maria.p)\
**Post date:** [November 11, 2019, 11:52am UTC](https://forum.rasa.com/t/using-custom-nlu-with-rasa-x/21100/1 "2019-11-11T11:52:11Z")

</div>

Hello,

last year we were using Rasa with our own custom NLU (complete pipeline).

After migrating to new Rasa, we encountered a problem while running Rasa X with our NLU.

It is connected as endpoint:

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

```

And it works fine when run as `rasa shell`, but won’t get connected with `rasa x`.

Is replacing Rasa NLU with custom NLU not supported anymore or should it be done differently?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![maria.p](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@maria.p](https://forum.rasa.com/u/maria.p)\
**Post date:** [December 5, 2019, 9:17am UTC](https://forum.rasa.com/t/using-custom-nlu-with-rasa-x/21100/2 "2019-12-05T09:17:20Z")

</div>

Hi, we are still traing to find a solution for this. Could anyone help?

What is the correct way to connect a custom NLU (available as Web service) to Rasa Core?

---

<div class="post-metadata">

**Author:** ![JamieDF](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/jamiedf/32/3215_2.png) [@JamieDF](https://forum.rasa.com/u/JamieDF)\
**Post date:** [February 5, 2020, 4:24pm UTC](https://forum.rasa.com/t/using-custom-nlu-with-rasa-x/21100/3 "2020-02-05T16:24:38Z")

</div>

Hey Maria,

Running into the same problem here, did you manage to find a way to make it work?

thanks, Jamie

---

<div class="post-metadata">

**Author:** ![Natalia\_Buryakova](https://avatars.discourse-cdn.com/v4/letter/n/fbc32d/32.png) [@Natalia\_Buryakova](https://forum.rasa.com/u/Natalia_Buryakova)\
**Post date:** [November 24, 2020, 4:45am UTC](https://forum.rasa.com/t/using-custom-nlu-with-rasa-x/21100/4 "2020-11-24T04:45:58Z")

</div>

Hello! I am also interested in this question: how we can connect our own custom NLU through the API using Rasa 2 and Rasa X. Please explain

Thanks!

---

<div class="post-metadata">

**Author:** ![Tobias\_Wochinger](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tobias_wochinger/32/4580_2.png) [@Tobias\_Wochinger](https://forum.rasa.com/u/Tobias_Wochinger)\
**Post date:** [November 26, 2020, 9:11am UTC](https://forum.rasa.com/t/using-custom-nlu-with-rasa-x/21100/5 "2020-11-26T09:11:47Z")

</div>

I took a deep dive into the Rasa Open Source code base and while I couldn’t find any up to date documentation, it should still be possible to use an external NLU. [These are](https://legacy-docs.rasa.com/docs/core/server/#connecting-rasa-nlu) the legacy docs for it which should still work.

[This class](https://github.com/RasaHQ/rasa/blob/345e903018307d51e73083ed8a4ee6c5417f0656/rasa/core/interpreter.py#L44) adds support for external NLU endpoints. To trigger the usage of this class you need an entry like the following in your `endpoints.yml`:

```auto
nlu:
  url: "http://<your nlu host>:<port>"

```

Note that Rasa Open Source will automatically add `/model/parse` to the given URL which means that your server needs to respond to requests on `http://<your nlu host>:<port>/model/parse`.

The request which Rasa sends has the following content:

```json
{
  "token": "<endpoint token>",
  "text": "<message text>",
  "message_id": "<message id>",
}

```

I created an issue for the missing documentation [here](https://github.com/RasaHQ/rasa/issues/7376).

Regarding Rasa X: Support for this currently a bit fragile but the following should still work:

1. Start Rasa Open Source with the `nlu:` endpoint defined in `endpoints.yml`
2. Make sure Rasa X does not provide a model containing an NLU model to Rasa Open Source. You can either do so by not uploading a model to Rasa X **or** having only models in Rasa which were trained using `rasa train core`. If you train via Rasa X, you should achieve the same behavior as `rasa train core` by not providing any NLU training data in Rasa X.

**Disclaimer**

All things aside, I can only **strongly** recommend to use the integrated NLU in Rasa Open Source. We got a great research team which is continuously working on improvements for NLU and also integrating the dialogue management with the NLU predictions more and more which should lead to more robust decisions by the bot. You can also integrate various pretrained models with Rasa’s integrated NLU to improve the predictions for your language (e.g. you could utilize BERT embeddings) or use custom components to add more information to the prediction (e.g. sentiment analysis).
