PwC and AWS Alliance

Continuous integration/continuous deployment (CI/CD) approach for conversational AI systems on AWS

  • Blog
  • 5 minute read
  • November 05, 2024

Nausheen Jawed

Director, Cloud & Digital Transformation, PwC US

Email

Ian Willoughby

Principal, Cloud & Digital Transformation, AWS Practice, PwC US

Email

Conversational AI systems are technologies designed to interact with users through natural language, either in text or spoken form, to help simulate human-like conversations.

Amazon Lex is a fully managed AI service featuring advanced natural language models. It can enable you to design, build, test, and deploy conversational interfaces within applications. Leveraging the same conversational engine that powers Alexa, it offers superior speech recognition and language understanding capabilities. With Amazon Lex, you can seamlessly integrate sophisticated, AI-driven chatbots into both new and existing applications.

When utilizing Amazon Lex, a question that’s commonly asked is how are regular changes to the bot deployed to multiple target environments using an automation first approach?
Like any other AWS service, Amazon Lex has automation capabilities that allow you to create chatbots and virtual assistants, with the ability to deploy them using infrastructure as code scripts.

There are multiple benefits of an automation first approach:

  • Rapid updates: Conversational AI systems often require frequent updates to improve accuracy, add new features, and address user feedback. DevOps practices can enable quick and reliable deployment of these updates.
  • User experience: Regular updates and improvements based on user feedback can enhance the overall user experience. Automated deployment confirms that updates are rolled out consistently across many instances of the conversational AI system.
  • Uptime: Conversational AI systems should be highly available, especially if they are customer-facing. DevOps practices such as continuous monitoring and automated recovery can help maintain high uptime. Monitoring tools can provide insights into system performance, user interactions, and potential bottlenecks, allowing for proactive issue resolution.

Automation facilitates the implementation of CI/CD pipelines, enabling continuous integration and continuous deployment practices. This allows for rapid iterations and improvements to your bots.

CI/CD approach for Amazon Lex using AWS CDK

Amazon Lex V2 bots can be deployed using AWS Cloud Development Kit (CDK). AWS CDK is an open-source software development framework that allows you to define cloud infrastructure using programming languages such as TypeScript, JavaScript, Python, Java, and C#.

The requirement with AWS CDK is to store the bot configuration files in S3. Designing a CI/CD pipeline that deploys the Lex bots to multiple AWS accounts and environments while storing the bot configuration files in S3 is a multi-step process.

Common requirements that teams want when building CI/CD pipelines for Amazon Lex bots

  • Ability to deploy the same bot configurations across multiple AWS accounts
  • Ability to conduct testing in a development environment by deploying multiple versions using CI/CD pipelines
  • Ability to deploy multiple bots at the same time as part of one release package
  • Ability to deploy the production bots from an artifact repository

The below picture outlines an approach to utilize CI/CD pipelines for Amazon Lex deployments.

How can the common requirements be achieved through this approach?

Enviroment Requirement Solution
Development Ability to conduct testing in a development environment using multiple bot configuration files.

The user has an ability to upload a new JSON bot configuration into the Dev S3 bucket. The dev CI/CD pipeline can deploy the updated bot configurations to the environment. 

The user can do this multiple times using different JSON bot configuration until it meets their requirements.

QA Ability to deploy multiple bots at the same time, as well as build an artifact of the bot that can be used in higher environments.

When the user is ready to promote a configuration to a QA environment, they can choose their required bot JSON and upload it to a specific release S3 bucket. They can do this for multiple bots – where each bot has its unique configuration file. 

The QA CI/CD pipeline can recognize new versions of the bots uploaded in the release S3 bucket. It can build an artifact with the bot configuration, store it in an artifact repository while deploying the bot to the QA environment.

Production Ability to deploy the production bots from an artifact repository that was tested in a lower environment.

When the user is ready to promote a configuration to a prod environment, the prod CI/CD pipeline takes the recent artifact deployed in QA from the artifact repository.

This allows us to deploy a previously tested version of the bot in Production.

There isn't a one-size-fits-all CI/CD (continuous integration/continuous deployment) strategy for Amazon Lex bots, as different applications and organizational needs may require tailored approaches. However, a structured CI/CD pipeline for Amazon Lex bots can enhance development efficiency, establish quality, and facilitate rapid deployment.

We’ve outlined one such approach for a CI/CD pipeline against common requirements for various clients. Reach out to us with your challenges in designing CI/CD pipelines for Amazon Lex.

Follow us