AWS Builder Center

Weekend Creative Agent Challenge: DailySpark: An AI Creativity Agent That Creates Before You Arrive

DailySpark is an autonomous AI creativity agent that uses AWS EventBridge, Lambda, Bedrock, and DynamoDB to generate a new creative challenge every day without user interaction. It remembers previous ideas, avoids repetition, and delivers a fresh personalized “Spark” that’s already waiting when the user returns.

Software Engineer

1. Vision & What It Does

Most creative applications demand manual friction: you open the browser, click a "Generate" button, wait for a model response, and copy the result. But true creative momentum thrives on spontaneous inspiration.
DailySpark is built around a single core philosophy:
"The best creative tool is the one you never have to open."
DailySpark is an autonomous, always-on AI creativity agent powered by AWS serverless architecture. Rather than relying on a user session or frontend trigger, DailySpark operates entirely in the background while you sleep or focus on work.
Every morning at 6:00 AM UTC, an Amazon EventBridge cron schedule wakes up an AWS Lambda function. The agent retrieves memory from previous Sparks stored in Amazon DynamoDB, consults Amazon Bedrock (using low-cost Amazon Nova Lite) to generate a fresh creative challenge tailored to the day of the week, validates the structured output, and saves it.
When you return to your browser, your daily creative spark is already waiting for you—zero load times, zero button clicks.

Weekly Creative Category Rotation

To foster diverse daily practice, the agent assigns dedicated creative disciplines based on the day of the week:
  • Monday: Startup Idea (Micro-SaaS & practical problem solving)
  • Tuesday: Art Challenge (Sketching, shadows, and perspective)
  • Wednesday: Writing Challenge (Flash fiction & world-building)
  • Thursday: Photography Challenge (Lighting, contrast, and framing)
  • Friday: Short-Video Challenge (Rhythm, texture, and ambient loops)
  • Saturday: Music Challenge (Pentatonic melodies & desk percussion)
  • Sunday: Observation & Travel (Architectural geometry & mindfulness)



2. System Architecture & AWS Services Used

DailySpark leverages a 100% AWS-native serverless architecture designed for zero maintenance, high availability, and ultra-low cost under the AWS Free Tier.
DAILY SCHEDULE (6:00 AM UTC)
│
Amazon EventBridge
│
AWS Lambda
(DailySpark-Generator)
│
┌──────────────────────────┴──────────────────────────┐
▼ ▼
DynamoDB Memory (Scan Past 5 Sparks) Amazon Bedrock (Nova Lite)
│ │
└──────────────────────────┬──────────────────────────┘
│ (Validate Structured JSON)
▼
Amazon DynamoDB Table
(DailySpark)
▲
│
AWS Lambda
(DailySpark-Api)
▲
│
AWS API Gateway (HTTP)
(GET /spark/today)
▲
│
AWS Amplify (Frontend)

Key AWS Services:

  1. Amazon EventBridge: Triggers the daily generator schedule via a cron expression ( cron(0 6 * * ? *) ), driving the autonomous lifecycle.
  1. AWS Lambda (Python 3.12):
  •  DailySpark-Generator : Executes the agent memory loop, queries past items, builds context prompts, invokes Amazon Bedrock, and writes to DynamoDB.
  •  DailySpark-Api : Serves read-only GET endpoints ( /spark/today  &  /spark/history ) to the web frontend with CORS headers.
  1. Amazon Bedrock (Amazon Nova Lite / Claude 3): Serves as the creative intelligence, producing structured JSON outputs ( title ,  idea ,  category ,  mood ,  difficulty ,  creative_tip ).
  1. Amazon DynamoDB: Stores daily generated Sparks using  date  ( YYYY-MM-DD ) as the partition key under  PAY_PER_REQUEST  billing.
  1. AWS API Gateway (HTTP API): Provides a low-latency, lightweight RESTful interface between the Lambda query backend and public web clients.
  1. AWS Amplify: Hosts the responsive dark glassmorphism Web UI at edge locations with automatic SSL.



3. How I Built It & Key Engineering Decisions

Agent Memory Loop (Enforcing Novelty)

A simple static prompt often leads to repetitive AI outputs over time. To give DailySpark true agentic behavior, I implemented a DynamoDB memory retrieval step prior to Bedrock generation:
  1. The generator Lambda scans the last 5 Sparks from DynamoDB.
  1. It extracts their titles and categories into a memory context string:  PREVIOUS SPARKS GENERATED (DO NOT REPEAT OR OVERLAP WITH THESE IDEAS)... .
  1. The prompt explicitly instructs Bedrock: "Generate ONE original creative challenge for today that is meaningfully distinct from past memory items."

Resilience & Safe JSON Parsing

LLMs can occasionally return markdown formatting or extra commentary. To ensure the Lambda function never fails silently:
  • A custom regex parser extracts the raw JSON block  { ... }  from Bedrock responses.
  • Schema keys ( title ,  idea ,  category ,  mood ,  difficulty ,  creative_tip ) are validated.
  • Numerical fields (like  difficulty ) are clamped between 1 and 5.
  • If Bedrock fails or returns malformed output, an intelligent fallback challenge is stored to ensure database consistency.

Low-Latency Frontend Design

The web UI is built with vanilla HTML5, CSS3 glassmorphism styling, and asynchronous JavaScript. To eliminate cold-start lag:
  • The UI implements an  AbortController  timeout (1.5 seconds) on API fetches.
  • If network latency or API gateways delay, the frontend instantly falls back to an offline dynamic mock engine, guaranteeing a 0ms initial render for the user.



4. Challenges & Lessons Learned

  1. DynamoDB Decimal Serialization: DynamoDB returns numeric attributes as Python  decimal.Decimal  types, which cause  TypeError: Object of type Decimal is not JSON serializable  in standard  json.dumps() . Implementing a custom  DecimalEncoder  in the API Lambda resolved HTTP response errors.
  1. AWS CloudShell Runtime Compatibility: Building SAM templates in CloudShell required configuring  Runtime: python3.13  to match Amazon Linux 2023 environment binaries, highlighting the importance of environment alignment in serverless CI/CD.
  1. Decoupling Creation from Consumption: Designing systems where content creation is completely independent of user web requests fundamentally shifts how web apps are built—moving from reactive server request-response cycles to proactive agentic background loops.



5. Live Links & Repository

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