AWS Logo
Menu
Amazon Q: Your GenAI Assistant for Business Processes, Code Reviews, and Documentation

Amazon Q: Your GenAI Assistant for Business Processes, Code Reviews, and Documentation

Your Generative AI assistant - Amazon Q! Use it to optimize business processes, Code reviews, documentation and more!

Published Dec 14, 2024
If you followed re:Invent 2024, you likely noticed that Generative AI/ML was one of the hottest topics. In addition to Amazon Bedrock and Sage Maker, there were numerous sessions dedicated to Amazon Q. According to the session catalog, around 100 sessions, including breakout sessions, were conducted, covering topics such as Amazon Q Business, Amazon Q Developer, and Amazon Q Quick Sight.
In this article, let's see two quick examples of how Amazon Q can help.
In first example, I will use Amazon Q to ask questions about AWS account resources, like how many EC2 in the account, or how many APIs in the account, How many S3 buckets etc.?
In the second example, I will show how Amazon Q can help with code documentation or even with some code refactor!
Prerequisites
  • Familiarity with the AWS Management Console.
  • A basic understanding of Amazon Q.
  • Access to VS Code IDE with:
    • The AWS Toolkit installed.
  • A basic knowledge of Python programming.
Let's get started:
  • What is Amazon Q?
  • First Example: Amazon Q as your go to assistant for your account questions
  • Second Example: Amazon Q as your assistant to document your code or refactor
What is Amazon Q
Amazon Q is a Generative AI assistant designed to enhance efficiency across various domains, similar to other Generative AI technologies. It provides valuable support for businesses by streamlining knowledge management, automating repetitive tasks, and assisting professionals across diverse roles.
Here's how Amazon Q can help:
  • Business Users: Simplifies knowledge management and automates routine tasks.
  • Data Engineers: Assists with data analysis and insights generation.
  • Call Center and Supply Chain Associates: Supports domain-specific tasks by integrating with services like AWS Connect.
  • Developers and Software Engineers: Integrates with IDEs to enhance productivity, offering features like:
    • Code documentation and review
    • Unit test generation
    • Code refactoring and optimization
Amazon Q is available in several specialized variants to suit different business use cases, including:
  • Amazon Business Q
  • Amazon Developer Q
  • Amazon Q for Connect
  • Amazon Q for QuickSight
  • And more
In this article, I’ll demonstrate examples of Amazon Q for AWS Account and Amazon Q Developer for VS Code.
First Example: Amazon Q as your go to assistant for your account questions
Amazon Q can become your go-to assistant for account-related questions, saving you valuable time. While it’s possible to look up the same information manually or through various reports, Amazon Q simplifies the process by providing quick, at-a-glance insights at your fingertips whenever you need them.
Here are a few examples of questions you can ask:
  • How many EC2 instances are running in the account?
  • How many APIs are deployed?
  • How many S3 buckets exist?
  • What is my average monthly cost?
  • And more!
To engage Amazon Q in your account, log in to the AWS Management Console and click on the Amazon Q icon.
Amazon Q
Amazon Q
Example Prompts and Results
Prompt:
I asked Amazon Q, "How many S3 buckets do I have?"
Prompt
Prompt
Result:
Amazon Q analyzed the resources in my account and summarized that I have 11 S3 resources.
Result
Result
Prompt:
Next, I wanted to check my average cost over the last three months, so I asked Amazon Q, "What is my average cost in the last 3 months?"
Prompt
Prompt
Result:
Amazon Q provided a clear breakdown of my average monthly cost based on the last three months of account data.
Result
Result
This concludes our overview of Amazon Q for AWS accounts. Next, let’s explore how Amazon Q Developer can act as your assistant for code-related tasks.
Second Example: Amazon Q as your assistant to document your code or refactor
Amazon Q Developer is GenAI powered assistant that can be embedded in your IDE such as VS Code. When Amazon Q Developer is used in in the IDE, it can provide recommendation to optimize the code, refactor the code, can generate comments/doc for the code and can also scan the code for security vulnerabilities.
Example Code snippet
 
Code Snippet
Code Snippet
Right click and ask Amazon Q to Refactor
Code Snippet
Code Snippet
Amazon Q not only created the function but it also provided an example of how to use this function in your code.
Example of how to use the function:
Code snippet
Code Snippet
While Amazon Q provided the recommended code, developer retain the final control and can select if recommended code should be inserted or rejected.
In 2024, Amazon Q introduced inline chat feature, allowing you to add prompts directly within the code at the cursor. This enhancement further simplifies the use of Generative AI-assisted Amazon Q, increasing efficiency. The more time you save in your software development cycle, the more time you can dedicate to developing additional features, accelerating the software's speed to market.
Inline chat
 
Inline Chat
Inline Chat
And here is the resulted code, recommended by Amazon Q.
Inline Chat Result
Inline Chat Result
These recommendations either can be accepted or rejected by the developer.
Let's look at another feature. Amazon Q can help add comments/document the code.
Document the code by adding comments
Inline Chat
Inline Chat
And here is the resulted code, comments added by Amazon Q.
Inline Chat Result
Inline Chat Result
Again, These recommendations either can be accepted or rejected by the developer.
Conclusion
GenAI-based solutions are here to stay, as they continue to revolutionize technology's impact on businesses. Implementing these solutions with appropriate guardrails enables businesses to optimize repetitive tasks and enhance customer service.
Amazon Q is one such GenAI tool, catering to both business SMEs and technical SMEs with features tailored to their specific needs. For instance, business users can leverage Amazon Q to interact with policy documents, while engineers can use it for code optimization, code reviews, and documentation assistance.
As these solutions advance, I remain committed to exploring their potential and sharing valuable insights with you. Stay tuned for more content!
Thank you for reading!
Watch the video here:
https://www.youtube.com/watch?v=fVgW0o-UToU
𝒢𝒾𝓇𝒾𝓈𝒽 ℬ𝒽𝒶𝓉𝒾𝒶
𝘈𝘞𝘚 𝘊𝘦𝘳𝘵𝘪𝘧𝘪𝘦𝘥 𝘚𝘰𝘭𝘶𝘵𝘪𝘰𝘯 𝘈𝘳𝘤𝘩𝘪𝘵𝘦𝘤𝘵 & 𝘋𝘦𝘷𝘦𝘭𝘰𝘱𝘦𝘳 𝘈𝘴𝘴𝘰𝘤𝘪𝘢𝘵𝘦
𝘊𝘭𝘰𝘶𝘥 𝘛𝘦𝘤𝘩𝘯𝘰𝘭𝘰𝘨𝘺 𝘌𝘯𝘵𝘩𝘶𝘴𝘪𝘢𝘴𝘵
 

Comments