Two Real-World AWS AI Use Cases to Improve Your Daily Workflow

Discover how AWS AI technologies like Q Developer Agent, Bedrock, and Comprehend can enhance your daily workflow, automate tasks, and boost productivity in areas such as framework upgrades and email management.

Cover for Two Real-World AWS AI Use Cases to Improve Your Daily Workflow

6 min read


The rise of artificial intelligence (AI) has empowered businesses and individuals to automate complex and repetitive tasks, streamlining daily workflows and saving valuable time. AWS is already the leader in cloud computing and has been at the forefront of this revolution with cutting-edge AI tools like AWS Q Developer Agent, Bedrock, Amazon Comprehend, and others. These technologies enable seamless integration of AI into everyday tasks, making them invaluable for developers, researchers, and enterprises.

In this blog post, we will explore two real-world applications of AWS AI technologies and how they can transform daily work processes, boosting efficiency and driving innovation. This post is based on my experience discussing with different clients at StratusGrid how they could start using AI for real-world problems instead of just talking about the buzz words but not really implementing them.

Upgrade Java Versions using Amazon Q Developer Agent for Code Transformation

Upgrading Java versions in large codebases can be a complex and time-consuming task. The Amazon Q Developer Agent for code transformation simplifies this process by automating many steps. For now, it can only upgrade Java 8 and Java 11 code to Java 17. Here’s how it works:

Prerequisites and Setup

Before starting the transformation process, ensure that:

  • Your project is a Java 8 or Java 11 project built on Maven (version 3.8 or later).
  • The project builds successfully in your IDE within 55 minutes.
  • You have the correct JDK version installed locally (matching your source code version).
  • Your project doesn’t require access to private network resources or use plugins that package non-Java languages.
  • Your IDE (JetBrains or Visual Studio Code) is correctly configured with the correct JDK and language level settings.

Transformation Process

Open your project in the IDE and use the Amazon Q chat panel to start the transformation by typing /transform. Amazon Q will then build your project locally and analyze the codebase to create a customized transformation plan.

The agent upgrades your Java code based on the transformation plan. It updates deprecated code components and adjusts syntax to be compatible with Java 17. As changes are made, it rebuilds and runs existing unit tests, fixing encountered errors iteratively.

After transformation, you can review the changes in a diff view. Amazon Q provides a detailed summary of the upgrades made. You can then decide to accept them or make manual changes.

This automated process significantly reduces the time and effort required for Java version upgrades, allowing developers to focus on more critical tasks while ensuring code quality and compatibility with the latest Java features.

CAUTION

If you don’t already have good unit tests, you will probably get a lot of errors, and the transformation will fail. In that case, you can use Amazon Q to write unit tests for the code and ensure they all pass on your project before performing the upgrade.

Automated Security Fixes

While AWS officially supports Java for code transformations with Amazon Q Developer Agent, we have successfully used Amazon Q at StratusGrid to scan and fix security vulnerabilities in other languages, for example, Python. The checks include static application security testing (SAST), secrets detection, and infrastructure as code (IaC) scanning.

When Amazon Q discovers a potential security vulnerability or quality issue, it generates a finding describing the issue and a recommended fix. Some findings include an automatic fix, which can update your code files in place. You can enable auto-scans that assess your code as you write it, providing real-time feedback on potential security and quality issues.

Automated Email Sorting and Labelling with AWS AI Services

Organizing your inbox is a tedious but necessary task. Instead of manually sorting through hundreds of emails daily, you can deploy an AWS-powered AI agent to do the job for you. You can automate email sorting and labeling using AWS Lambda in combination with Amazon Comprehend for Natural Language Processing (NLP). Here’s a more detailed look at how this process works:

  1. Email Retrieval: A Lambda function is triggered by Amazon EventBridge (formerly CloudWatch Events) on a schedule or Google Pub Sub every time a message is sent to your inbox. The Lambda function uses the Gmail API to fetch the content of the email, including the subject and body.

  2. Natural Language Processing: The Lambda Function calls Amazon Comprehend is used to analyze the email content. It can perform various NLP tasks, such as:

    • Entity recognition to identify important names, organizations, or dates
    • Key phrase extraction to summarize the main points of the email
    • Sentiment analysis to gauge the tone of the message In this example, we want Amazon Comprehend to be able to understand the content of the email and proceed to classify it.
  3. Classification: Using Amazon Comprehend’s custom classification feature, we can categorize the email content into predefined classes such as “Reply Immediately”, “Informational Only”, or “Irrelevant”. This process involves:

    • Training a custom classification model using a dataset of pre-labeled emails
    • Using the trained model to classify new incoming emails in real-time
    • The model can handle various input types, including plain text emails, PDF attachments, or even transcribed voice messages (when combined with Amazon Transcribe)
    • For semi-structured documents like PDFs or scanned files, we would use a model specifically trained on such formats for optimal accuracy
  4. Labelling: Another Lambda function calls the Gmail API to apply the appropriate label to the email based on its classification.

Here’s a sample AWS CLI command that you can use to test locally the email classification:

aws comprehend classify-document \
     --endpoint-arn arn:aws:comprehend:us-east-1:112233445566:endpoint/email-classification-endpoint \
     --text 'Hi Ivan, I am sending you a message to schedule a meeting next week so we can talk about AWS Certifications. Are you available at 9am on October 10th? Have a good day!'

Conclusion

AI-powered technologies are the next big thing, and AWS has already taken it to realms you could never have imagined. With tools like AWS Q Developer Agents for code transformations, Amazon Comprehend for intelligent email management, and innovative uses of Amazon Bedrock for automated security fixes, companies can take their daily workflow performance up by multiple levels. By utilizing these AWS AI tools, you’re not just fine-tuning certain aspects of the processes; you are laying a groundwork for future groundbreaking ideas. You can use the time saved from routine tasks to generate new ideas, be present with customers or work on higher-level challenges.

If you would like to learn more about what AWS AI can do for your business or personal workflow, reach out to me to me on the contact form or let’s set up a time to talk so we can explore the potential of implementing AI in your workflow.


Share this post!