This post shows you how to create an automated email response solution using Amazon Bedrock and its features, including Amazon Bedrock Agents, Amazon Bedrock Knowledge Bases, and Amazon Bedrock Guardrails.
Amazon Bedrock is a fully managed service that makes the foundational models (FM) of leading AI startups and Amazon Web Services available via API. So you can choose from a wide range of FMs to find the best model for your use case. Amazon Bedrock provides a serverless experience, so you can get started quickly, privately customize FM with your own data, integrate it into your applications using AWS tools, and deploy it without managing any infrastructure.
Using Amazon Bedrock and other AWS services, you can build generative AI-based email support solutions to streamline email management and improve overall customer satisfaction and operational efficiency.
Knowledge management challenges
Email serves as an important communication tool for businesses, but traditional processing methods, such as manual processing, are often insufficient to handle the large volume of incoming messages. This can lead to inefficiencies, delays, errors, and decreased customer satisfaction.
Key challenges include the need for ongoing training for support staff, the difficulty of managing and retrieving scattered information, and maintaining consistency across different agent interactions.
Organizations have extensive repositories of digital documents and data, but they can be unstructured, distributed, and underutilized. Additionally, specific APIs and applications exist to handle customer service tasks, but they often work in silos and are not integrated.
Benefits of AI-powered solutions
To address these challenges, companies are deploying generative AI to automate and refine their email response processes. The integration of AI reduces response times, improves the accuracy and relevance of communications, and improves customer satisfaction. With AI-driven solutions, organizations can overcome the limitations of manual email processing, streamline operations, and improve the overall customer experience.
A robust AI-driven email support agent should have the following capabilities:
- Access and apply knowledge comprehensively – Extract and use information from a variety of file formats and data stores across your organization to inform customer interactions.
- Seamless integration with APIs – Interact with existing business APIs to perform real-time actions such as transaction processing and customer data updates directly via email.
- Build in continuous awareness – Continuously integrating new data, such as updated documents or revised policies, allows your AI to recognize and use the latest information without retraining.
- Maintain security and compliance standards – Adhere to required data security protocols and industry-specific compliance obligations to protect sensitive customer information and maintain trust. Implement governance mechanisms to ensure AI-generated responses align with brand standards and regulatory requirements, and prevent irrelevant communications.
Solution overview
This section provides an overview of an architecture designed for an email support system using generative AI. The following diagram shows the integration of various components that are important for improving customer email processing.
The solution consists of the following components:
- Email Service – This component manages incoming and outgoing customer emails and serves as the primary interface for email communications.
- AI-powered email processing engine – At the heart of the solution, this engine uses AI to analyze and process emails. Work with databases and APIs to extract the information you need to determine the appropriate response and provide timely and accurate customer service.
- Information Repository – This repository stores important documents and data that support customer service processes. The AI ​​engine accesses this resource to obtain the relevant information needed to effectively respond to customer inquiries.
- Business Applications – This component performs specific actions identified from email requests, such as processing transactions and updating customer records, allowing you to meet customer needs quickly and accurately.
- Non-Functional Requirements (NFR) – These include:
- Security – Maintain customer trust by protecting data and ensuring secure interactions throughout.
- Monitoring – Monitor system performance and user activity to maintain operational reliability and efficiency.
- Performance – Increase the efficiency and speed of email responses to maintain customer satisfaction.
- Brand Protection – Maintain the quality and consistency of customer interactions and protect your company’s reputation.
The following diagram details the architecture for using generative AI to power email support. The system integrates various AWS services and custom components to efficiently and effectively automate customer email handling and processing.
The workflow includes the following steps:
- Amazon WorkMail manages your customers’ incoming and outgoing email. When a customer sends an email, WorkMail receives it and calls the next component in the workflow.
- The email handler AWS Lambda function is called by WorkMail when an email is received, and acts as an intermediary to receive the request and pass it on to the appropriate agent.
- These AI agents process email content, apply decision-making logic, and draft email responses based on customer inquiries and relevant data accessed.
- Guardrails ensure that interactions adhere to predefined standards and policies to maintain consistency and accuracy.
- The system uses Amazon OpenSearch Service to index and quickly retrieve documents and files stored in Amazon Simple Storage Service (Amazon S3). These indexed documents provide a comprehensive knowledge base for AI agents to reference to inform their responses.
- Business APIs are called by the AI ​​agent when it needs to perform a specific transaction or update in response to a customer request. The API ensures that the actions taken are appropriate and accurate according to the instructions processed.
- The response email is finalized by the AI ​​agent and then sent to Amazon Simple Email Service (Amazon SES).
- Amazon SES sends the response back to the customer, completing the interaction loop.
Deploy the solution
To evaluate this solution, we provided sample code that allows users to make restaurant reservations via email and ask other questions about the restaurant, such as menu offers. See the GitHub repository for deployment instructions.
The general deployment steps are as follows:
- Install the required prerequisites such as the AWS Command Line Interface (AWS CLI), Node.js, AWS Cloud Development Kit (AWS CDK), clone the repository, and install the required NPM packages.
- Deploy the AWS CDK project to provision the required resources in your AWS account.
- Follow the post-deployment instructions in the README file in the GitHub repository to configure your email support account to receive emails in WorkMail and invoke your Lambda function when emails are received.
After a successful deployment (which may take 7-10 minutes to complete), you can begin testing your solution.
Test the solution
This solution uses Amazon Bedrock as an example to automate restaurant table reservations and menu inquiries. However, similar approaches can be applied to different industries and workflows. Traditionally, customers would send emails to restaurants requesting these services, and staff would have to respond manually. By automating these processes, the solution streamlines operations, reduces manual effort, and improves the user experience by providing real-time responses.
You can test the ability of our generative AI system to process requests, make reservations, and provide menu information while adhering to guardrails by sending an email to our support email address.
- In the WorkMail console, open the organization gaesas-stk-org-
Move to. - Select (Users) in the navigation pane and go to Support Users.
- Find this user’s email address.
- Use your preferred email application to send an email requesting information from your automated support account.
The following diagram shows a conversation between a customer and an automated support agent.
cleaning
To clean up your resources, run the following command from your project’s folder:
conclusion
In this post, we explored how to integrate AWS services to build a generative AI-based email support solution. By using WorkMail to handle email traffic, Lambda for processing logic, and Amazon SES to dispatch responses, the system efficiently manages and responds to customer emails. Additionally, the Amazon Bedrock agent, complemented with guardrails and supported by an information repository powered by OpenSearch Service, ensures that responses are accurate and comply with regulatory standards. This integrated use of AWS services not only streamlines email management, but also ensures that customer interactions are handled accurately, increasing overall customer satisfaction and operational efficiency. I will.
You can adapt and extend the business logic and processes demonstrated in this solution to meet your organization’s specific needs. Developers can modify Lambda functions, update the knowledge base, and adjust agent behavior to meet unique business requirements. This flexibility allows you to customize your solution and seamlessly integrate with your existing systems and workflows.
About the author
Manu Mishra He is a Senior Solutions Architect at AWS with over 16 years of experience in the software industry, specializing in artificial intelligence, data and analytics, and security. His expertise spans strategic oversight and hands-on technical leadership, reviewing and guiding the work of both internal and external clients. Manu works with AWS customers to develop technology strategies and align technology and organizational goals that drive impactful business outcomes.
AK Soni As a Senior Technical Account Manager for AWS Enterprise Support, he helps enterprise customers achieve their business goals by providing proactive guidance on implementing innovative cloud and AI/ML-based solutions aligned with industry best practices. We help you achieve it. With over 19 years of experience in enterprise application architecture and development, he leverages his expertise in generative AI technologies to enhance business operations and overcome existing technological limitations. As part of AWS’s AI/ML community, AK guides customers in designing generative AI solutions, trains AWS employees passionate about AI/ML to gain membership in the AWS generative AI community, and helps customers with generative AI. We provide valuable insights and recommendations for harnessing your power. .