# Is creating a custom action for retrieval intents possible?

**URL:** <https://forum.rasa.com/t/is-creating-a-custom-action-for-retrieval-intents-possible/42738>\
**Category:** Rasa Open Source\
**Created:** [April 22, 2021, 4:52am UTC](https://forum.rasa.com/t/is-creating-a-custom-action-for-retrieval-intents-possible/42738 "2021-04-22T04:52:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Snorlaxcode](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/snorlaxcode/32/14523_2.png) [@Snorlaxcode](https://forum.rasa.com/u/Snorlaxcode)\
**Post date:** [April 22, 2021, 4:52am UTC](https://forum.rasa.com/t/is-creating-a-custom-action-for-retrieval-intents-possible/42738/1 "2021-04-22T04:52:58Z")

</div>

Hi

My use case has around 220 sub-intents. It is primarily in FAQ format. There are other intents as well which are used to continue the story/give a humane feel to the person on the other side. I wish to fetch the responses for the sub-intents from a CSV or DB.

However, Rasa automatically creates utter\_faq response and even if I try to define it as a custom action, it is shows me that utter\_faq response is not defined and doesn’t detect it in the action.py file. I would rather have a single response action and fetch items from DB than put in 220 individual responses in the domain/nlu file.

Is there a way to define a custom action for retrieval intents?

---

<div class="post-metadata">

**Author:** ![Polaris000](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/polaris000/32/18422_2.png) [@Polaris000](https://forum.rasa.com/u/Polaris000)\
**Post date:** [October 26, 2021, 10:41am UTC](https://forum.rasa.com/t/is-creating-a-custom-action-for-retrieval-intents-possible/42738/2 "2021-10-26T10:41:21Z")

</div>

Hi @Snorlaxcode did you find an answer? I’d like to do the same thing

---

<div class="post-metadata">

**Author:** ![Snorlaxcode](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/snorlaxcode/32/14523_2.png) [@Snorlaxcode](https://forum.rasa.com/u/Snorlaxcode)\
**Post date:** [October 27, 2021, 5:06am UTC](https://forum.rasa.com/t/is-creating-a-custom-action-for-retrieval-intents-possible/42738/3 "2021-10-27T05:06:38Z")

</div>

Hi. I was unable to find a solution for this. But I will raise a feature request on git. Please comment on it that its a requirement for you too.

---

<div class="post-metadata">

**Author:** ![Snorlaxcode](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/snorlaxcode/32/14523_2.png) [@Snorlaxcode](https://forum.rasa.com/u/Snorlaxcode)\
**Post date:** [October 27, 2021, 5:22am UTC](https://forum.rasa.com/t/is-creating-a-custom-action-for-retrieval-intents-possible/42738/4 "2021-10-27T05:22:07Z")

</div>

> <https://github.com/RasaHQ/rasa/issues/9986>
>
> \### What problem are you trying to solve?
> 
> Retrieval intents or sub-intents don'…t have an option to define custom actions. This impedes flexibility in terms of how sub-intents can be used. Importing from data files such as db, json and csv isn't possible. Greater manipulation or verification/conditional statements isnt possible either. Only manually written responses can be used.
> 
> When using FAQs, rasa automatically creates utter\_faq response and even if I try to define it as a custom action, it is shows me that utter\_faq response is not defined and doesn’t detect it in the action.py file.
> 
> \### What's your suggested solution?
> 
> Allow writing custom actions for sub-intents instead of hardcoding the response method. Provide a default response utter\_faq or similar but allow for it to be overwritten in actions.py file.
> 
> \### Examples (if relevant)
> 
> \_No response\_
> 
> \### Is anything blocking this from being implemented? (if relevant)
> 
> No
> 
> \### Definition of Done
> 
> When we are able to define a custom action for each sub-intent in the main intent. If required we can also define a few sub-intents in the response file sub intent.

Please comment on the issue for possible implementation in future version.

---

<div class="post-metadata">

**Author:** ![Polaris000](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/polaris000/32/18422_2.png) [@Polaris000](https://forum.rasa.com/u/Polaris000)\
**Post date:** [October 27, 2021, 10:30am UTC](https://forum.rasa.com/t/is-creating-a-custom-action-for-retrieval-intents-possible/42738/5 "2021-10-27T10:30:16Z")

</div>

Will do. Thanks

---

<div class="post-metadata">

**Author:** ![mxnno](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/mxnno/32/18787_2.png) [@mxnno](https://forum.rasa.com/u/mxnno)\
**Post date:** [January 20, 2022, 12:13pm UTC](https://forum.rasa.com/t/is-creating-a-custom-action-for-retrieval-intents-possible/42738/6 "2022-01-20T12:13:23Z")

</div>

@Snorlaxcode did you find any workaround?

I have a similar use case:

```auto
Intention: FAQ/abc
Action: action_faq
 -> read file/db
 -> get answer
 -> dispatcher.utter_message(text = ...)

```

I am thinking of using normal intents.

But what annoys me is that there are hundreds of rules…

---

<div class="post-metadata">

**Author:** ![Snorlaxcode](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/snorlaxcode/32/14523_2.png) [@Snorlaxcode](https://forum.rasa.com/u/Snorlaxcode)\
**Post date:** [January 20, 2022, 5:48pm UTC](https://forum.rasa.com/t/is-creating-a-custom-action-for-retrieval-intents-possible/42738/7 "2022-01-20T17:48:38Z")

</div>

Same here. I used regular intents for all and included 220 responses in the domain file. There are a lot of bugs in the retrieval intent system and honestly, it hasn’t been designed keeping scalability in mind. I would suggest using regular intents.
