
How I Built a Serverless Agentic AI Meme Generator for WhatsApp
Deploying a schedule-based Serverless Strands Agent on AWS Lambda with CDK, EventBridge and Docker
Published Jun 3, 2025
So there I was, half awake at 6 AM, when my phone buzzed for the third time. Another “Good Morning” meme on the family WhatsApp group. You know the ones — sunrises, flowers, and inspirational quotes that somehow always manage to use Comic Sans.
After the initial grumbling (and coffee), I got curious. How exactly does Aunt Linda find a new “Rise and Shine” image every single day? Is there some secret repository of morning memes I don’t know about? Or does she wake up at 6 AM just to forward these good morning memes or send those Happy Birthday or Anniversary messages?
That’s when it hit me — what if I could build an AI that automatically generates and sends these memes? Not only would it be a fun project, but I could also secretly become the most consistent “good morning” or “Happy Birthday” messenger in the family group chat without actually waking up early. Win-win!
I decided to leverage Amazon Bedrock’s AI capabilities and the Strands Agents SDK to create a fully autonomous meme generation system. The goal was simple: Build something that could
- Come up with creative meme ideas
- Generate custom images
- Add text overlays
- Send them automatically via WhatsApp
But I wanted to go beyond just a simple script. I wanted to create an agentic system — one that could make creative decisions on its own and adapt to different themes and requirements.
Traditional automation follows rigid, predefined steps. An agentic system, on the other hand, uses AI to make decisions and adapt its approach based on the task at hand.
Using the Strands Agents framework, I defined a set of “tools” that the AI agent could use:
Instead of hardcoding the exact steps, I let the agent decide how to combine these tools to achieve the goal. This gives it the flexibility to handle different themes (like standard funny memes or religious inspirational ones) and adapt to any errors or unexpected situations.
The most challenging part was ensuring the memes were actually funny and varied. Nobody wants to see the same “Monday coffee” joke every week.
I solved this by prompting the Amazon Nova model to combine multiple random elements for unique compositions:
This approach produces delightfully absurd combinations like “a dragon trying to blow out birthday candles while a raccoon organizes a breakfast buffet in the background” — much more interesting than the standard “need coffee” memes!
To make this system truly automated, I deployed it as a serverless application using AWS Lambda and the AWS CDK. This way, it can run on a schedule or be triggered via an AWS CLI command (sample provided below).

I initially used a simple Lambda deployment, but recently upgraded to a container-based approach for better dependency management and consistency. The CDK made this deployment super easy:
For running the Lambda, I use container-based automated deployment using the
cdk-ecr-deployment
package. This approach offers several advantages:- Consistent environments: The Docker container ensures the same environment in development and production
- Simplified dependency management: All dependencies are packaged in the container image
- Better isolation: Container-based functions have more predictable behavior
- Easier updates: I can update the container image without redeploying the entire stack
- Long-running processes: Container-based Lambda functions can handle the processing time needed for AI image generation (90+ seconds)
The Dockerfile below is very straightforward and the image is built during the cdk deployment process and pushed to ECR repository and used by the Lambda Function code.
I also use EventBridge for scheduled triggers and avoid API Gateway in my solution, due to the 29-second timeout limit with API Gateway (although it can be increased now), and given that my meme generation process takes about ~90 seconds to complete.
After deploying the system, I started receiving some truly unique good morning memes. Some of my favorites include:
- A sloth wearing a business suit riding a roomba while holding a coffee mug that says “I literally can’t even”
- A confused alien reading a human sleep manual with alarm clocks flying everywhere in the background
- A T-Rex trying to make a bed with its tiny arms while a calendar that’s somehow on fire burns in the background
The religious-themed memes are equally impressive, with beautiful scenes like:
- A shepherd tending sheep on a hillside while angels appear in the clouds above
- A dove carrying an olive branch flying over Noah’s Ark with a rainbow forming in the background
- A wooden manger under the Star of Bethlehem with rays of divine light shining down


Building this project taught me several valuable lessons:
- Agentic AI is powerful: By giving the AI agent a set of tools and letting it decide how to use them, I created a system that’s more flexible and creative than a traditional script with absolutely no hardcoding or steps added. Just let the Agent do the handling of the flow of data between the tools or steps.
- Randomness is key for creativity: Adding random elements and variations to the prompts ensures the memes stay fresh and interesting.
- Amazon Bedrock makes AI accessible: The combination of Amazon Nova Premier for text generation and Amazon Nova Canvas for image creation made it easy to build a complete AI solution without managing complex ML infrastructure.
- Serverless is perfect for this use case: Since meme generation only happens once a day, Lambda is ideal — I only pay for the few seconds of compute time I actually use (negligible for Lambda) and for the Bedrock Models usage (PS: I have active AWS credits from various AWS programs, so it doesnt charge me to use Amazon Nova Models. Check the Amazon Nova Pricing if trying this on your own AWS account, and make sure in the Bedrock console to enable the model access to Amazon Nova models in your account).
Want to build your own agentic meme generator? Here’s how to get started:
1) Clone the repository:
2) Install dependencies:
3) Set up Twilio for WhatsApp messaging:
- Sign up for a free Twilio account at https://www.twilio.com/try-twilio
- Navigate to the Twilio Console and note down your Account SID and Auth Token
- Enable the WhatsApp Sandbox in the Messaging section
- Follow the instructions to connect your WhatsApp number to the sandbox by sending the provided code
- Note: The sandbox allows you to send 9 free messages every 24 hours for testing
4) Configure your environment variables:
You can test your Twilio setup with this simple Python script:
5) Deploy with CDK:
6) Trigger a meme generation manually on ad-hoc basis using AWS CLI command (e.g. for ad-hoc testing):
I’m planning to expand the system with more features:
- Additional themes beyond standard and religious
- Personalized memes based on recipient preferences
- Integration with other messaging platforms
- A web interface for customizing meme generation parameters
- Birthday and other reminders generation
What started as a silly response to family WhatsApp messages turned into a fascinating exploration of agentic AI and serverless architecture. The project demonstrates how Amazon Bedrock and the Strands Agents SDK framework can be combined to create intelligent, creative applications that make decisions on their own.
And the best part? Thanks to Amazon Nova and Strands Agents SDK, I’m now the undisputed king of good morning messages in the family WhatsApp group chat — all while sleeping in until a reasonable hour. Sorry, Aunt Linda, but AI has beat you up at your own morning meme game!
If you’re interested in exploring the code further or have ideas for improvements, check out the GitHub repository or drop me a message. I’d love to see what creative memes your own agent comes up with!