What inspired me
During the pandemic, I helped build a lab information system that included a basic rules engine for outbound email. It could parse only a rigid and limited set of expressions, and business users wanted rules it couldn't express. That led me to a simple idea: let people write rules in plain English, compile them into safe policies, and execute them. Later, I built a mailing system for another company, whose inbox became swamped with thousands of user replies, ranging from random inquiries to profile updates and unsubscribe requests. Those experiences inspired me to build a programmable, AI-assisted mailroom that handles email, compiles English into validated rules, and integrates with each company's workflow.
Use Cases
A customer emails a company for an important request, but the message goes unanswered because the contact address is outdated. I've experienced this firsthand. It's an issue that could have been avoided with AI-based intelligent email routing that detects critical messages and redirects them to the right place automatically.
A customer sends an email to the wrong department--say, billing instead of support--and it sits unanswered. With AI-based intelligent email routing, the system would recognize the intent, classify the message, and automatically forward it to the correct team, ensuring a timely response and better customer experience.
What I learned
- Business users think in intents, not in if-else trees. Plain English rules lower friction.
- Deliverability is its own world. Forwarding without care can break SPF or DMARC. Re-sending through SES with your domain identity avoids most pitfalls.
How I built it

First, Amazon SES receives any email sent to your domain. It validates that the email is legitimate using SPF and DMARC, then stores the raw message in S3 for safekeeping. This triggers an AWS Lambda function, which grabs the email from S3, extracts the sender, subject, and body content.
Next, it fetches your routing rules from DynamoDB. Then it sends the email content plus your rules to AWS Bedrock, which runs Claude Sonnet 4.5.
Amazon Bedrock analyzes everything: the tone, the intent, the urgency, and decides where this email should go. The Lambda function takes that decision and uses SES to forward the email to the right recipient, preserving the original sender so replies work correctly.
The entire system is serverless, which means it scales automatically, you only pay for what you use, and there's no infrastructure to manage. If Bedrock is down, it gracefully falls back to your default forwarding address. Nothing gets lost.
MCP Server using Claude Code

The MCP (Model Context Protocol) server acts as a conversational bridge between you and your email routing system. Instead of manually editing database entries or redeploying your infrastructure every time you want to change how emails are routed, you can simply talk to Claude Code in plain English, asking it to add new routing rules, update tags, or modify where certain emails should go. For example, you can say "route all customer support emails to [email protected] with a [SUPPORT] tag" and Claude Code will understand your request, update the routing configuration in your database, and confirm the changes all without you touching any code or running any deployment commands. It's like having an AI assistant that manages your email routing rules for you through natural conversation.
Future Consideration
This project can be extended by integrating it with other services to automate workflows, pull contextual data from APIs, and trigger actions across connected systems for faster, smarter email handling. Significant scope changes is required, please contact me if you are interested in this.
A marketing team plans to follow up with a potential customer who has shown interest in a product. The AI system analyzes engagement data from pixel and click trackers, determining that the recipient is most responsive around 9 AM PST. Based on this insight, the system recommends queuing and scheduling the email for that time to maximize the chance of conversion.
A real estate company uses AI to analyze a prospect's search patterns, click behavior, and engagement history. The system detects that the buyer is likely expecting a baby, based on recent interest in family-friendly neighborhoods and parenting-related content. The email system creates a reply template that recommends upselling options such as houses with an extra bedroom, low-pollution surroundings, and proximity to schools, parks, and grocery stores, helping the agent personalize their pitch and increase the likelihood of a sale.
The system analyzes historical email interactions stored in S3 and discovers that a particular customer responds better to emotionally driven language. Using this insight, the AI email engine generates a reply template that mirrors the customer's tone and preferred phrases, emphasizing empathy and enthusiasm, to craft a more persuasive message that increases the likelihood of purchase.
Challenges I faced
I’m a nerd, and while I find building entire systems easy, presenting them has always been difficult. Luckily, there are AI tools now, and I used HeyGen to help me create a video demo.
Built With
- amazon-cloudfront
- amazon-lambda
- amazon-route53
- amazon-ses
- amazon-web-services
- python
Log in or sign up for Devpost to join the conversation.