# Building a FAQ bot

**URL:** <https://forum.rasa.com/t/building-a-faq-bot/4263>\
**Category:** Getting Started with Rasa\
**Created:** [January 11, 2019, 4:45pm UTC](https://forum.rasa.com/t/building-a-faq-bot/4263 "2019-01-11T16:45:51Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![pranav](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pranav](https://forum.rasa.com/u/pranav)\
**Post date:** [January 11, 2019, 4:45pm UTC](https://forum.rasa.com/t/building-a-faq-bot/4263/1 "2019-01-11T16:45:51Z")

</div>

Hi all,

I have built a FAQ bot on cyber security using AIML. I want to convert it to the rasa stack for actually using machine learning. What do I have to do to do this? The way I see it, I need to do the following.

1. Define intents and entities. I have a series of cyber security related questions for which I will create an intent like “securityquestion”. The questions are like what is cyber security who or what is a hacker how do I learn to hack
2. I need to define entities. However, I am not sure what an entity would be here. Would every noun be an entity?
3. I do have responses that the bot should give. I am happy to use rasa core. Do I then need to create a separate story file or is there some other way for me to add the responses to the questions? The problem with creating a story file is that it apears to rely on indentation. Am I wrong?
4. If the bot cannot find an answer, it should try looking it up. I suspect I will need some kind of custom action but I am not sure.

Please advise.

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [January 11, 2019, 5:18pm UTC](https://forum.rasa.com/t/building-a-faq-bot/4263/2 "2019-01-11T17:18:26Z")

</div>

hey @pranav might be i can help you in some way, just check my github rep on FAQ Bot 🙂

[https://github.com/JiteshGaikwad/FAQ-Bot](https://github.com/JiteshGaikwad/FAQ-Bot)

original source :

> **[RasaHQ/rasa-demo](https://github.com/RasaHQ/rasa-demo)**
>
> :tiger: Sara - the Rasa Demo Bot: An example of a contextual AI assistant built with the open source Rasa Stack

---

<div class="post-metadata">

**Author:** ![pranav](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pranav](https://forum.rasa.com/u/pranav)\
**Post date:** [January 11, 2019, 6:12pm UTC](https://forum.rasa.com/t/building-a-faq-bot/4263/3 "2019-01-11T18:12:12Z")

</div>

Hi Jitesh, Many thanks for the link to your bot. How are you mapping the questions to their answers? In my case, each question has a specific answer.

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [January 12, 2019, 3:08am UTC](https://forum.rasa.com/t/building-a-faq-bot/4263/4 "2019-01-12T03:08:59Z")

</div>

i am mapping the answer based on the intent name

---

<div class="post-metadata">

**Author:** ![Akshit](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akshit/32/1431_2.png) [@Akshit](https://forum.rasa.com/u/Akshit)\
**Post date:** [January 12, 2019, 5:07am UTC](https://forum.rasa.com/t/building-a-faq-bot/4263/5 "2019-01-12T05:07:55Z")

</div>

So in your stories file, You define a dialogue for the bot! like:

## story

- greet

- what\_can\_you\_do

So basically you define the kind of action you want the bot to do! May it be a default answer or a custom action which will include some API or other links to db. Happy coding! 🙂

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [January 12, 2019, 5:09am UTC](https://forum.rasa.com/t/building-a-faq-bot/4263/6 "2019-01-12T05:09:14Z")

</div>

Hey @Akshit you can have a look at my stories @

> <https://github.com/JiteshGaikwad/FAQ-Bot/blob/master/stories.md>

---

<div class="post-metadata">

**Author:** ![Akshit](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akshit/32/1431_2.png) [@Akshit](https://forum.rasa.com/u/Akshit)\
**Post date:** [January 12, 2019, 5:11am UTC](https://forum.rasa.com/t/building-a-faq-bot/4263/7 "2019-01-12T05:11:22Z")

</div>

hey! I looked at the sara bot! I’m kinda not sure how formaction is used! Do you have a example in your bot for that? I just need the workng example so I can similarly add that in my bot!

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [January 12, 2019, 5:12am UTC](https://forum.rasa.com/t/building-a-faq-bot/4263/8 "2019-01-12T05:12:59Z")

</div>

hey @Akshit as of now i dont have any example to show

---

<div class="post-metadata">

**Author:** ![Akshit](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akshit/32/1431_2.png) [@Akshit](https://forum.rasa.com/u/Akshit)\
**Post date:** [January 12, 2019, 5:13am UTC](https://forum.rasa.com/t/building-a-faq-bot/4263/9 "2019-01-12T05:13:41Z")

</div>

Hey @pranav You can ask me if you have any other questions in the working! I would suggest that just try the weatherbot or any other example given by the community and get the idea about the flow in RASA.!

---

<div class="post-metadata">

**Author:** ![Akshit](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akshit/32/1431_2.png) [@Akshit](https://forum.rasa.com/u/Akshit)\
**Post date:** [January 12, 2019, 5:14am UTC](https://forum.rasa.com/t/building-a-faq-bot/4263/10 "2019-01-12T05:14:33Z")

</div>

No issues! Maybe someone else can help!

---

<div class="post-metadata">

**Author:** ![Akshit](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akshit/32/1431_2.png) [@Akshit](https://forum.rasa.com/u/Akshit)\
**Post date:** [January 12, 2019, 5:23am UTC](https://forum.rasa.com/t/building-a-faq-bot/4263/11 "2019-01-12T05:23:06Z")

</div>

hey! @JiteshGaikwad can you help me with one of these maybe I’m kinda stuck!

1. So if a user enter **today,tomorrow or like last month** how would i convert it into a valid input! store into slot?
2. So I have added a list of names in lookup table and placed it in my data folder, Now when I train the nlu and try to search for a name, that is in the lookup table but not in my nlu data, it doesn’t get detected as an entity.
3. formaction is one 🙂
4. after the completion of a conversation I need to store all the story inside a file.?

---

<div class="post-metadata">

**Author:** ![pranav](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pranav](https://forum.rasa.com/u/pranav)\
**Post date:** [January 12, 2019, 8:45am UTC](https://forum.rasa.com/t/building-a-faq-bot/4263/12 "2019-01-12T08:45:45Z")

</div>

thanks Jitesh and Akshit. I have added some questions to a json file and have used rasa\_nlu to classify intents. I need a way to return some responses to the user. I am checking out the examples in the documenattion.

---

<div class="post-metadata">

**Author:** ![Akshit](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akshit/32/1431_2.png) [@Akshit](https://forum.rasa.com/u/Akshit)\
**Post date:** [January 12, 2019, 9:45am UTC](https://forum.rasa.com/t/building-a-faq-bot/4263/13 "2019-01-12T09:45:49Z")

</div>

Yeah just create a domain file and a story data file. Train the more model. There is no need to add custom actions if you want a default answer everytime. Just for learning part you can use templates!

---

<div class="post-metadata">

**Author:** ![pranav](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pranav](https://forum.rasa.com/u/pranav)\
**Post date:** [January 13, 2019, 12:08pm UTC](https://forum.rasa.com/t/building-a-faq-bot/4263/14 "2019-01-13T12:08:35Z")

</div>

Hi all, I did some work yesterday and have my json training data using the rasa-nlu-trainer tool. I have over 50 questions but their intent is the same because the bot has to output specific answers. For example, what is a hacker and what is cyber security? Both these questions have an intent of “security\_question”. So, how do I get the bot to select the right response if there is the same intent across queries?

---

<div class="post-metadata">

**Author:** ![Akshit](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akshit/32/1431_2.png) [@Akshit](https://forum.rasa.com/u/Akshit)\
**Post date:** [January 14, 2019, 4:13am UTC](https://forum.rasa.com/t/building-a-faq-bot/4263/15 "2019-01-14T04:13:01Z")

</div>

So when the intent gets detected as “security\_question” Let’s say you call an action\_security custom action okay! So now you have to tell the bot that for " a" you have to run func1 and “b” you have to run func2. I think only way to do this is to store hacker or cyber security into an entity and so then in your custom action based on the entity taken from tracker you can tell the bot to utter a template or do anything,

BUT! I think it’s if you define a different intent as a whole for this! and define a default template for that question! I’m also trying to find a solution for this! I’ll let you know If I find one!

---

<div class="post-metadata">

**Author:** ![prakashdale](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/prakashdale/32/2995_2.png) [@prakashdale](https://forum.rasa.com/u/prakashdale)\
**Post date:** [June 21, 2019, 7:52am UTC](https://forum.rasa.com/t/building-a-faq-bot/4263/16 "2019-06-21T07:52:39Z")

</div>

Github FAQ-Bot link is broken

---

<div class="post-metadata">

**Author:** ![nghuyong](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nghuyong/32/4035_2.png) [@nghuyong](https://forum.rasa.com/u/nghuyong)\
**Post date:** [August 17, 2019, 3:06pm UTC](https://forum.rasa.com/t/building-a-faq-bot/4263/17 "2019-08-17T15:06:22Z")

</div>

Hello, we build a faq bot based rasa, it can work well in some simple environments.

> **[GitHub - nghuyong/rasa-faq-bot: Use Rasa to build a FAQ bot](https://github.com/nghuyong/rasa-faq-bot)**
>
> Use Rasa to build a FAQ bot. Contribute to nghuyong/rasa-faq-bot development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![pranav](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pranav](https://forum.rasa.com/u/pranav)\
**Post date:** [September 18, 2019, 2:42pm UTC](https://forum.rasa.com/t/building-a-faq-bot/4263/18 "2019-09-18T14:42:38Z")

</div>

Hi all, Many thanks for all the responses. So, the way I understand things, I use the NLU component to capture intent and then use custom actions to actually match questions to answers in my database. Am I correct?

My situation has changed a bit since I posted this question over a year ago. I have about 42000 questions and answers and can add more. I had tried sequence to sequence modeling but that needs more memory and resources that I can allocate so I am back to see if rasa can help.

Pranav

---

<div class="post-metadata">

**Author:** ![Nick\_Kazakov](https://avatars.discourse-cdn.com/v4/letter/n/90db22/32.png) [@Nick\_Kazakov](https://forum.rasa.com/u/Nick_Kazakov)\
**Post date:** [September 19, 2019, 12:48pm UTC](https://forum.rasa.com/t/building-a-faq-bot/4263/19 "2019-09-19T12:48:47Z")

</div>

[Retrieval Actions](https://rasa.com/docs/rasa/core/retrieval-actions/) Look at this

---

<div class="post-metadata">

**Author:** ![pranav](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pranav](https://forum.rasa.com/u/pranav)\
**Post date:** [September 19, 2019, 4:39pm UTC](https://forum.rasa.com/t/building-a-faq-bot/4263/20 "2019-09-19T16:39:08Z")

</div>

Thanks Nick. I see one problem. The documentation states: predict. All retrieval intents have a suffix added to them which identifies a particular response text for your assistant, in the above example - ask\_name and ask\_weather. The suffix is separated from the intent name by a / delimiter

How do I create these suffixes? I have a huge list of questions and answers and am not in a position to read all the data and tag it.
