AWS Connect and Lex — Automate Your Customer Support

By | Alexa, AWS, Blogs, Botzer | No Comments

Written By: Rachana Sharma, Software Engineer, Powerupcloud Technologies

Ever since AWS Connect was announced, we have been waiting for an excuse to get our hands on it and put it to use for solving a real-world use case. Soon enough, we were presented with the opportunity to automate voice-based IVR support for a large government entity in Singapore.

Regular readers of this blog might be aware that we have a thriving enterprise chatbot platform, and our product are used by multiple enterprise customers. So with the experience of deploying chatbots under our belt, when we ran into something like AWS Connect, it made perfect sense to integrate with Lex to automate voice-based IVR customer support. Why settle for text when you can make them bots talk 😉

That’s exactly what we did and this post explains how we made Connect, AWS Lambda, and Lex work together along with our Botzer engine at a high level.

Some of the queries handled by our final deployed solution are below:

  • Verifying user’s identity using NRIC number from the database
  • Verifying user’s mobile number using OTP authentication
  • Providing user a personalized response post verification
  • Allowing user to make transactions

AWS Connect And Contact Flows

After you set up your first AWS connect instance (tip: go through this video)you will be able to make calls to a customer care solution. Every activity on AWS connect including the IVR played is a contact flow. A contact flow is an editable roadmap directing the customer experience of the contact center. You can edit all contact flows in the contact flow module of the Routing menu.

The first Contact flow played as IVR to the user is Sample inbound flow (first call experience). You can edit this flow to put customized flows in IVR.

  1. Edit Get customer input module: The Sample IVR gives you 7 predefined options. we have reduced it to 4 DTMF input where each will perform specific operations. After you edit this module by double-clicking you can see an output connection for branching all 4 respective options.
  1. For each of the specified DTMF input, we have used the transfer to flow module in Transfer/Terminate menu. We can edit a transfer to flow to specify the contact flow name to be called when the respective button is pressed. The flow needs to be published so that it comes in the search menu to select a flow option.

Enable call recording: The module is available in the Set section of flow modules. We can edit call recording behaviour by double-clicking the module and choosing one of the following:

  • None
  • Agent and Customer
  • Agent only
  • Customer only

This will save your recording in the S3 bucket mentioned in the setting of the AWS connect Data storage section.

Store customer input to Contact attribute:

We can store customer’s input to contact attribute using store customer input module in interact section. You need to specify text for which user will type this value. This value will get saved as a system attribute. We can use the Set Contact attributes module to assign a key to this value so that we pass this key as an attribute other Lambda, Lex modules or use it in other contact flows.

Lambda Integration with Connect

Amazon Connect can successfully invoke a Lambda function in an AWS account when a resource policy has been set on the Lambda function. you can follow this link to set a resource policy for lambda and see sample request response from lambda to AWS connect.

Use Case: Buy CDP data

  1. This contact flow Calls lambda function to send OTP: We need to give full ARN of Lambda function. We are sending the user’s mobile number as a system attribute and NRIC number as a user-defined attribute( Taken from the first flow from a user) to lambda.

Lambda will get an event with a mobile number in it and make a rest call to send OTP to the user. We are using the AWS SNS service to send a message to the mobile. We can avoid using REST and put all the code in Lambda if we make a deployment package. Details of creating a deployment package here.

Following is the code for sending the OTP:

2) After the Lambda function sends an OTP to the user’s mobile IVR will ask for verification: Aws connect can take a user’s input in Store Customer input block of interact menu. We can branch the activity further based on the customer’s input using Check contact attribute module in the Branch menu. Here we are, authentication users, if the user types the correct OTP otherwise returning him to the main flow with a failed authentication message.

Lex integration with AWS connect

Amazon Lex is a service for building conversational interfaces using voice and text. By integrating these two services you can take advantage of Lex‘s automatic speech recognition (ASR) and natural language processing/understanding (NLU) capabilities to create great self-service experiences for your customers.

Use Case Opening of a CDP account

  1. We need to first add our Lexbot to connect to start using it in our Contact flows. To do this from the AWS console we need to go to our AWS instance settings and add bots in contact flows section.
  1. We can start building a contact flow by dragging Get customer Input from the interact menu. After dragging double click on the block and set the input to Amazon Lex and specify the name and Alias. you can also send a session attribute to the bot.
  1. We have created a Lex bot that will trigger for slots if the intent of the user is “open CDP account”. On fulfilment of all the required slots, Lex will call the Lambda function to connect integration.
  1. The Lambda function will fetch the slot values from the event sent and make a POST call to REST API which will insert a record of the user in DB and send an Email to the customer with his details using AWS SES service.

