
Weekend Creative Agent Challenge: The Infinite Poet
An autonomous agent that evolves poetry using genetic algorithms. Mutates one gene every 6 hours, zero human intervention. Built on AWS Free Tier.
Every 6 hours, a poem is born. No one writes it. No one edits it. No one even reads it until they choose to. It simply evolves, generation after generation, like a living thing.
This is The Infinite Poet, an autonomous poetry evolution agent that writes verse using a genetic algorithm. Each poem inherits DNA from its parent and mutates one gene per cycle. Over time, the poetry transforms itself from haiku to sonnet, from melancholic to fierce, from fire imagery to ocean depths.
The best tool is one you never have to open. This one writes poetry whether you watch or not.

Vision & What the Agent Does
The Infinite Poet is an always-on creative agent that generates evolving poetry autonomously. Here is the core idea:
- Every poem has DNA made of 5 genes: form, theme, tone, imagery, and constraint
- Every 6 hours, the agent wakes up, reads the latest poem's DNA, and mutates one gene randomly
- It then writes a brand new poem honoring all 5 genetic traits
- The result is an ever-growing evolutionary tree of poetry where you can trace how verse transforms across generations
What makes this different from "generate a random poem daily" is the lineage. Generation 0 might be a tender cinquain about nature using fire imagery. Generation 1 inherits everything but mutates the theme to silence. Generation 2 keeps the silence theme but shifts form from cinquain to tanka. Each poem carries echoes of its ancestors.
The agent also responds to time. Poems written at dawn carry morning energy. Friday poems lean toward release and beauty. Sunday poems touch something sacred. The same DNA produces different poems depending on when the agent runs.
Every 6 hours, EventBridge triggers the Lambda. It reads the current poem's DNA from DynamoDB, picks one random gene to mutate, calls Amazon Bedrock (Nova Pro) to write a new poem honoring all 5 genetic traits plus temporal influence, generates a title and curator reflection, saves everything back to DynamoDB, and updates the gallery JSON on S3. The entire cycle takes about 2 seconds. No human ever touches it.
How I Built It
The Genetic Algorithm
I started with the question: what if poetry had DNA? I defined 5 genes, each with 10-12 possible values:
- Form: haiku, sonnet, free verse, limerick, tanka, prose poem, villanelle, cinquain, ghazal, acrostic
- Theme: time, nature, memory, solitude, cosmos, urban life, ocean, connection, dreams, transformation, silence, boundaries
- Tone: hopeful, melancholic, fierce, whimsical, mysterious, serene, tender, raw, wistful, ecstatic, quiet, dark
- Imagery: water, fire, earth, sky, light, shadow, glass, metal, fabric, bone
- Constraint: must include a color, must include a number, must contain a question, must have a paradox, must personify something abstract, etc.
The constraint gene is what makes it interesting. It forces the AI to work within creative limitations, which is exactly how human poets sharpen their craft.
The Evolution Logic
Each cycle follows this flow:
- Read the latest poem's DNA from DynamoDB
- Pick one random gene to mutate
- Select a new value for that gene (different from current)
- Pass all 5 genes plus time-of-day influence to Amazon Nova Pro
- Nova Pro writes the poem honoring every constraint
- A second Nova Pro call generates a title and curator reflection
- Save everything to DynamoDB
- Update the gallery data on S3
The key decision was mutating only ONE gene per generation. This keeps the evolution gradual and traceable. If you mutated all 5 at once, there would be no visible lineage. With single mutations, you can follow how a haiku about fire slowly becomes a sonnet about water across 10 generations.
The Time System
I wanted the agent to feel alive, not mechanical. So I added temporal awareness:
- Night poems (0-6 UTC) carry stillness and dream energy
- Morning poems (6-12 UTC) feel like first light and beginning
- Afternoon poems (12-18 UTC) have clarity and momentum
- Evening poems (18-24 UTC) lean toward reflection and release
Each day of the week also adds flavor. Thursday brings thunder and power. Saturday brings freedom and play. This means the same DNA produces subtly different poems depending on when the agent wakes.
The Gallery
The frontend is a static site hosted on S3. It shows three views:
- Latest: The most recent poem in full, with its DNA and lineage info
- Timeline: All poems in reverse chronological order, showing the chain
- DNA View: A compact view showing which genes mutated at each step
No backend server needed. The Lambda writes a
gallery.json file to S3 after each evolution, and the frontend reads it directly.AWS Services Used / Architecture Overview
Amazon EventBridge (scheduled rule: every 6 hours)
|
v
AWS Lambda (Python 3.12, 512MB, 180s timeout)
|
├── Amazon Bedrock / Nova Pro (poem generation + metadata)
├── Amazon DynamoDB (stores poem DNA, text, lineage)
└── Amazon S3 (hosts gallery website + serves data JSON)Services:
Service | Role |
|---|---|
Amazon EventBridge | Scheduled rule triggers Lambda every 6 hours |
AWS Lambda | Runs the evolution logic (Python 3.12, 512MB, 180s timeout) |
Amazon Bedrock (Nova Pro) | Generates poems, titles, and curator reflections |
Amazon DynamoDB | Stores poem DNA, text, lineage, and generation metadata |
Amazon S3 | Hosts the static gallery website and serves gallery.json data |
Why These Services
- Lambda over EC2: The agent runs for 2 seconds every 6 hours. Paying for an always-on server would be wasteful. Lambda is the natural fit for scheduled, short-lived tasks.
- DynamoDB over RDS: The data model is simple (poem ID as key, flat attributes). No joins, no complex queries. DynamoDB's pay-per-request mode means zero cost when idle.
- S3 static hosting over a web framework: The gallery is read-only. No server-side rendering needed. S3 serves HTML/CSS/JS directly with no maintenance.
- EventBridge over cron: Native AWS integration. No EC2 instance to keep alive just for a cron job.
Cost
Based on current AWS pricing (us-east-1), assuming 4 invocations/day (every 6 hours):
Service | Pricing | Usage | Est. Monthly Cost |
|---|---|---|---|
EventBridge Scheduler | $1.00/million invocations | ~120 invocations/mo | $0.00 (free tier) |
Lambda | $0.20/million requests + compute | ~120 invocations/mo, ~2s each | $0.00 (free tier) |
Amazon Bedrock (Nova Pro) | $0.80/1M input, $3.20/1M output | ~240 calls/mo, ~500 tokens each | ~$0.25 |
DynamoDB | On-demand: $1.25/million writes | ~120 writes/mo | $0.00 (free tier) |
S3 | $0.023/GB + $0.0004/request | <1MB storage, ~120 PUTs/mo | $0.00 (free tier) |
Total: ~$0.25/month
The agent runs indefinitely for pocket change. Everything except Bedrock token costs falls within AWS Free Tier. Even Bedrock usage is minimal because each poem generation uses roughly 500 input tokens and 300 output tokens per call.
What I Learned
1. Legacy model restrictions are real. I initially planned to use Amazon Nova Canvas for image generation. It is marked LEGACY and blocked for accounts that have not used it in 30 days. I pivoted to Nova Pro for text, which turned out to produce a more interesting creative agent anyway. Poetry with visible DNA evolution is more compelling than randomly generated images.
2. Single-gene mutation creates better narratives. My first design mutated 2-3 genes per generation. The results felt disconnected. When I constrained it to exactly one mutation, the evolutionary chain became readable and satisfying. You can follow how a poem about fire slowly becomes a poem about water while keeping its sonnet form.
3. Creative constraints produce better AI output. The "constraint" gene (must include a number, must contain a paradox, etc.) forces Nova Pro to work harder. The poems with active constraints are consistently more interesting than unconstrained ones. This mirrors how human poets use form and limitation as creative fuel.
4. Time awareness adds personality. A poem generated at 3 AM feels different from one at noon, even with identical DNA. This small addition makes the agent feel alive rather than mechanical.
5. Serverless is perfect for creative agents. The entire infrastructure costs nothing. The agent runs for 2 seconds, writes a poem, and goes back to sleep for 6 hours. No servers to maintain, no uptime to monitor. It just works.
What's Next
- Add a "family tree" visualization showing parent-child relationships as a graph
- Let viewers vote on poems, feeding preference data back into the mutation probability
- Add a "breeding" feature where two poems from different branches can combine DNA
- Expand to multiple parallel lineages (forests instead of a single chain)
The Infinite Poet is live now, writing verse every 6 hours. By the time you read this, it has already evolved further. Check the gallery to see what it wrote while you were away.
Built for the AWS Weekend Creative Agent Challenge. The agent runs autonomously on AWS Free Tier services with zero ongoing human intervention.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article