AWS Builder Center
How I Built an AI Email Assistant Using Amazon Bedrock, Lambda, and S3

How I Built an AI Email Assistant Using Amazon Bedrock, Lambda, and S3

Learn how I built Inbox Sentinel, an event-driven AI email assistant using Amazon Bedrock, Lambda, S3, DynamoDB, SNS, SES, API Gateway, and EventBridge. Along the way, I share the architecture, deployment process, debugging journey, and practical lessons from building a production-style AI pipeline.

Building an AI-Powered Inbox Assistant on AWS with Amazon Bedrock and Serverless Services

Most of us start the day by scanning our inbox and deciding what deserves attention. I wanted to automate that process, so I built Inbox Sentinel, an AI-powered inbox assistant that summarizes incoming emails and documents, highlights urgent items, and presents everything on a live dashboard.
The project became a great opportunity to learn serverless AWS services, Infrastructure as Code with AWS SAM, and Amazon Bedrock. Along the way, I also ran into an unexpected issue that had nothing to do with my application code but taught me an important lesson about AWS Marketplace billing.

What Inbox Sentinel Does

Inbox Sentinel is an event-driven AI pipeline that processes incoming content automatically.
When a new email or file arrives, it is summarized using Claude on Amazon Bedrock. The summary is stored, urgent messages generate alerts, and every processed item is displayed on a web dashboard.
The goal was simple:
Spend less time triaging emails and more time responding to the ones that actually matter.

Solution Architecture

The application follows a serverless, event-driven architecture.
When a file is uploaded to an Amazon S3 bucket, it automatically triggers an AWS Lambda function. Lambda extracts the content, sends it to Claude on Amazon Bedrock for summarization, stores the processed result in Amazon DynamoDB, and publishes an Amazon SNS notification if the content appears urgent.
Email processing follows a similar path. Since Gmail doesn't natively trigger AWS events in this setup, Amazon EventBridge invokes another Lambda function every five minutes to check the Gmail API for new messages. Any newly discovered emails are passed into the same processing pipeline.
To visualize the results, I built a lightweight dashboard hosted as a static website in Amazon S3. Amazon API Gateway connects the frontend with backend APIs, allowing processed summaries to be viewed in real time while also supporting drag-and-drop file uploads.

AWS Services Used

Service
Purpose
AWS SAM CLI
Deploys the complete infrastructure as code with a single sam deploy command
AWS Lambda
Executes all processing logic
Amazon S3
Stores uploaded files and hosts the dashboard
Amazon DynamoDB
Stores processed summaries and metadata
Amazon Bedrock
Runs Claude Haiku 4.5 for AI summarization
Amazon SNS
Sends urgent email alerts
Amazon SES
Sends digest emails
Amazon API Gateway
Connects the dashboard to backend services
Amazon EventBridge
Schedules Gmail polling every five minutes
Google Cloud Console
Provides Gmail API OAuth credentials
I chose AWS SAM because I wanted every resource defined as code. If I ever needed to rebuild the project from scratch, I could redeploy the complete infrastructure with a single command instead of manually recreating resources through the AWS Management Console.
That decision proved valuable during debugging.

The Unexpected Challenge

The application deployed successfully.
Amazon S3 events fired correctly.
AWS Lambda executed without errors.
Amazon DynamoDB stored summaries.
Amazon SNS delivered real alert emails.
The only component that refused to cooperate was Amazon Bedrock.
After spending time reviewing Lambda logs, IAM permissions, and API requests, I discovered the issue wasn't related to my application at all.
It was billing.
Claude Haiku 4.5 requires access through AWS Marketplace. Although my AWS account was already configured with UPI AutoPay for normal AWS billing, AWS Marketplace uses a separate payment system that requires a supported credit or debit card.
I added my debit card.
Verification failed.
After searching through documentation and community discussions, I eventually found the cause.
International transactions were disabled on my card.
Many banks in India disable international transactions on debit cards by default. Since AWS Marketplace processes payments internationally, the verification failed without clearly explaining why.
The solution was straightforward.
I enabled international transactions in my banking app, returned to AWS Billing → Payment Methods, added the same card again, and the verification completed successfully.
To verify everything was working, I opened the Amazon Bedrock Playground, selected Claude Haiku 4.5, entered a simple prompt, and received my first successful response.
After hours of debugging, seeing that one-word reply was surprisingly satisfying.

Cost Considerations

Before deploying the project, I configured an AWS Billing Alarm to notify me if my monthly AWS spending exceeded $5.
Having a budget alarm in place made it much easier to experiment with multiple AWS services without worrying about unexpected costs.
The application hasn't processed enough production traffic yet to calculate meaningful per-email costs, so I plan to publish those numbers after collecting more real-world usage data.

Current Status

Today, the complete end-to-end pipeline is operational.
  • Files uploaded to Amazon S3 are processed automatically.
  • Gmail messages are checked every five minutes.
  • Claude summarizes incoming content through Amazon Bedrock.
  • Urgent items generate email notifications.
  • Results are stored in DynamoDB and displayed on a live dashboard.
  • Budget monitoring is active.
While there are still a few improvements I'd like to make before considering the project production-ready, the overall architecture is functioning as intended.

Lessons Learned

Building Inbox Sentinel taught me several lessons beyond writing application code.
  • Infrastructure as Code makes rebuilding and debugging much easier.
  • Event-driven architectures simplify workflows by connecting managed AWS services together.
  • AWS Marketplace billing is separate from standard AWS billing.
  • A payment method that works for your AWS bill may not work for AWS Marketplace.
  • If you're using a debit card in India, verifying that international transactions are enabled can save hours of unnecessary troubleshooting.
Perhaps the biggest lesson was that not every production issue originates in your application. Sometimes the obstacle lies in the surrounding platform, configuration, or billing system.

What's Next

My next goal is to let Inbox Sentinel process real-world email traffic for a longer period.
Once I have enough data, I plan to publish a follow-up covering performance, actual operating costs, usage metrics, and the additional improvements needed before calling the project production-ready.
This project started as a weekend experiment to learn Amazon Bedrock and serverless AWS services.
It ended up teaching me just as much about cloud architecture, deployment, operational debugging, and AWS billing as it did about building AI applications.
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