Power Virtual Agent – Under the hood

If I have to summarize the Power Virtual Agent in a single word – it is magical.

Well, nothing is magical. There is a hardworking team, infrastructure and supporting services behind it. In this post, let’s go under the hood of the Power Virtual Agent (PVA) and see all the moving parts involved.

As I have mentioned before, Power Virtual Agent (PVA) is built on top of the Microsoft Bot Framework. The Bot Framework is advanced, powerful open source undertaking that requires developers to build and deploy bots.

Any bots created using the bot framework extensively uses Natural Language Parsing (NLP) and there is definitely some value in understanding how NLP is used in the context of bot as and eventually how this all ties with the Power Virtual Agents.

Natural Language Parsing

Natural Language Parsing is the single most important thing that drives all the Personal Assistants such as Siri, Alexa and Google Assistant.

Here is how any Natural Language Parsing service works:

There are three key parts – Utterance, Entity and Intent.

Utterance is typically what the customer says to the bot. It could be “Set an alarm for 8 AM” or “Send a message to John that I’m running late” or “Take me home”.

Entity is a key piece that is derived from the customer’s utterance. There can be one or more entities in an utterance. For instance, in “Set an alarm for 8 AM” – 8 AM is the entity. In “Send a message to John that I’m running late”, “John” and “I’m running late” are entities. Finally in “Take me home”, “home” is the entity. By now you might have understood the pattern of how to find the entities in the utterance.

Intent is, as you might have guessed, is the intent of the customer derived from the utterance. For instance in “Set an alarm for 8 AM”, the intent is “Set Alarm”, “Take me home”, “Get Direction” is the intent.

Usually Natural Language Parsing involves an administrator to explicitly create intents, entities and many utterances to support the intents. More the utterance, the better the NLP is in deriving the intents and entities for new utterances from the customers. But a point to highlight is that there is a bit of tasks involved to set these up and every time you add/modify utterance, intents or entities, you need to train the Natural Language Parsing model that generalises the algorithm and trains itself to derive intents and entities from new utterances.

Okay, now how does it all ties together with the Power Virtual Agent? Remember the trigger phrases that you add as part of your topic? Those are equivalent to Utterances and the Topics is equivalent to Intents.

PVA also supports entities in a way that is user-friendly.

A common example of an entity is that when the bot asks the customer “Which city do you live in?”, The user may choose to say “Calgary” or they may say “I live in Calgary”. In first response, the bot immediately identifies “Calgary” as the city and it may continue the conversation in the context of Calgary. In the latter response, how does the bot understand to parse out “Calgary” from that sentence and treat it as the city name? This is where entity helps out. PVA comes with many common entities prebuilt and you can create custom entities based on your business needs.

Unlike any Natural Language Parser products in the market, when you setup new Topics or Trigger phrases in the PVA, you do not train each and every time. For that matter, the entire concept of Utterance, Intent and Entities are cleverly abstracted from you so you are not bogged down by the underlying moving parts, allowing you to just focus on authoring the bots intuitively. This kind of abstraction to the natural language parsers is something unique in the industry.

Bot Service Channel Integration

Let’s say you build a bot with the Bot Framework and publish it to one of your websites and as part of the process, you embed the chat widget on the website. This chat widget is powered by a component called “WebChat” that sugar coats and abstracts all the complexity of dealing with the Bot Framework’s SDK/API. The WebChat connects to the bot using “Direct Line API” under the hood. Ideally, any bot created using the Bot Framework can be directly invoked using “Direct Line API” (even without the WebChat) if you know to pass the parameters the way the Direct Line API expects.

When you embed the PVA bot on a custom web page, all you embed is a WebChat interface. As PVA is built on Bot Framework, every time you interact with the PVA bot, the WebChat constructs and issues a request to the Direct Line API to get the response back and serve it up in the format that the customer understands.

To summarize, any bot regardless of whether it is created using the Bot Framework or the PVA, can be accessed using the Direct Line API. The bot developed using the Bot Framework can be enhanced by adding additional code to integrate with the PVA bots leveraging the Direct Line API. This kind of integration scenarios enable us to enjoy the best of both the worlds while delivering a creative and cost effective solution to the customers. If you want to learn more about the Bot Service integration, refer this documentation.

Take sometime to familiarize yourself with some of the components that make up the Bot Framework. This will give you a different perspective of understanding the Power Virtual Agent.

Hope you found this post useful!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s