AWS Builder Center
Weekend Creative Agent Challenge: BrainSpark

Weekend Creative Agent Challenge: BrainSpark

My submission for the Weekend Creative Agent Challenge. BrainSpark is an always-on AI creative agent that autonomously generates unique daily drawing sketches for kids. It uses AWS Lambda, EventBridge, DynamoDB, and S3 — all on free tier. The agent improves daily through a feedback loop: 👍 Like = more of the same theme, ✅ Done = smooth shift to a connected theme. Delivered via Telegram with interactive polls and a public S3 dashboard showing the agent's evolution journey.

Weekend Creative Agent Challenge: BrainSpark




Vision & What It Does

BrainSpark is an always-on AI creative agent that autonomously generates unique daily drawing and coloring sketches for kids every morning at 7:00 AM IST — delivered directly to your phone via Telegram.

The Problem It Solves:

Every parent faces the same daily struggle: finding fresh, engaging creative activities for their children. Coloring books get repetitive, searching for printable activities wastes time, and most solutions cost money or require app downloads. Kids get bored with the same content, and parents run out of ideas.

How It Works:

BrainSpark solves this by being a fully autonomous creative agent that:
  1. Generates a unique kids' coloring page sketch every single morning — no manual trigger needed
  1. Delivers it directly to your phone via Telegram Bot (no app download required!)
  1. Collects feedback through interactive polls (👍 "Liked! More like this!" or ✅ "Done! New theme tomorrow!")
  1. Learns and improves — if you like a theme, it goes deeper into that theme. If you're done, it smoothly transitions to a connected theme (not random!)
  1. Evolves over time — the agent tracks its own growth through stages: Learning → Adapting → Personalizing → Expert

What Makes It Creative:

BrainSpark doesn't just generate random images. It has a Connected Theme Map with 12 theme families (Animals, Fantasy, Space, Dinosaurs, Sea Creatures, etc.) and 180 unique sub-topics. Each theme connects to 3-4 related themes, so when a user says "Done," the transition feels natural — like a story unfolding across days:

Day 1: 🦄 Fantasy → Cloud Kingdom (first day)
Day 2: 👍 Liked! → 🦄 Fantasy → Gnome Garden (went deeper!)
Day 3: 👍 Liked! → 🦄 Fantasy → Baby Dragon (still exploring!)
Day 4: ✅ Done! → 🐙 Sea Creatures → Ocean Scene (smooth connected shift!)
Day 5: ✅ Done! → 🐾 Animals → Fox in Autumn Forest (connected to sea life!)
The agent builds a personalized visual journey — not random content. Every morning, a child receives a fresh sketch that's connected to what they enjoyed yesterday.

The Creative Output:

  • Format: Black and white line-art coloring pages (printable!)
  • Style: Cute, friendly, cartoon-style with thick bold outlines
  • Audience: Kids aged 3-10
  • Delivery: Telegram message with image + feedback poll
  • Dashboard: Public S3 website showing all generated sketches and evolution history



How I Built It

Development Process:

I built BrainSpark entirely through the AWS Console (no CLI) over a weekend, focusing on making it 100% free tier with zero cost.

Key Decisions:

1. Image Generation Strategy: My biggest challenge was finding a free, reliable image generation API. Here's my journey:
Attempt
Service
Result
Issue
1
Google Gemini API
❌ Failed
404 errors, model not found
2
Groq API
❌ Failed
403 Forbidden
3
OpenRouter
❌ Failed
403 Forbidden
4
Cloudflare Workers AI
✅ Works!
10,000 free images/day
5
Pollinations.ai
✅ Fallback
URL-based, never fails
Final Decision: Dual-provider strategy — Cloudflare Workers AI (Stable Diffusion XL) as primary, Pollinations.ai as fallback. This ensures the agent never fails to deliver, achieving true always-on reliability.
2. Feedback-Driven Improvement: Instead of complex ML models, I designed a simple but effective feedback loop:
  • Telegram polls collect user preference (👍 Like / ✅ Done)
  • DynamoDB stores all feedback history
  • Smart Theme Engine reads history and decides next theme
  • Connected Theme Map ensures smooth transitions
