• Aditya Sohoni
  • Shruthan R
  • Varun NR


  • Rakshit P
  • Pratham Nayak
  • K Dharmik Sai


With advancements in AI and NLP, chatbots are becoming popular for automation tasks that you would need human assistance for. Through this project, we aimed to build one such bot that gets you around NITK.

Using a variety of NLP techniques, our Rasa-powered chatbot easily answers various location queries like “Where can I get snacks in NITK?”, “Where is the Main Building?” etc. The bot also provides an embedded Google Map pointer to the location.

We believe this bot can make life easier for anyone who is visiting NITK and find themselves lost.


What is RASA?

Rasa is an open-source framework for developing AI-powered industrial-grade chatbots, contextual assistants, voice assistants, and many more. Developers worldwide use the RASA framework to build and deploy personalised assistants to automate text- and voice-based conversations.

How does RASA work?

The Rasa framework consists of 2 components, namely Rasa NLU and Rasa Core. Rasa NLU is used for interpreting the user message, and RASA core is used for dialogue management.


RASA NLU (Natural Language Understanding) is used for interpreting the user’s messages. It takes user input and constructs structured data out of it by identifying the user’s intent and the various entities present in the text.


RASA uses intents to identify what the user is trying to convey or accomplish through his message. Let us say we have an intent called location_query then inputs such as “where is the playground?” or “where is the main building?” will be classified under the intent location_query, helping the bot to understand what the user is asking for and respond accordingly.


An entity is a keyword that can be extracted from the user’s message. Messages classified under the same intent can have different entities. For example, for the input “where is the playground?” the extracted entity will be “playground”, while in the case of “where is the main building”, the extracted entity will be “main building” even though both of them fall under the same intent. Entities can also be defined using regular expressions and look-up tables.


While the NLU is used to process the user’s input, RASA Core is used to manage the flow of conversation. This includes predicting responses, performing actions, setting slot values, and much more.


Slots are the memory of the chatbot. It is a key-value mapping, where a particular slot name is a key, and it has a value, for e.g. city can be a slot name, and Mangalore can be its value. We can have different types of slots for different types of values that we want to store. Slots can be set during entity extraction from user input, or they can also be set during custom actions. Slots have the ability to influence a conversation, i.e. they can be used to predict the next action.


Responses are the set of messages that the bot can use to respond to a user query. Usually, responses are text, but they can be images, buttons, etc. We can also define a custom response. We can also have variables in a response in order to customise the response. Rasa automatically fills the variable with its slot value. Responses can be called in stories and also by custom actions. There are a variety of responses which include buttons. Buttons can have payload attached to them, where clicking a button represents an intent that the user wants to convey to the bot. For example, clicking on the buy button represents the intent that the user wants to buy a commodity to the bot, and the bot can respond accordingly.


After receiving a user input bot predicts an action. Actions include a wide range of activities such as responses, custom actions. Custom actions can be used for various purposes, such as booking a restaurant, cash withdrawal, database query, API requests, etc. Custom actions can set slot values. Custom actions can look at previous conversations and be used to answer a query. Custom actions are a highly powerful tool.


A story is a formatted representation of a conversation between the user and the bot. It is used to train the bot’s dialogue management module. A story is defined using intents, entities, actions, slots, etc. It helps the bot to learn the relationship between the user’s message and the bot’s response/action. Defining a large number of stories helps the bot to generalise and handle unseen conversations as well.


Rules are quite similar to stories. However, a rule cannot be generalised to handle unseen conversations. Hence a rule is used to define a conversation that always follows a fixed path. For example, uttering goodbye when the user intends to depart is a rule.


The domain contains the intents, entities, slots, responses, forms, and actions that the bot requires to processes information and respond to the user.

Flow of Code

When the user inputs a message, RASA NLU extracts entities from the input text and classifies the message under one of the defined intents. Then based on the intent, extracted entities, slot values, rules, and defined stories, RASA Core predicts the next action, which can be a textual response, restaurant booking, or a custom function call. For the same input message, the bot may reply with a different response depending on the context based on the defined stories.

Finding a restaurant

We use Forms To find a restaurant. Forms are used to collect required data and store data in slots. For finding a restaurant, we need cuisine type, the number of people, outside sitting preference, etc. these are defined as slots, and forms ask the user for these values and based on user response, the form stores the slot values. When the bot encounters an intent to find a restaurant, then the bot activates the form where the bot asks the user for cuisine, number of people, etc. Bot checks the inputs given by the user using custom actions. If the input does not follow a certain constraint then the form once again asks for the input until it satisfies the constraint. For example, when the bot asks for the number of people and user replies -2 and since -2 is not a valid input form again asks the user for input. Once all the slots are filled, we run a custom action with the slot values set by form. This custom action queries the database for a suitable restaurant based on the slot values and returns the restaurants that satisfy the user’s requirements.

Web Application

Our web application consists of 2 main parts:

  • A Google Map pointer to the location required to the user
  • The conversations with the chatbot where the user can provide input and chatbot gives a response.

We have deployed our chatbot to the web as a Flask application. We set up a rasa server and then connect our web application to it.

When the user gives an input to the chatbot, the web application sends a POST request to the rasa server. The rasa server sends the appropriate response and the location name required to the user. The web application then generates the map embedding of the location and then displays the response and the Google Map pointer to the user.

Improvements and Future Work

  • We plan to make the data collection automated where anyone can input new data like a new restaurant that came up in Mangalore to the chatbot.
  • We plan to deploy the chatbot in NITK soon.
  • We are always trying to improve the performance and accuracy of our chatbot so that the users can have a seamless experience :)