With the proliferation of AI, chatbots are evolving as a mandatory enterprise tool. However, it is imperative that they qualify on some “must-have” design requirements e.g. always-on, security etc. This paper presents an architectural approach for an efficient chatbot design which can fully meet these tenets by the use of proxy patterns, based on the OOAD methodology for design, and explains in depth the reasons and advantages of this pattern over others.
Businesses now increasingly focus on enhancing user experience and agile decision making with users being at the core of all business strategies. The user-enterprise relationship has inverted and enterprise boundaries are evaporating.
In order to fulfil these requirements, enterprises need a smart and intelligent virtual assistant or a chatbot. A human-like virtual assistant allows people and websites/mobile devices to engage in intelligent conversations via any interactive channel and in multiple languages. These digital virtual agents are highly contextual, allowing them to adopt any physical appearance or personality.
In principle, chatbots need to embody all the attributes of a next generation smart application such as:
- Client-Aware - Adapts to device capabilities (mobile, browser, SKYPE etc.), is responsive to form factors, behaves native and also provides consistent experiences across all channels
- Context-Aware - Is aware of user context as well as extreme user personalization
- Intelligent - Leverages ML, NLP etc. for human-like conversations with highly contextual response generation
- Always On - Works 24/7,365 days a year, while dynamically scaling up/down with user additions or deletions, is auto-scalable and elastic, self-configurable etc.
- Security - Has the right security framework to shield sensitive business information since chatbots interact with multiple users like employees, customers and vendors.
So, what should the right architectural approach be - one that encapsulates all of the above? We explore OOAD-based design as a strong candidate for chatbot architecture. Object-oriented design is an old paradigm in enterprise architecture. This can be applied successfully to build a chatbot.
Let’s consider a simple basic use case where a user interacts with a chatbot and the following interaction ensues:
- User query is ambiguous and needs more probing from the bot
- User ask is understood via query classification and associated intent
- User is looking for some information which is available in the back-end systems. Bot needs to invoke cognitive search and provide a contextual response to the user
In an enterprise scenario, cognitive chat capabilities could be built leveraging a homegrown AI stack, or the more prevalent approach of customizing APIs offered by the likes of Wipro HOLMES, IBM Watson, Google, Amazon, etc. An organization may start with a vendor but subsequently move to another. The main reason for this migration could be availability of better AI features, pricing etc. Hence, the chatbot design should use the right architectural pattern to support this migration with minimal or zero disruption in an already established operation. Proxy pattern- a software design pattern, is a solution that is a subset of the larger broker pattern and is highly recommended for a chatbot design.
Proxy pattern: This pattern decouples server from client by the use of an intermediate proxy. Clients (UI) can initiate requests that the proxy can marshal to the server object that renders the cognitive services. The main benefit of this is that since the server can physically reside remotely in other address spaces, apart from the client’s server, this pattern is, by default, suitable for a distributed computing. Another advantage is that the proxy pattern helps to provide a security by shielding the server storing the organization's critical data.
The above scenarios can easily be modelled as a simple sequence diagram to illustrate the types of objects needed to build a chat and their interaction.