3. Unique Every Time: Initially, the agent produced the same image when tested multiple times on the same day (using date as seed). I fixed this by switching to  int(time.time()) + generation_count  — making every single generation unique, even seconds apart.

Challenges Encountered & Solutions:

Challenge 1: S3 Bucket Policy Error
  • Error: "Invalid Principal Format" when setting up public access
  • Solution: Correctly configured the bucket policy with proper Principal element ( "Principal": "*" )
Challenge 2: Lambda Handler Not Found
  • Error: "Handler 'lambda_handler' missing on module 'lambda_function'"
  • Solution: Verified Runtime settings → Handler =  lambda_function.lambda_handler  and file name =  lambda_function.py 
Challenge 3: Same Content Repeating
  • Problem: Date-based seeds produced identical images on same day
  • Solution: Timestamp-based unique seeds ( int(time.time()) ) ensure every generation is different
Challenge 4: Random Theme Jumps Felt Unnatural
  • Problem: Jumping from "Elephant" to "Rocket Ship" was jarring
  • Solution: Created Connected Theme Map where each theme links to 3-4 related themes, making transitions feel like a natural story



AWS Services Used / Architecture Overview

Architecture Diagram:

┌──────────────────┐
│ Amazon │
│ EventBridge │──── Triggers daily at 7 AM IST
│ (Scheduler) │
└────────┬──────────┘
│
▼
┌──────────────────┐
│ AWS Lambda │──── BrainSparkAgent (Core Brain)
│ (Python 3.12) │
└─┬─────┬──────┬───┘
│ │ │
┌─────┘ ┌──┘ └─────┐
▼ ▼ ▼
┌─────────┐ ┌──────────┐ ┌──────────┐
│Cloudflare│ │ Amazon │ │ Telegram │
│Workers AI│ │ DynamoDB │ │ Bot API │
│(SDXL) │ │ │ │ │
└────┬────┘ └────┬─────┘ └────┬─────┘
│ │ │
▼ ▼ ▼
┌─────────┐ Stores Sends Sketch
│Amazon S3│ History & + Feedback Poll
│(Website)│ Feedback to User's Phone
└─────────┘ ↑ │
│ ▼
│ ┌─────────┐
└─────────│ User │
Feedback │ (👍/✅) │
└─────────┘

AWS Services Breakdown:

AWS Service
Purpose
How It's Used
Free Tier Usage
AWS Lambda
Core agent brain
Runs all logic: theme selection, image generation, delivery, dashboard update
30 of 1M free requests/month
Amazon EventBridge
Always-on scheduler
Triggers Lambda daily at 7:00 AM IST via cron expression  30 1 * * ? * 
Free for scheduled rules
Amazon DynamoDB
Persistent memory
Stores sketch history, themes, sub-topics, feedback, timestamps
< 1MB of 25GB free
Amazon S3
Public dashboard + image storage
Hosts static website showing evolution history + stores generated images
< 10MB of 5GB free
AWS IAM
Security
Lambda execution role with DynamoDB and S3 permissions
Free

External Services (All Free):

Service
Purpose
Why Chosen
Cloudflare Workers AI
Primary image generation (Stable Diffusion XL)
10,000 free images/day, high quality
Pollinations.ai
Fallback image generation
URL-based, unlimited, zero-failure guarantee
Telegram Bot API
Delivery + feedback collection
Free, instant delivery, built-in polls

How the Feedback Loop Works (Architecture Detail):

