Building a chat bot in 2022

Published Dec 01 2021 06:50 AM 1,673 Views
Microsoft

More and more customers adopt conversational agents to provide a chat based interaction with their end users. Typical scenarios include Question and Answer (QnA) bots for campus students, customer support bots reducing the load of the IT department or even e-shop ordering bots guiding you through various alternatives.

 

If you are looking into building a bot, the idea is to build with Power Virtual Agents (PVA) and extend with bot framework if needed. All data from PVA are stored in Dataverse which is a database as a service from the Power Platform. PVA offers analytics on top of the collected data and there is also the potential to export the data to datalake and perform further analysis if you want and you think that there is business value to do such an investment. You can also use https://aka.ms/pvaAnalytics as a base to build your own analytics on top of the dataverse data.

 

The advised way for integration with any third party system, like for example your ticketing system, is through power automate (something you may have heard in the past as Flows). There are connectors for multiple systems, and you can even use REST API. If you want, you can also implement that integration with Bot Framework Composer. Skills require a lot more effort and should be only used if there is a good technical reason, for example if you need high volume throughput, something that you may be looking at if you have at least a million requests per month. Also, the quota of power automate is included in the cost of the PVA.

 

You can have multiple PVA bots and environments, like dev/qa/prod. You can start by exporting and importing bots using solutions. The Power platform offers solutions for Application lifecycle management (ALM). The solution file is just a zip file that you can extract and you can version control and there are GitHub actions and Azure DevOps extensions to help you automate the process and build your CI/CD pipelines. The PVA product group has also created https://aka.ms/pvaArchitectureSeries which are sessions guiding you how to architect your PVA.

 

Regarding the website integration, you can use the default web site option. If you need complete control, PVA has tools that allows you to create a custom canvas. This is basically the javascript component that embeds PVA into a website. This is the advances scenario you can read in the Customize the web chat canvas article. You can see some advanced customization examples in the samples under the “Branding, styling, and customization” section.

 

Regarding multi-language support, although this is a highly requested feature, it is not currently available within the platform. For now, you can have multiple bots, one for each language and you can have an ALM process that tracks the changes on the main language bot and then implement them in the rest of the languages. To switch language on the UI side, you can do it in the javascript code. If you want to do the switch on the server side, then perhaps you can use the PowerVirtualAgentsSamples/RelayBotSample (github.com) to build the routing logic where the relay bot will be sending to the proper language. You can also base your code on this guide that puts a Microsoft Bot Framework bot in front of a PVA. Just note that this web app will effectively be the single point of failure for the bot and you have to ensure traits like high availability and scalability, that are features already baked in the PVA backends it will be talking to.

 

When it comes to QnA content, to define your exact strategy you will need to think of the following questions:

  • Do you have 1000 FAQs or 20?
  • Is it a single question with a single answer or do you have clarification questions as well, like building a decision tree?

Based on those answers, you can convert the existing content into a web page and import the topics from there as seen in this article. If you need more advanced control you can use QnA maker and import the content in various formats but this is not the advised way as more features will appear within PVA in the future.

 

Hope this helps and let us know in the comments if you have more topics you would like to ask.