On successful execution of Lambda flow will be transferred again from lex to aws connect.

We will soon publish the relevant code used for this on GitHub and update this post.

Hope you found this useful. Happy customer servicing! 🙂

Making procurement a breeze for a large Telco – Botzer in action

By | Botzer | No Comments

Written by Sahil Verma, Former Product Manager — Conversational AI at Powerupcloud Technologies.

Procurement is a dreaded vertical in any company, the sheer amount of data, multiple stakeholders involved, a host of unrecorded transactions happening offline. Procurement has always been a complex function not only the execution function but the conceptual level itself. Most of the procurement functions are traditional in nature, with hardly any centralized Enterprise repository containing the complete data. This makes the job of the procurement department, coordinating & responding to the vendor & internal buyers queries extremely difficult.

Now imagine an Enterprise, which is spread across geographies, having a workforce of over 25,000 employees and 2 subsidiaries equally large. The enterprise has a comprehensive procurement function, frequently engaging in the procurement of goods and services. A nightmare for the department. The largest telecommunications company in the APAC gets an excessive amount of calls, emails & even social media requests to the internal procurement help-desk. These queries are mostly related to the policy details & Frequently Asked Questions on these policies.

The telecommunications giant approached the Powerup Advanced Services Group (ASG) team to help decongest the bandwidth for the support team. With a conversational expertise Powerup, ASG has developed, building an Enterprise-class chatbot platform, analyzed the conversations the support team has had with the procurement, as well as the employees. The basic tenet for successful conversational automation is to automate the processes/queries which bring down the repetitive tasks at least by 90%. The powerup team was able to identify the top 90% queries from the transactional conversation’s data set (call records, emails, etc.). These 90% queries were then automated on Botzer, the enterprise-class chatbot solution, that could help the entire organization with the procurement policies and FAQs, without which the help-desk would be the single point of contact for any procurement-related queries. The chatbot not only aimed at reducing the manual load on the current procurement helpdesk team but also aimed at reducing the TAT (turnaround time), by at least 80%.

To start with, the most important part of the procurement function — procurement policies and procurement processes were identified for automation.

Design Approach

A very important aspect of a conversational interface is to give it a believable persona, something that the users can relate to. Since the target audience was the internal Singtel employees, who raise procurement requests, while the bot was providing a professional service to the employee by resolving their professional queries, the bot was given a professional and a compliant persona. The bot was a professional bot, which would resolve the user’s queries within 2–3 conversations and would be empathetic to the user queries (being a user query automation chatbot).

The next step was to name the bot, for the employees to relate with. The name ‘Claire’ comes out of ‘Clarity’ — this was an appropriate name for this chatbot as this bot will provide clarity on users’ procurement-related queries.

A very important principle for chatbot design is to have a guided flow for the users, highlighting the scope & the coverage of the bot queries. Along with this, it should allow open conversations, to allow users to have a free flow of conversations with the bot.

The following points were a critical piece for the chatbot solution design:

  1. Guided Flows
    Let the user know the bot’s knowledge scope, by communicating very clearly what the chatbot is capable of. This includes giving users well-articulated, menu options. These options were designed to be clickable, as well as conversational.

2. Suggestions
To give users a better conversational experience & an empathetic persona, the bot doesn’t only answer user queries, it also gives suggestions for the next possible questions from the user.

3. Easy to Read Information
A very important component of a bot is the User experience. How the bot not only converses with the users but also how easily the users can navigate via the bot. Presenting information in a readable manner with the user, the swipeable carousel elements enhance the user experience.

4. Analytics Dashboard
Any conversational interface needs continuous improvement, not only in terms of Natural Language Processing, but also queries to be automated. For the, a continuous monitoring & reporting system is foremost for the business users to analyze the Bot & its performance. Analytics which give insights about the most frequently asked questions and unanswered queries which can help the training of the bot further.

Most of the queries could be classified under a limited set of service queries.

Powerupcloud’s Botzer was a perfect fit for the telecom giant, with readymade modules & integrations available.

Continuous Improvement

The chatbot will get smarter based on the chat history from the users. A dedicated business continuously reviews the list of unanswered queries on a weekly basis and trains the bot to understand these queries.


Claire has been successful in Claire-ifying user queries and is now an integral part of the procurement ecosystem within the organization. Claire is available in all important procurement-related employee portals of the telecom giant.

The chatbot is capable of handling over 200 concurrent queries at a moment and has also reduced the amount of time the helpdesk team spent on answering the employee queries by more than 50% within a month of go-live.