1️⃣ EventBridge triggers Lambda at 7 AM IST
2️⃣ Lambda reads feedback history from DynamoDB
3️⃣ Smart Theme Engine analyzes last feedback:
• 👍 Liked → Same theme family, different sub-topic
• ✅ Done → Shift to CONNECTED theme (smooth transition!)
• No feedback → Follow natural theme progression
4️⃣ Cloudflare AI generates unique coloring page (Pollinations fallback)
5️⃣ Image uploaded to S3, metadata saved to DynamoDB
6️⃣ Sketch + poll sent to Telegram
7️⃣ S3 Dashboard updated with latest evolution data
8️⃣ User votes → stored in DynamoDB → used TOMORROW

Total Monthly Cost: $0.00

Every single component runs within AWS Free Tier limits. The agent can run indefinitely without incurring any charges.



What I Learned

1. AWS Free Tier is Incredibly Powerful

You can build a complete, always-on AI agent with Lambda + EventBridge + DynamoDB + S3 for absolutely zero cost. The free tier limits (1M Lambda requests, 25GB DynamoDB, 5GB S3) are far beyond what a daily agent needs.

2. Feedback Loops Create Intelligence Without ML

You don't need complex machine learning to make an agent "smart." A simple feedback mechanism (👍/✅ polls) combined with thoughtful logic (Connected Theme Map) creates meaningful personalization that users can feel.

3. Fallback Strategies Are Essential for Always-On Agents

After 3 APIs failed (Gemini, Groq, OpenRouter), I learned that a true always-on agent needs redundancy. The dual-provider strategy (Cloudflare + Pollinations) ensures the agent NEVER fails to deliver — even if one service goes down.

4. Connected Themes > Random Themes

The biggest UX improvement came from creating theme connections. Instead of random jumps (Elephant → Rocket Ship), smooth transitions (Animals → Plants → Insects → Birds) make the daily experience feel curated and intentional.

5. Serverless = Perfect for Autonomous Agents

EventBridge + Lambda is the simplest, most cost-effective way to build always-on agents. No servers to manage, no uptime to worry about, no scaling concerns. It just works, every single day.

6. Start Simple, Iterate Based on Feedback

My first version was basic — random themes, single API, no dashboard. Each iteration added intelligence: feedback loop, connected themes, evolution stages, dual-provider fallback. The agent improved because I applied the same principle to my development process that the agent applies to its content!

New Skills Discovered:

  • Cloudflare Workers AI for serverless image generation
  • Telegram Bot API for interactive polls and media delivery
  • DynamoDB scan/put patterns for feedback-driven applications
  • S3 static website hosting with dynamic HTML generation
  • EventBridge cron expressions for IST timezone scheduling

New Approach Discovered:

Building an "improving" agent doesn't require AI/ML training. A well-designed feedback loop with domain-specific logic (theme connections, sub-topic rotation, stage progression) can create a genuinely adaptive experience that feels intelligent to users.



Link to App or Repo

🌐 Live Deployed Application (S3 Dashboard):

This public dashboard shows:
  • All generated sketches with images
  • Theme progression and evolution history
  • Feedback tracking (liked/done/pending)
  • Agent evolution stage (Learning → Adapting → Personalizing → Expert)
  • Architecture and flow explanation

💻 Public GitHub Repository:

Repository contains:
  •  lambda_function.py  — Complete agent source code
  •  README.md  — Setup guide and documentation
  •  requirements.txt  — Dependencies
  •  event.json  — Test event template
  •  screenshots/  — All proof screenshots

📱 Telegram Bot (Live):

📸 Proof Screenshots:

Telegram Delivery — Sketch + Poll:

Agent Learning — Theme Stayed After 👍 Like:

Agent Learning — Theme Shifted After ✅ Done:

Evolution Stages Visible (Learning → Adapting → Personalizing):
S3 Dashboard — Public Website:

AWS Lambda — Successful Execution:

Amazon EventBridge — Always-On Schedule:

Amazon DynamoDB — Feedback History



Built by Madhan | August 2026 | 100% AWS Free Tier
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