SYSTEM DESIGN

  • Home
  • System design

System Architecture

AvaBot application system consists of several components. Users can interact with AvaBot on web-chat and multiple applications to which it channels. The bot source code is deployed to Azure Cloud by using Azure Bot Service. AvaBot is connected to a QnA Maker with rich knowledge base that allows it to answer a variety of questions. Document processing functionalities are integrated to AvaBot by APIs, which can be accessed by performing http requests. Due to the high complexity and dependency on environment, QA system has been placed to a virtual machine in order to optimize its performance.

Activity Processing Sequence

AvaBot communicates with users by using activity objects, the sequence diagram below shows how it works. Some concepts from the Bot Framework SDK could aid in the understanding the user-bot communication mechanism:

term definition
Activity an activity is every interaction between the user (or a channel) and the bot.
Turn a turn consists of the user's incoming activity to the bot and any activity the bot sends back to the user as an immediate response.
Adapter the adapter has a process activity method for starting a turn, it also formats and sends response activities.
TurnContext the turn context object provides information about the activity needed to process the activity.


Activities arrive at the bot from the Bot Framework Service via an HTTP POST request. Activities sent from the bot to the channel are sent on a separate HTTP POST, both with a 200 HTTP status code. In the diagram, the bot replied to the “hi” with another message activity containing “hi” as well. The activity is carried as JSON in the HTTP POST body. This JSON is deserialized to create the activity object that is then handed to the adapter through its process activity method. On receiving the activity, the adapter creates a turn context and calls the middleware. The turn context provides send, update, delete activity response methods for the bot to send outbound activities in response to an inbound activity. 

DialogueFlow Diagram

AvaBot is born with multiple features, it is thus necessary to organize a reasonable way how users can choose to utilize its different functionalities. AvaBot’s dialogue flow was deliberately designed to make its communications with people as effective, as intuitive, as little of resistance as possible.