AWS Builder Center
Weekend Creative Agent Challenge: Codice

Weekend Creative Agent Challenge: Codice

Códice is an autonomous agent that draws one page a day. Every morning it wakes on a schedule, reads the real sky over Mexico City — temperature, wind, cloud cover, rain, the length of the day, the phase of the moon — turns that reading into a visual language, draws an original SVG page, checks its own work, and publishes it to a gallery. Nobody triggers it. Nobody prompts it. When you come back, the page is already there, and it is a page that did not exist yesterday and cannot exist again tomorrow.

The vision

Last weekend I built something creative that I had to open. This weekend the brief was to set it free, and that reframing turned out to be the whole exercise. "Always-on" is not a deployment detail. It changes what the thing is. An app waits to be asked. An agent decides on its own that today is worth making something for.
Códice is an autonomous agent that draws one page a day. Every morning it wakes on a schedule, reads the real sky over Mexico City — temperature, wind, cloud cover, rain, the length of the day, the phase of the moon — turns that reading into a visual language, draws an original SVG page, checks its own work, and publishes it to a gallery. Nobody triggers it. Nobody prompts it. When you come back, the page is already there, and it is a page that did not exist yesterday and cannot exist again tomorrow.
The problem it solves is small and honest: generative art tools make you do the work. You open a tab, you think of a prompt, you tune it, you pick a favourite. Códice inverts that. The tool never has to be opened. Its output accumulates into something with a shape — a codex, one page per day, where the interesting thing is not any single page but the run of them.

The decision the whole thing rests on

My first version passed the weather straight into the prompt.  16 °C, 89 % humidity, 100 % cloud cover, wind 4.4 km/h . It drew a weather report. Bands labelled like a chart, a wind arrow, something that wanted to be a dashboard. Of course it did — I had handed it data, so it visualised data.
So I moved the interpretation out of the prompt and into the code. Now every measurement is spent in a module called  grammar.py , and what reaches the model is only words and hex values:
archetype basin — nested open curves cupping one another, opening upward
composition sits near the middle, evenly divided
gesture still — lines hold their direction; nothing leans
surface submerged — almost everything semi-transparent and overlapping
texture heavy grain — dense stippling across the larger shapes
falling a few short falling strokes, widely spaced
palette #25302e #d6dbda #465f67 #729782 #c171a6
That is the same day. The model cannot draw a weather report from it, because there is no weather in it. Temperature becomes hue through a piecewise interpolation — violet when it freezes, teal when it is mild, amber and then red as it climbs. Cloud cover drains chroma and thickens the veiling. Wind decides whether lines lean. Day length puts the horizon high or low. A test in the suite asserts that no measurement ever appears as a string in the brief, because this is the kind of rule that quietly breaks.
The moon takes it one step further: the code draws the moon, not the model. The agent is told only to leave a circular void in a given region and is never told the phase. Afterwards the Lambda composites in an exact terminator — an ellipse of semi-minor axis  r·|1 − 2f|  for illuminated fraction  f . Two hands on the same page.

How it was built

Python 3.13 on Lambda, no dependencies beyond the boto3 already in the runtime. One CloudFormation stack. Nine small modules, each with one job.
Services: Amazon Bedrock (Claude Sonnet 4.5) draws the page. AWS Lambda runs the routine. Amazon EventBridge Scheduler wakes it at 06:15 local — Scheduler rather than an EventBridge rule specifically for  ScheduleExpressionTimezone , so the agent keeps local mornings across daylight saving. Amazon DynamoDB holds the memory. Amazon S3 hosts the gallery as a static site. CloudWatch Logs keeps the record. Weather comes from Open-Meteo, which needs no API key.
EventBridge Scheduler → Lambda → ┌ Open-Meteo (today's sky)
├ DynamoDB (memory + style genome)
├ Bedrock (draws the SVG)
├ validator (rejects, argues, retries)
└ S3 (publishes, rebuilds gallery)
The validator is the part I'd defend hardest. The page is written by a language model and then served from a public bucket, so it is checked before anyone sees it: well-formed XML, no  <script> , no  <foreignObject> , no  on*  handlers, no external references, only same-document  url(#id) , only the five colours it was given, inside an element budget, under 320 KB. Violations are written as English sentences and handed straight back to the model, which redraws. Three rounds. If it still fails, the day is skipped and the refusal is recorded — publishing a page that failed every check would quietly corrupt the codex, and an agent nobody is watching needs to be able to decline.
Memory and drift. DynamoDB carries a style genome — stroke weight, symmetry, negative space, complexity, hue drift — that mutates a little each night. Four traits wander; complexity trends upward with a ceiling, so the agent grows more ambitious as its body of work grows. The last six archetypes are remembered and forbidden, so it cannot repeat itself.

What I learned

Constrain the model by removing information, not by adding instructions. I spent a while writing longer and longer prompts telling it not to make a chart. What actually worked was making the chart unmakeable.
Negative constraints beat positive ones for style. "Draw beautifully" did nothing. The line that changed the output was: if it could be mistaken for a dashboard, a blueprint or a wireframe, it has failed — with the specific banned vocabulary listed. Axis lines, full-width rules, evenly spaced repeats, ladders of identical steps.
I ran a bake-off and the honest result surprised me. On the same brief, Nova Pro produced genuinely attractive pages but under-populated the canvas — 17 drawn elements against a floor of 44 — and passed validation inconsistently, sometimes burning all three attempts. Claude Sonnet 4.5 passed first try on every brief I threw at it. For a scheduled agent that nobody is watching, reliability beat charm, so Sonnet draws and the model stays configurable.
Test the geometry you think is obvious. My first moon rendered every new moon as full and every full moon as dark: I had the SVG arc sweep flags backwards. I only caught it because I rendered eight phases and looked at them. There is now a test.
24 offline tests, no AWS or Bedrock needed to run them.
The retry loop earns its keep in production. The very first page the deployed agent drew was rejected once before it passed — exactly the failure mode the local rehearsal had not shown me. An agent nobody is watching needs to be able to catch itself.

Links

Built for the AWS Weekend Challenge. One page a day, and I never have to open it.
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