Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 16, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      May 16, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 16, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 16, 2025

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025

      Minecraft licensing robbed us of this controversial NFL schedule release video

      May 16, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      The power of generators

      May 16, 2025
      Recent

      The power of generators

      May 16, 2025

      Simplify Factory Associations with Laravel’s UseFactory Attribute

      May 16, 2025

      This Week in Laravel: React Native, PhpStorm Junie, and more

      May 16, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025
      Recent

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Build your multilingual personal calendar assistant with Amazon Bedrock and AWS Step Functions

    Build your multilingual personal calendar assistant with Amazon Bedrock and AWS Step Functions

    July 3, 2024

    Foreigners and expats living outside of their home country deal with a large number of emails in various languages daily. They often find themselves struggling with language barriers when it comes to setting up reminders for events like business gatherings and customer meetings. To solve this problem, this post shows you how to apply AWS services such as Amazon Bedrock, AWS Step Functions, and Amazon Simple Email Service (Amazon SES) to build a fully-automated multilingual calendar artificial intelligence (AI) assistant. It understands the incoming messages, translates them to the preferred language, and automatically sets up calendar reminders.

    Amazon Bedrock is a fully managed service that makes foundation models (FMs) from leading AI startups and Amazon available through an API, so you can choose from a wide range of FMs to find the model that’s best suited for your use case. With Amazon Bedrock, you can get started quickly, privately customize FMs with your own data, and easily integrate and deploy them into your applications using AWS tools without having to manage any infrastructure.

    AWS Step Functions is a visual workflow service that helps developers build distributed applications, automate processes, orchestrate microservices, and create data and machine learning (ML) pipelines. It lets you orchestrate multiple steps in the pipeline. The steps could be AWS Lambda functions that generate prompts, parse foundation models’ output, or send email reminders using Amazon SES. Step Functions can interact with over 220 AWS services, including optimized integrations with Amazon Bedrock. Step Functions pipelines can contain loops, map jobs, parallel jobs, conditions, and human interaction, which can be useful for AI-human interaction scenarios.

    This post shows you how to quickly combine the flexibility and capability of both Amazon Bedrock FMs and Step Functions to build a generative AI application in a few steps. You can reuse the same design pattern to implement more generative AI applications with low effort. Both Amazon Bedrock and Step Functions are serverless, so you don’t need to think about managing and scaling the infrastructure.

    The source code and deployment instructions are available in the Github repository.

    Overview of solution

    Figure 1: Solution architecture

    As shown in Figure 1, the workflow starts from the Amazon API Gateway, then goes through different steps in the Step Functions state machine. Pay attention to how the original message flows through the pipeline and how it changes. First, the message is added to the prompt. Then, it is transformed into structured JSON by the foundation model. Finally, this structured JSON is used to carry out actions.

    The original message (example in Norwegian) is sent to a Step Functions state machine using API Gateway.
    A Lambda function generates a prompt that includes system instructions, the original message, and other needed information such as the current date and time. (Here’s the generated prompt from the example message).

    Sometimes, the original message might not specify the exact date but instead says something like “please RSVP before this Friday,” implying the date based on the current context. Therefore, the function inserts the current date into the prompt to assist the model in interpreting the correct date for this Friday.

    Invoke the Bedrock FM to run the following tasks, as outlined in the prompt, and pass the output to the next step to the parser:

    Translate and summarize the original message in English.
    Extract events information such as subject, location, and time from the original message.
    Generate an action plan list for events. For now, the instruction only asks the FM to generate action plan for sending calendar reminder emails for attending an event.

    Parse the FM output to ensure it has a valid schema. (Here’s the parsed result of the sample message.)

    Anthropic Claude on Amazon Bedrock can control the output format and generate JSON, but it might still produce the result as “this is the json {…}.” To enhance robustness, we implement an output parser to ensure adherence to the schema, thereby strengthening this pipeline.

    Iterate through the action-plan list and perform step 6 for each item. Every action item follows the same schema:

    {
              “tool_name”: “create-calendar-reminder”,
              “parameters”: {
                “body”: “Jeff, the CEO, invites employees to …”,
                “raw_body”: “Kjære ansatte,nnVi ..”,
                “subject”: “Winter fun and team building event”,
                “start_datetime”: “2024-05-30T10:00:00Z”,
                “end_datetime”: “2024-05-30T23:00:00Z”,
                “location”: “Holmenkollbakken, Oslo”
              }
    }

    Choose the right tool to do the job:

    If the tool_name equals create-calendar-reminder, then run sub-flow A to send out a calendar reminder email using Lambda Function.
    For future support of other possible jobs, you can expand the prompt to create a different action plan (assign different values to tool_name), and run the appropriate action outlined in sub-flow B.

     Done.

    Prerequisites

    To run this solution, you must have the following prerequisites:

    An AWS account
    Enable model access to the Anthropic Claude 3 Sonnet model on Amazon Bedrock in the deployment AWS Region by following the steps in Amazon Bedrock access setup.
    Create and verify identities in Amazon SES: If your Amazon SES is in sandbox mode, you must verify the email addresses of the sender and recipient.

    Deployment and testing

    Thanks to AWS Cloud Development Kit (AWS CDK), you can deploy the full stack with a single command line by following the deployment instructions from the Github repository. The deployment will output the API Gateway endpoint URL and an API key.

    Use a tool such as curl to send messages in different languages to API Gateway for testing:

    apigw=[THE_VALUE_OF_GenaiCalendarAgentStack.APIUrl]
    apikey=[THE_VALUE_OF_GenaiCalendarAgentStack.GeneratedAPIKeyValue]
    curl -v $apigw –header “Content-Type: application/json” –header “x-api-key:$apikey” -d @./doc/sample-inputs/norsk1.json

    Within 1–2 minutes, email invitations should be sent to the recipient from your sender email address, as shown in Figure 2.

    Figure 2: Email generated by the solution

    Cleaning up

    To avoid incurring future charges, delete the resources by running the following command in the root path of the source code:

    $ cdk destroy

    Future extension of the solution

    In the current implementation, the solution only sends out calendar reminder emails; the prompt only instructs the foundation model to generate action items where tool_name equals create-calendar-reminder. You can extend the solution to support more actions. For example, automatically send an email to the event originator and politely decline it if the event is in July (summer vacation for many):

    Modify the prompt instruction: If the event date is in July, create an action item and set the value of tool_name to send-decline-mail.
    Similar to the sub-flow A, create a new sub-flow C where tool_name matches send-decline-mail:

    Invoke the Amazon Bedrock FM to generate email content explaining that you cannot attend the event because it’s in July (summer vacation).
    Invoke a Lambda function to send out the decline email with the generated content.

    In addition, you can experiment with different foundation models on Amazon Bedrock, such as Meta Llma 3 or Mistral AI, for better performance or lower cost. You can also explore Agents for Amazon Bedrock, which can orchestrate and run multistep tasks.

    Conclusion

    In this post, we explored a solution pattern for using generative AI within a workflow. With the flexibility and capabilities offered by both Amazon Bedrock FMs and AWS Step Functions, you can build a powerful generative AI assistant in a few steps. This assistant can streamline processes, enhance productivity, and handle various tasks efficiently. You can easily modify or upgrade its capacity without being burdened by the operational overhead of managed services.

    You can find the solution source code in the Github repository and deploy your own multilingual calendar assistant by following the deployment instructions.

    Check out the following resources to learn more:

    Visit aws community to discover how our builder communities are using Amazon Bedrock in their solutions.
    Learn more about Generative AI on AWS
    Learn more about Amazon Bedrock

    About the Author

    Feng Lu is a Senior Solutions Architect at AWS with 20 years professional experience. He is passionate about helping organizations to craft scalable, flexible, and resilient architectures that address their business challenges. Currently, his focus lies in leveraging Artificial Intelligence (AI) and Internet of Things (IoT) technologies to enhance the intelligence and efficiency of our physical environment.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticlePrivacy Meets Performance: GPT4All 3.0 Redefines Local AI Interaction
    Next Article Medical content creation in the age of generative AI

    Related Posts

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-47916 – Invision Community Themeeditor Remote Code Execution

    May 16, 2025
    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-31637 – LambertGroup SHOUT SQL Injection

    May 16, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    Solution Highlight – Oracle Fusion and Salesforce – Part 3

    Development

    NVIDIA RTX 5060 Ti review roundup: A “decent enough product” that launched into a chaotic tech market

    News & Updates

    Big Announcements from Laracon EU 2025 (and my opinion)

    Development

    Apple to Pay Siri Users $20 Per Device in Settlement Over Accidental Siri Privacy Violations

    Development

    Highlights

    Development

    Google Cloud KMS Adds Quantum-Safe Digital Signatures to Defend Against Future Threats

    February 24, 2025

    Google Cloud has announced quantum-safe digital signatures in Google Cloud Key Management Service (Cloud KMS)…

    This $28 ‘magic arm’ makes taking pictures so much easier (and it’s only $20 for Black Friday)

    November 22, 2024

    13 Best Free and Open Source Java Micro-Frameworks

    December 18, 2024

    I’m trying to be fair to the new Claw AI+ handhelds, but MSI isn’t making it easy

    January 24, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.