2 Comments
%3CLINGO-SUB%20id%3D%22lingo-sub-2958578%22%20slang%3D%22en-US%22%3EBuilding%20a%20chat%20bot%20in%202022%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2958578%22%20slang%3D%22en-US%22%3E%3CP%3EMore%20and%20more%20customers%20adopt%20conversational%20agents%20to%20provide%20a%20chat%20based%20interaction%20with%20their%20end%20users.%20Typical%20scenarios%20include%20Question%20and%20Answer%20(QnA)%20bots%20for%20campus%20students%2C%20customer%20support%20bots%20reducing%20the%20load%20of%20the%20IT%20department%20or%20even%20e-shop%20ordering%20bots%20guiding%20you%20through%20various%20alternatives.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20are%20looking%20into%20building%20a%20bot%2C%20the%20idea%20is%20to%20build%20with%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpower-virtual-agents%2Ffundamentals-what-is-power-virtual-agents%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EPower%20Virtual%20Agents%20(PVA)%3C%2FA%3E%20and%20extend%20with%20%3CA%20href%3D%22https%3A%2F%2Fdev.botframework.com%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ebot%20framework%3C%2FA%3E%20if%20needed.%20All%20data%20from%20PVA%20are%20stored%20in%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowerapps%2Fmaker%2Fdata-platform%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDataverse%20which%20is%20a%20database%20as%20a%20service%20from%20the%20Power%20Platform%3C%2FA%3E.%20PVA%20offers%20analytics%20on%20top%20of%20the%20collected%20data%20and%20there%20is%20also%20the%20potential%20to%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowerapps%2Fmaker%2Fdata-platform%2Fexport-to-data-lake%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Eexport%20the%20data%20to%20datalake%3C%2FA%3E%20and%20perform%20further%20analysis%20if%20you%20want%20and%20you%20think%20that%20there%20is%20business%20value%20to%20do%20such%20an%20investment.%20You%20can%20also%20use%20%3CA%20href%3D%22https%3A%2F%2Faka.ms%2FpvaAnalytics%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Faka.ms%2FpvaAnalytics%3C%2FA%3E%20as%20a%20base%20to%20build%20your%20own%20analytics%20on%20top%20of%20the%20dataverse%20data.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20advised%20way%20for%20integration%20with%20any%20third%20party%20system%2C%20like%20for%20example%20your%20ticketing%20system%2C%20is%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpower-virtual-agents%2Fadvanced-flow%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ethrough%20power%20automate%3C%2FA%3E%20(something%20you%20may%20have%20heard%20in%20the%20past%20as%20Flows).%20There%20are%20connectors%20for%20multiple%20systems%2C%20and%20you%20can%20even%20use%20REST%20API.%20If%20you%20want%2C%20you%20can%20also%20implement%20that%20integration%20with%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpower-virtual-agents%2Fadvanced-bot-framework-composer%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EBot%20Framework%20Composer%3C%2FA%3E.%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpower-virtual-agents%2Fadvanced-use-skills%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ESkills%3C%2FA%3E%20require%20a%20lot%20more%20effort%20and%20should%20be%20only%20used%20if%20there%20is%20a%20good%20technical%20reason%2C%20for%20example%20if%20you%20need%20high%20volume%20throughput%2C%20something%20that%20you%20may%20be%20looking%20at%20if%20you%20have%20at%20least%20a%20million%20requests%20per%20month.%20Also%2C%20the%20quota%20of%20power%20automate%20is%20included%20in%20the%20cost%20of%20the%20PVA.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20have%20multiple%20PVA%20bots%20and%20environments%2C%20like%20dev%2Fqa%2Fprod.%20You%20can%20start%20by%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpower-virtual-agents%2Fauthoring-export-import-bots%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Eexporting%20and%20importing%20bots%20using%20solutions%3C%2FA%3E.%20The%20Power%20platform%20offers%20solutions%20for%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpower-platform%2Falm%2Fbasics-alm%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EApplication%20lifecycle%20management%20(ALM)%3C%2FA%3E.%20The%20solution%20file%20is%20just%20a%20zip%20file%20that%20you%20can%20extract%20and%20you%20can%20version%20control%20and%20there%20are%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpower-platform%2Falm%2Fdevops-github-actions%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EGitHub%20actions%3C%2FA%3E%20and%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpower-platform%2Falm%2Fdevops-build-tools%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20DevOps%20extensions%3C%2FA%3E%20to%20help%20you%20automate%20the%20process%20and%20build%20your%20CI%2FCD%20pipelines.%20The%20PVA%20product%20group%20has%20also%20created%20%3CA%20href%3D%22https%3A%2F%2Faka.ms%2FpvaArchitectureSeries%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Faka.ms%2FpvaArchitectureSeries%3C%2FA%3E%20which%20are%20sessions%20guiding%20you%20how%20to%20architect%20your%20PVA.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERegarding%20the%20website%20integration%2C%20you%20can%20use%20the%20default%20web%20site%20option.%20If%20you%20need%20complete%20control%2C%20PVA%20has%20tools%20that%20allows%20you%20to%20create%20a%20custom%20canvas.%20This%20is%20basically%20the%20javascript%20component%20that%20embeds%20PVA%20into%20a%20website.%20This%20is%20the%20advances%20scenario%20you%20can%20read%20in%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpower-virtual-agents%2Fcustomize-default-canvas%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ECustomize%20the%20web%20chat%20canvas%3C%2FA%3E%20article.%20You%20can%20see%20some%20advanced%20customization%20examples%20in%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2FBotFramework-WebChat%2Fblob%2Fmain%2Fsamples%2FREADME.md%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ethe%20samples%20under%20the%20%E2%80%9CBranding%2C%20styling%2C%20and%20customization%E2%80%9D%20section%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERegarding%20multi-language%20support%2C%20although%20this%20is%20a%20highly%20requested%20feature%2C%20it%20is%20not%20currently%20available%20within%20the%20platform.%20For%20now%2C%20you%20can%20have%20multiple%20bots%2C%20one%20for%20each%20language%20and%20you%20can%20have%20an%20ALM%20process%20that%20tracks%20the%20changes%20on%20the%20main%20language%20bot%20and%20then%20implement%20them%20in%20the%20rest%20of%20the%20languages.%20To%20switch%20language%20on%20the%20UI%20side%2C%20you%20can%20do%20it%20in%20the%20javascript%20code.%20If%20you%20want%20to%20do%20the%20switch%20on%20the%20server%20side%2C%20then%20perhaps%20you%20can%20use%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2FPowerVirtualAgentsSamples%2Ftree%2Fmaster%2FRelayBotSample%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EPowerVirtualAgentsSamples%2FRelayBotSample%20(github.com)%3C%2FA%3E%20to%20build%20the%20routing%20logic%20where%20the%20relay%20bot%20will%20be%20sending%20to%20the%20proper%20language.%20You%20can%20also%20base%20your%20code%20on%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpower-virtual-agents%2Fadvanced-use-dispatcher%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ethis%20guide%20that%20puts%20a%20Microsoft%20Bot%20Framework%20bot%3C%2FA%3E%20in%20front%20of%20a%20PVA.%20Just%20note%20that%20this%20web%20app%20will%20effectively%20be%20the%20single%20point%20of%20failure%20for%20the%20bot%20and%20you%20have%20to%20ensure%20traits%20like%20high%20availability%20and%20scalability%2C%20that%20are%20features%20already%20baked%20in%20the%20PVA%20backends%20it%20will%20be%20talking%20to.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20it%20comes%20to%20QnA%20content%2C%20to%20define%20your%20exact%20strategy%20you%20will%20need%20to%20think%20of%20the%20following%20questions%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EDo%20you%20have%201000%20FAQs%20or%2020%3F%3C%2FLI%3E%0A%3CLI%3EIs%20it%20a%20single%20question%20with%20a%20single%20answer%20or%20do%20you%20have%20clarification%20questions%20as%20well%2C%20like%20building%20a%20decision%20tree%3F%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EBased%20on%20those%20answers%2C%20you%20can%20convert%20the%20existing%20content%20into%20a%20web%20page%20and%20import%20the%20topics%20from%20there%20%3CA%20href%3D%22https%3A%2F%2Fsocial.technet.microsoft.com%2Fwiki%2Fcontents%2Farticles%2F53820.power-virtual-agents-faq-chatbot.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Eas%20seen%20in%20this%20article%3C%2FA%3E.%20If%20you%20need%20more%20advanced%20control%20you%20can%20use%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fcomposer%2Fhow-to-create-qna-kb%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EQnA%20maker%3C%2FA%3E%20and%20import%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fcognitive-services%2Fqnamaker%2Fconcepts%2Fdata-sources-and-content%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Econtent%20in%20various%20formats%3C%2FA%3E%20but%20this%20is%20not%20the%20advised%20way%20as%20more%20features%20will%20appear%20within%20PVA%20in%20the%20future.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHope%20this%20helps%20and%20let%20us%20know%20in%20the%20comments%20if%20you%20have%20more%20topics%20you%20would%20like%20to%20ask.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2958578%22%20slang%3D%22en-US%22%3E%3CP%3EMore%20and%20more%20customers%20ask%20us%20how%20to%20build%20a%20bot.%20We%20gathered%20a%20couple%20of%20frequent%20discussion%20topics%20we%20see%20with%20the%20customers%20and%20published%20them%20in%20this%20blog.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2958578%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EData%20%26amp%3B%20AI%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3034671%22%20slang%3D%22en-US%22%3ERe%3A%20Building%20a%20chat%20bot%20in%202022%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3034671%22%20slang%3D%22en-US%22%3E%3CP%3EMake%20sure%20you%20also%20check%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fpowervirtualagents.microsoft.com%2Fen-us%2Fblog%2Fcategory%2Fpowervirtualagents%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EPower%20Virtual%20Agents%20-%20Blog%20(at%20microsoft.com)%3C%2FA%3E%26nbsp%3Band%20don't%20miss%20the%20%22Power%20Virtual%20Agents%20In%20A%20Day%22%20live%20events%20at%26nbsp%3B%3CSTRONG%3E%3CA%20href%3D%22https%3A%2F%2Faka.ms%2FPVAIADevent%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Faka.ms%2FPVAIADevent%3C%2FA%3E%3C%2FSTRONG%3E%3CSPAN%3E.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Version history
Last update:
‎Dec 01 2021 06:50 AM
Updated by: