AWS Builder Center
Weekend Creative Agent Challenge: MemePulse

Weekend Creative Agent Challenge: MemePulse

MemePulse is a fully automated, serverless AI agent on AWS that turns tech news into daily satire. It fetches the top Hacker News story, uses Amazon Bedrock to write a witty caption, and generates a custom meme via OpenAI. The agent then dynamically rebuilds its S3 and CloudFront web gallery and emails a digest to subscribers via Amazon SES. It runs completely hands-off, giving you a quick, hilarious pulse on the tech world every morning without you ever needing to open an app.

Vision and What It Does

The tech industry moves at breakneck speed. Every single day brings a new JavaScript framework, a massive cloud outage, or an AI breakthrough making headlines. Keeping up with this firehose of information can be dry and exhausting. I wanted to embody the philosophy that "the best tool is the one you never have to open" by creating an always-on agent that digests daily tech news and delivers it to me in the internet's favorite format: a meme🎭
MemePulse is a fully automated, serverless agent that wakes up every day, reads the top trending story on Hacker News, writes a witty, sarcastic caption about it, generates a custom comic-style image, updates a public web gallery, and emails a beautifully formatted digest directly to subscribers. It runs entirely on its own, ensuring you start your morning with a laugh and a quick pulse on what the tech world is talking about.



AWS Services and Architecture Overview

To keep this agent entirely hands-off and highly scalable, I built a 100% serverless architecture on AWS. The core engine is a single Python AWS Lambda function that handles a strictly sequential workflow.



  • Amazon EventBridge: Acts as the heartbeat of the application, using a daily cron job to trigger the process exactly at 8:00 UTC.
  • AWS Lambda: The central orchestrator that executes the multi-step chain: fetching data, prompting AI models, processing images, and rendering HTML.
  • Amazon Bedrock (Nova Lite): The creative brain that takes the raw headline and generates a structured JSON payload containing a punchy title, a sarcastic caption, and a detailed visual prompt.
  • Amazon S3 & CloudFront: S3 acts as the database and web host, storing images, metadata JSON files, and the dynamic  index.html  gallery, while CloudFront serves this content globally.
  • Amazon SES: Dispatches the daily stylized HTML email to subscribers, which looks like this:
Email Example




How I Built It (Process, Key Decisions, Challenges)

The core of the system is a Lambda function that sequentially orchestrates real-time news fetching, Caption & Image generation, and dynamic static site updates using S3 and CloudFront.
  • Going 100% Serverless: The biggest architectural decision was avoiding a traditional database and frontend framework to keep the agent self-contained and cost-effective within a single Lambda function.
  • Real-Time Relevance: Fetching data from the Hacker News API ensures the meme topic is entirely real-time. If a major tech event happens today, the agent processes that exact context and makes a meme about it immediately.
  • Sequential Orchestration: The workflow relies on strict sequencing. Lambda must wait for the Hacker News context, pass it to Amazon Bedrock to get the caption and visual prompt, and finally pass that exact prompt to the OpenAI API (gpt-image-1) to generate a medium resolution 1024X1024 image/meme.
  • Handling LLM Hallucinations: A major challenge was ensuring the generative AI models communicated predictably. I engineered the Bedrock prompt to return strict JSON. However, the model sometimes hallucinated markdown code blocks ( json ...  ), requiring a programmatic stripping step before parsing the data.
  • Dynamic Frontend Code Generation: Instead of using a JavaScript framework, the Lambda function dynamically rebuilds the frontend. It reads all historical meme metadata files from S3, sorts them chronologically, injects them into a pre-styled HTML string template, and overwrites the live  index.html  in the S3 bucket.
  • Managing CloudFront Cache Invalidation: Because CloudFront caches the static site globally for lightning-fast performance, simply updating S3 doesn't reflect the new meme immediately. I overcame this by using  boto3  to trigger a CloudFront invalidation for the paths  /index.html  and  /memes/* , forcing edge nodes to fetch the freshly generated content.



What I Learned

I gained practical experience in serverless API orchestration, enforcing structured JSON outputs from LLMs, and programmatically managing static site generation and CDN caching via the AWS SDK.
  • Serverless Orchestration: I learned how to seamlessly chain multiple internal and external APIs into a single, reliable synchronous Lambda function workflow.
  • Advanced Prompt Engineering: I gained practical experience forcing LLMs to output structured data (JSON) and writing robust fallback logic to handle unexpected formatting.
  • Static Site Generation from Scratch: I discovered how to build dynamic static sites directly from Python logic, eliminating the need for heavy, complex frontend build steps.
  • Cache Management via SDK: I mastered programmatically managing CDN cache invalidations using the  boto3  SDK to serve real-time updates to edge locations without serving stale content.



App Link

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