<section class="blog-post-content"><p>The rise of artificial intelligence technologies enables organizations to adopt and improve self-service capabilities in contact center operations to create a more proactive, timely, and effective customer experience. Voice bots, or conversational interactive voice response systems (IVR), use natural language processing (NLP) to understand customers’ questions and provide relevant answers. Businesses can automate responses to frequently asked transactional questions by deploying bots that are available 24/7. As a result, customers benefit from reduced wait time and faster call resolution time, especially during peak hours.</p><p>In the post <a href="https://aws.amazon.com/blogs/machine-learning/enhancing-customer-service-experiences-using-conversational-ai-power-your-contact-center-with-amazon-lex-and-genesys-cloud/" target="_blank" rel="noopener noreferrer">Enhancing customer service experiences using Conversational AI: Power your contact center with Amazon Lex and Genesys Cloud</a>, we introduced <a href="https://aws.amazon.com/lex/" target="_blank" rel="noopener noreferrer">Amazon Lex</a> support on the Genesys Cloud platform and outlined the process of activating the integration. In this post, we demonstrate how to elevate traditional customer service FAQs with an interactive voice bot. We dive into a common self-service use case, explore Q&A interactions, and offer an automated approach using <a href="https://aws.amazon.com/blogs/machine-learning/creating-a-question-and-answer-bot-with-amazon-lex-and-amazon-alexa/" target="_blank" rel="noopener noreferrer">QnABot on AWS Solution</a> built on Amazon Lex with Genesys Cloud.</p><h2>Solution overview</h2><p>Informational interactions are widely applicable, with examples such as hours of operation, policy information, school schedules, or other frequently asked questions that are high volume and straightforward. The solution discussed in this post enables customers to interact with a voice bot backed by a curated knowledge base in a natural and conversational manner. Customers can get answers without having to wait for a human customer service representative, thereby improving resolution time and customer satisfaction. You can also implement the same bot directly as a web client, or embed it into an existing site as a chat widget, expanding touch points through multiple channels and increasing overall engagement with customers.</p><p>For a demo video describing the experience of a customer dialing into a contact center and interacting with QnABot, check out the below video:</p><p>QnABot provides a preconfigured architecture that delivers a low-code experience, as shown in the following diagram. Behind the scenes, it uses Amazon Lex along with other AWS services. Non-technical users can deploy the solution with the click of a button, build their bot through a user-friendly interface, and integrate the voice bot into a Genesys Cloud call flow.</p><p><a href="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image001.png"><img class="alignnone wp-image-42478 size-full" src="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image001.png" alt="solution workflow" width="1430" height="1045" /></a></p><p>The solution workflow contains the following steps:</p><ol><li>The admin deploys the QnABot solution into their AWS account, opens the Content Designer UI, and uses <a href="https://aws.amazon.com/cognito/" target="_blank" rel="noopener noreferrer">Amazon Cognito</a> to authenticate.</li><li>After authentication, <a href="https://aws.amazon.com/cloudfront/" target="_blank" rel="noopener noreferrer">Amazon CloudFront</a> and <a href="https://aws.amazon.com/s3/" target="_blank" rel="noopener noreferrer">Amazon Simple Storage Service</a> (Amazon S3) deliver the contents of the Content Designer UI.</li><li>The admin configures questions and answers in the Content Designer, and the UI sends requests to <a href="https://aws.amazon.com/api-gateway/" target="_blank" rel="noopener noreferrer">Amazon API Gateway</a> to save the questions and answers.</li><li>The Content Designer <a href="https://aws.amazon.com/lambda/" target="_blank" rel="noopener noreferrer">AWS Lambda</a> function saves the input in <a href="https://aws.amazon.com/opensearch-service/" target="_blank" rel="noopener noreferrer">Amazon OpenSearch Service</a> in a questions bank index.</li><li>The admin activates the Amazon Lex integration on Genesys Cloud, exports a sample flow from the Content Designer UI, and imports this flow into Genesys Cloud using the Genesys Archy tool.</li><li>The customer dials into Genesys Cloud and begins an interaction with QnABot. Genesys Cloud streams this audio to Amazon Lex, which converts the audio to text and calls the Bot Fulfillment Lambda function.</li><li>The Bot Fulfillment function takes the user input and looks up the answer in OpenSearch Service. Alternatively, you can use <a href="https://aws.amazon.com/kendra/" target="_blank" rel="noopener noreferrer">Amazon Kendra</a> if an index is configured and provided at the time of deployment. The answer is synthesized into voice by <a href="https://aws.amazon.com/polly/" target="_blank" rel="noopener noreferrer">Amazon Polly</a> and played back to the customer.</li><li>User interactions with the Bot Fulfillment function generate logs and metrics data, which are sent to <a href="https://aws.amazon.com/kinesis/data-firehose/" target="_blank" rel="noopener noreferrer">Amazon Kinesis Data Firehose</a> then to Amazon S3 for later data analysis.</li></ol><p>To implement this solution, we walk through the following steps:</p><ol><li>Enable Amazon Lex V2 integration with Genesys.</li><li>Configure Archy, the Genesys Cloud Architect YAML processor.</li><li>Export the Genesys call flow from the QnABot Content Designer.</li><li>Import and publish the call flow with Archy.</li><li>Import example questions to QnABot.</li><li>Create a test call and interact with the bot.</li><li>Customize the call flow in Genesys Architect.</li></ol><h2>Prerequisites</h2><p>To get started, you need the following:</p><ul><li>An <a href="https://signin.aws.amazon.com/signin?redirect_uri=https%3A%2F%2Fportal.aws.amazon.com%2Fbilling%2Fsignup%2Fresume&amp;client_id=signup" target="_blank" rel="noopener noreferrer">AWS account</a></li><li>An active deployment of <a href="https://aws.amazon.com/solutions/implementations/aws-qnabot/" target="_blank" rel="noopener noreferrer">QnABot on AWS</a> (version 5.1.0 or later)</li><li>A Genesys Cloud organization</li></ul><h2>Enable Amazon Lex V2 integration with Genesys Cloud</h2><p>The first step is to enable Amazon Lex V2 integration with Genesys Cloud. For instructions, refer to <a href="https://aws.amazon.com/blogs/machine-learning/enhancing-customer-service-experiences-using-conversational-ai-power-your-contact-center-with-amazon-lex-and-genesys-cloud/" target="_blank" rel="noopener noreferrer">Enhancing customer service experiences using Conversational AI: Power your contact center with Amazon Lex and Genesys Cloud</a>.</p><h2>Configure Archy</h2><p>We have prepared a sample inbound call flow to get you started with QnABot and Genesys Cloud. We use Archy, the Genesys Cloud Architect YAML processor tool, to publish this call flow. You must first generate an OAuth client ID and client secret, then you can download and configure Archy.</p><h3>Generate an OAuth client ID and client secret</h3><p>Archy requires either a client ID and secret pair or an authorization token. For more information about Archy’s OAuth requirements, refer to <a href="https://developer.genesys.cloud/devapps/archy/install#prerequisites" target="_blank" rel="noopener noreferrer">Prerequisites</a> in the Archy installation documentation.</p><p>To generate a client ID and secret pair, complete the following steps:</p><ol><li>On the Genesys Cloud Admin page, navigate to <strong>Integrations</strong>, then choose <strong>OAuth</strong>.</li><li>Choose <strong>Add Client</strong>.</li><li>For <strong>App Name</strong>, enter <code>QnABot</code>.</li><li>For <strong>Description</strong>, enter a description.</li><li>For <strong>Grant Types</strong>, select <strong>Client Credentials</strong>.</li></ol><p>A new <strong>Roles</strong> tab appears.</p><p><a href="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image002.jpg"><img class="alignnone size-full wp-image-42479 c4" src="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image002.jpg" alt="configure OAuth" width="844" height="568" /></a></p><ol start="6"><li>On the <strong>Roles</strong> tab, assign a role that has Architect > flow > publish permissions.</li></ol><p>In the following screenshot, we’re assigning the <code>admin</code> role. You may have to also assign the <code>Master Admin</code> role.</p><ol start="7"><li>Choose <strong>Save</strong>.</li></ol><p><a href="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image003.jpg"><img class="alignnone size-full wp-image-42480 c4" src="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image003.jpg" alt="set up admin role" width="844" height="564" /></a></p><ol start="8"><li>On the <strong>Client Details</strong> tab, copy the values for the client ID and client secret.</li></ol><p><a href="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image004.jpg"><img class="alignnone size-full wp-image-42481 c4" src="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image004.jpg" alt="configure client credential" width="844" height="564" /></a></p><h3>Download and configure Archy</h3><p><a href="https://developer.genesys.cloud/devapps/archy/install" target="_blank" rel="noopener noreferrer">Download</a> and unzip the appropriate version of Archy for your operating system. Then navigate to the folder in a terminal and begin the setup process by running the following command:</p><p><a href="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image005.jpg"><img class="alignnone size-full wp-image-42477 c4" src="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image005.jpg" alt="welcome page for Archy" width="844" height="438" /></a></p><p>Continue through the Archy setup, and provide the client ID and client secret when prompted.</p><h2>Export the call flow YAML from the QnABot Content Designer</h2><p>Now that Archy is authorized to publish call flows, we export the preconfigured call flow from the QnABot Content Designer.</p><ol><li>Log in to the <strong>QnABot Content Designer</strong>.</li><li>On the <strong>Tools</strong> menu, choose <strong>Genesys Cloud</strong>.</li></ol><p><a href="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image006.jpg"><img class="alignnone size-full wp-image-42482 c4" src="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image006.jpg" alt="Genesys Cloud in QnABot Content Designer" width="398" height="150" /></a></p><ol start="3"><li>Choose <strong>Next</strong> until you reach the <strong>Download Call Flow</strong> section.</li><li>Choose <strong>Download Inbound Call Flow</strong>.</li></ol><p><a href="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image007.jpg"><img class="alignnone size-full wp-image-42483 c4" src="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image007.jpg" alt="download call flow" width="844" height="362" /></a></p><p>You download a file named <code>QnABotFlow.yaml</code>, which is a preconfigured Genesys call flow.</p><ol start="5"><li>Copy this file to the same folder Archy is located in.</li></ol><h2>Import and publish the call flow with Archy</h2><p>To publish the call flow to Archy, run the following command:</p><p>When complete, a new inbound call flow named <code>QnABotFlow</code> is available in Genesys Architect.</p><p><a href="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image008.jpg"><img class="alignnone size-full wp-image-42484 c4" src="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image008.jpg" alt="import call flow into Architect" width="844" height="562" /></a></p><p>To assign this call flow, on the Genesys Cloud Admin page, navigate to <strong>Routing</strong> and choose <strong>Call Routing</strong>.</p><p>The new <code>QnABotFlow</code> should appear in the list of call flows under <strong>Regular Routing</strong>. Assign the flow, then choose <strong>Save</strong>.</p><p><a href="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image009.jpg"><img class="alignnone size-full wp-image-42485 c4" src="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image009.jpg" alt="configure call routing" width="844" height="564" /></a></p><h2>Import example questions to QnABot</h2><p>Navigate back to the QnABot Content Designer, choose the <strong>Tools</strong> menu, and choose <strong>Import</strong>.</p><p><a href="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image010.jpg"><img class="alignnone size-full wp-image-42486 c4" src="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image010.jpg" alt="import sample questions" width="416" height="502" /></a></p><p>Expand <strong>Examples/Extensions</strong>, find the GenesysWizardQnA example, and choose <strong>Load</strong>.</p><p><a href="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image011.jpg"><img class="alignnone size-full wp-image-42487 c4" src="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image011.jpg" alt="load sample questions" width="844" height="82" /></a></p><p>If you navigate back to the main questions and answers page, you now have the <code>GenesysHelper</code> questions. These are a set of example questions and answers for you to get started.</p><p><a href="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image012.jpg"><img class="alignnone size-full wp-image-42488 c4" src="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image012.jpg" alt="sample question overview" width="844" height="588" /></a></p><h2><strong>Create a test phone call and interact with the bot</strong></h2><p>Back to Genesys Cloud Admin, make sure you have an inbound phone number associated with the <code>QnABotFlow</code> call flow under <strong>Call Routing</strong>. We now navigate to the agent desktop and make a test call to interact with the bot for the first time.</p><p><a href="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image013.png"><img class="alignnone size-full wp-image-42489 c4" src="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image013.png" alt="configure test call" width="936" height="528" /></a></p><p>QnABot is designed to answer questions based on the data preconfigured in the Content Designer. Let’s try the following:</p><ul><li>What is your business hour?</li><li>What is the meaning of life?</li></ul><p>Each time QnABot provides an answer, you have the option to ask another question, conclude the call by saying “Goodbye,” or ask to be connected to a human agent by saying “I would like to speak to an agent.”</p><h2>Customize the call flow with Genesys Architect</h2><p>The Genesys call flow is preconfigured to enable specific Amazon Lex session attributes. For example, if you edit the question with ID <code>GenesysHelper.Hours</code>, the answer contains the following statement:</p><p>This is based on <a href="https://catalog.us-east-1.prod.workshops.aws/workshops/20c56f9e-9c0a-4174-a661-9f40d9f063ac/en-US/qna/handlebars" target="_blank" rel="noopener noreferrer">Handlebars</a>, and allows you to set values for session attributes. The exported Genesys Cloud CX call flow contains a block that reads back the value of the <code>genesys_nextPrompt</code> session attribute, which is only spoken by the Genesys call flow.</p><p>To branch to a queue or another call flow, a QnABot answer can use <code>setSessionAttr</code> to set <code>genesys_nextAction</code> to a specific value. An example of this is in the question with ID <code>GenesysHelper.Agent,</code> where the answer has <code>{{setSessionAttr 'nextAction' 'AGENT'}}</code>. In the call flow’s QnABot reusable task, there is a switch block that reads the value of this attribute to branch to a specific action. The example call flow contains branches for <code>AGENT</code>, <code>MENU</code>, and <code>END</code>. If there is no value for the <code>genesys_nextAction</code> session attribute, the call flow plays back any string found in the <code>genesys_nextPrompt</code> content, or the value of the <code>defaultPrompt</code> task variable defined at the beginning of the main flow, which is set by default to <code>ask another question or say return to main menu</code>.</p><p>The following diagram illustrates the main call flow.</p><p><a href="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image014.jpg"><img class="alignnone size-full wp-image-42490 c4" src="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image014.jpg" alt="primary call flow" width="844" height="892" /></a></p><p>The following diagram illustrates the flow of the reusable task.</p><p><a href="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image015.jpg"><img class="alignnone size-full wp-image-42491 c4" src="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/09/13/ML-5214-image015.jpg" alt="reusable task" width="844" height="610" /></a></p><h2>Clean up</h2><p>To avoid incurring future charges, delete the resources created via the template by navigating to the <a href="http://aws.amazon.com/cloudformation" target="_blank" rel="noopener noreferrer">AWS CloudFormation</a> console, selecting the QnABot stack created by the template, and choosing <strong>Delete</strong>. This removes all resources created by the template.</p><p>To remove the resources in Genesys Cloud, first remove the call flow from call routing. Then delete the call flow from Genesys Architect.</p><h2>Conclusion</h2><p>In this post, we walked through how to get started with QnABot and Genesys Cloud with an easy-to-deploy, readily usable solution to address a transactional interaction use case. This voice bot frees your customer service representatives to spend time with your customers on more complex tasks, and provides users with a better experience through self-service. Customer satisfaction increases, while costs decrease, because you’re consuming fewer connected minutes and maximizing agent utilization.</p><p>To get started, you can <a href="https://aws.amazon.com/solutions/implementations/aws-qnabot/" target="_blank" rel="noopener noreferrer">launch QnABot with a single click</a> and go through the <a href="https://catalog.us-east-1.prod.workshops.aws/v2/workshops/20c56f9e-9c0a-4174-a661-9f40d9f063ac/en-US/" target="_blank" rel="noopener noreferrer">QnABot Workshop</a> to learn about additional features. Amazon Lex integration is available on <a href="https://appfoundry.genesys.com/filter/genesyscloud/listing/933c1db5-bee4-4c4e-8ec3-2e61c1cfeb0b" target="_blank" rel="noopener noreferrer">Genesys AppFoundry</a>.</p><h3>About the Authors</h3><p class="c5"><strong><a href="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/05/20/chris-headshot.png"><img class="size-full wp-image-36760 alignleft" src="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2022/05/20/chris-headshot.png" alt="" width="100" height="100" /></a>Christopher Lott</strong> is a Senior Solutions Architect in the AWS AI Language Services team. He has 20 years of enterprise software development experience. Chris lives in Sacramento, California, and enjoys gardening, aerospace, and traveling the world.</p><p class="c5"><strong><a href="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2021/07/28/Jessica-Ho.jpg"><img class="size-full wp-image-26667 alignleft" src="https://d2908q01vomqb2.cloudfront.net/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59/2021/07/28/Jessica-Ho.jpg" alt="" width="100" height="133" /></a>Jessica Ho</strong> is a Solutions Architect at Amazon Web Services, supporting ISV partners who build business applications on AWS. She is passionate about creating differentiated solutions that unlock customers for cloud adoption. Outside of work, she enjoys turning her garden into a mini jungle.</p></section>