AWS Builder Center

Building TaskTriage: My First AI Agent Using Amazon Bedrock and Lambda

A hands-on walk-through of how I built an AI agent to parse messages, extract action items, and draft replies using Amazon Bedrock Nova Lite and Python on AWS Lambda.

Building your first serverless generative AI app is always an exciting milestone. As part of my journey in the Udacity Future AWS Agent Engineer track, I set out to solve a very common daily problem: managing cluttered notifications and message overload.
To fix this, I built TaskTriage—a lightweight AI agent that automatically reads incoming messages, determines their urgency, extracts actionable steps, and writes helpful reply drafts.
Here is a breakdown of how I built it using Python and AWS serverless tools, along with a few lessons I learned along the way.



The Architecture & Tooling

I kept the stack lean, fast, and cost-effective by focusing on three main components:
  • Amazon Bedrock (Nova Lite): Chosen because it is fast, affordable to run, and exceptionally good at following precise formatting instructions.
  • AWS Lambda: Hosts the backend logic written in Python using  boto3  to trigger Bedrock and return structured data.
  • System Prompting: Configured system instructions to force the model to respond with structured JSON rather than conversational text.



Development Process & Key Steps

1. Choosing the Model

I selected Amazon Nova Lite in Amazon Bedrock. For micro-tasks like categorizing text and summarizing action items, Nova Lite gives fast responses without burning through unnecessary token costs.

2. Crafting the System Prompt

To ensure the output was clean and predictable, I wrote system instructions in Python enforcing four key fields:
  • Urgency Rank: Rated as Low, Medium, High, or Critical.
  • Category: Marked as Work, Personal, or Admin.
  • Action Items: A bulleted list of tasks that need completion.
  • Suggested Reply: A short, ready-to-send draft response.

3. Connecting the Backend

Inside the AWS Lambda function, I used  boto3  to invoke the Bedrock runtime API, pass the user's message payload, and capture the returned payload cleanly.



Challenges I Ran Into

No first build goes entirely without hiccups! Two main things stood out during development:
  1. IAM Permissions: By default, Lambda roles don't have permission to call Bedrock. I had to explicitly configure the execution role in IAM with  bedrock:InvokeModel  permissions.
  1. Prompt Tuning: Initially, the model kept adding polite conversational intro text (like "Sure, here is your summary:"). I had to refine the system instructions to strictly enforce returning only formatted text.



What's Next?

Building TaskTriage proved how accessible serverless Generative AI on AWS really is once you connect the dots between Lambda and Bedrock. My next step is expanding this agent to automatically create reminders or calendar events based on the extracted action items!
Have you experimented with Amazon Nova Lite or Bedrock inside serverless functions? Let me know in the comments below!
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article