AWS Builder Center
Weekend Creative Agent Challenge: Tinai Poet Daily

Weekend Creative Agent Challenge: Tinai Poet Daily

Every morning it reads the sky over Madurai and writes a Sangam Tamil poem about it. Nobody has to open anything. An agent on AWS Bedrock.

Vision & what it does

Last weekend I built Tinai Poet: an app that reads a modern situation into one of the five classical Tamil landscapes and writes you a poem. It worked, and it sat there — doing nothing until somebody typed into it.
That is the problem this week's challenge names precisely. The best tool is the one you never have to open.
Tinai Poet Daily is the same poetic engine with the human removed from the loop. Every morning at dawn, without anyone visiting the site, it reads the actual weather over Madurai, decides which of the five landscapes today belongs to, and writes a poem about it. By the time you look, the poem is already there.

Why weather, specifically

This is the part I want to make the case for, because it is not a gimmick bolted onto a tradition.
Sangam Tamil poetics — codified in the Tolkāppiyam, the oldest surviving Tamil grammar, which uniquely among ancient grammars sets down rules for poetics alongside phonology and syntax — divides all human experience into five thinai, or landscapes. Each carries a fixed vocabulary: a flower, a bird, a time of day, a terrain, an occupation, a deity. And crucially, the emotion is never named. The poet describes the shore, the lily, the fading light, and a reader who knows the convention feels the grief exactly.
  • Kurinji — mountains, midnight, the kurinji flower, the peacock. Union.
  • Mullai — forest and pasture, evening, jasmine, the koel. Patient waiting.
  • Marutham — farmland, dawn, the marutham flower, the heron. The lovers' quarrel.
  • Neithal — seashore, sunset, blue water lily, the seagull. Separation.
  • Palai — parched wasteland, midday, the paalai flower, the vulture. Parting and hardship.
Thinai was always tied to terrain, season, and time of day. The classification system already binds landscape to weather. Mapping today's real conditions onto a thinai is not a modern imposition — it is using the framework the way it was designed to work, with live data standing in for the poet's own window.
So: monsoon rain or thick mist becomes kurinji. Dry heat under a clear sky becomes palai. Humid, still air becomes neithal. Overcast and calm becomes mullai. Clear and warm becomes marutham.

What it produces

A real poem from the agent, generated on a 28.9°C morning at 60% cloud cover with still air — mapped to mullai, the pasture, the landscape of waiting:
மேய்ச்சல் வயல் விளிம்பில் குயில் பாடும் முல்லையின் பாதையில் காலை வானம் மேகக் கனிவுடன் காலை மழை காற்றுக் குளிரில் கோவலர் வீடு
At the meadow's edge, the koel sings its song In the jasmine's path, the morning sky With cloud's promise, the morning rain In the cooling breeze, the shepherds head home
Bilingual, Tamil first. The koel and the jasmine are mullai's own fixed vocabulary. The waiting is never mentioned.
The agent also reads its own past: before writing, it pulls the imagery it used on recent days of the same thinai and is instructed not to repeat it. Over time, its vocabulary within each landscape widens rather than settling into a groove.



How I built it

The constraint I refused to relax

The five landscapes are hardcoded in a data file. The model never recalls a flower, a bird, or a deity from its own memory — it only receives them as supplied data and writes imagery from them. Ask a general-purpose model about Sangam poetics and it produces something plausible and subtly wrong: a flower attached to the wrong landscape, an invented deity. On a two-thousand-year-old tradition, subtly wrong is worse than obviously wrong, because nobody catches it.
The same principle governs the weather mapping. The thinai is chosen by deterministic rules in code, not by model judgement. Explicit thresholds, first-match-wins, a documented fallback. The model writes the poem; it does not decide what today is.

The mapping, and what it taught me about my own city

The rules went through a real correctness failure worth recording. An early threshold let palai — the wasteland — fire on a mild, cloudy 28°C morning, producing a poem about dry riverbeds and circling vultures on a day that was nothing of the sort. The premise of this agent is that the weather is real; a poem that contradicts the sky outside is not a style problem, it is a bug.
The fix added a cloud ceiling to palai. The consequence was a distribution nobody would design on purpose: across 60 days of historical Madurai data, mullai 42%, neithal 32%, marutham 17%, kurinji 8%, palai 2%.
I nearly rebalanced it. Then I realised the distribution is the correct answer, not a compromise. Madurai dawns in August genuinely are overcast, humid and still — the landscape of patient waiting. Palai is rare because the wasteland is an extreme, and the Sangam poets did not write palai every day either. A mapping that produced five evenly distributed landscapes would be a mapping that had stopped looking at the weather.
The agent writes mullai most often because this city, this month, is mullai.

Three ways the model broke the guarantee

The interesting engineering happened in the gap between "the prompt says don't" and "the code enforces it." I found three distinct failure modes, each needing its own answer.
1. Negative constraints act as source lists. The agent passes recent imagery to the model with an instruction not to reuse it. On one run, a mullai poem came back containing "palai flowers" and "vultures" — palai's fixed flower and bird, imported wholesale. The exclusion list had been built from the last seven days regardless of thinai, so palai's vocabulary was sitting in the prompt under a "do not use" heading. The model read it as available material.
This is the lesson I would most want another builder to take away: a list of things not to use is still a list of things. Telling a model to avoid a concept puts that concept in its context. The fix was to filter recent imagery to the same thinai only — which, on reflection, is the only case where "don't repeat yourself" was ever meaningful, since different landscapes have disjoint vocabularies by definition.
2. Acoustic near-miss substitution in Tamil. After fixing the above, the English stanza came back clean — and the Tamil did not. Where jasmine (முல்லை) should have been, it wrote கோயில் — temple. Where the koel (குயில்) belonged, it wrote கோவில் — temple again. Fluent, confident, and wrong on precisely the two words carrying the entire meaning.
A validator checking for foreign vocabulary passed this, because no other landscape's words were present. The required words were simply absent. That needed a positive check: the Tamil stanza must contain that thinai's canonical flower and bird in correct script, drawn from the same data file, with a retry on failure.
3. Constraint satisfaction at the cost of coherence. With three validators pulling, a stanza came back that satisfied every check while describing evening and morning simultaneously in four lines. I deliberately did not add a fourth validator for this — past a point, a model optimising against checks writes worse poems. That one stayed a prompt instruction.

Building order

I extended rather than rebuilt. Create, Play and Gallery from last week are untouched; the agent is an additive path. Phases ran: weather mapping first (reviewed before any code depended on it), then the agent Lambda invoked manually, then the scheduler, then the display page, then backfill and documentation — with a deliberate stop after the scheduler, because that is the point at which the challenge's core requirement is actually met and everything afterwards is presentation.
The archive was backfilled across 13 days using historical Open-Meteo data, run through the identical pipeline and the identical three validators. Three of those thirteen required a real retry, which is the clearest evidence I have that the validators are load-bearing rather than decorative. Every backfilled entry is flagged in the data and labelled in the UI. They are not presented as scheduled output, because they were not.



AWS services used

Service
Purpose
Amazon EventBridge Scheduler
Fires the agent daily at 06:00 IST — the autonomy mechanism, and the reason this is an agent rather than an app
AWS Lambda
The agent handler: fetch weather, map to thinai, read recent imagery, generate, validate, persist. Invoked by EventBridge, never by a public endpoint
Amazon Bedrock (Amazon Nova Pro)
Bilingual stanza generation under supplied-vocabulary constraints
Amazon DynamoDB
Single table — DAILY#<date> items holding the poem, the weather reading that produced it, the rule that fired, and the imagery used
AWS Amplify Hosting
Next.js frontend and the /today page with the dated archive
Amplify SSR compute (managed Lambda)
The today API route reading from DynamoDB
Amazon CloudWatch
Structured logging on every run: invocation, weather, thinai chosen, rule fired, imagery excluded, Bedrock latency, write confirmation
AWS IAM
Scoped execution roles — Bedrock invoke on one model, DynamoDB on one table, no static credentials anywhere



Architecture

Amazon EventBridge Scheduler
(recurring, 06:00 IST daily)
|
| scheduled invoke — no human, no endpoint
v
AWS Lambda — the agent
|
+----------+-----------+-------------------+
| | | |
v v v v
Open-Meteo weatherThinai.ts DynamoDB Amazon Bedrock
(live (deterministic (recent same- Nova Pro
weather) rules in code) thinai imagery) |
v
three validators
(mood words / foreign
vocab / required Tamil)
|
v
DynamoDB DAILY#<date>
|
v
Next.js /today (Amplify Hosting)
today's poem + weather + archive
The flow, once a day, unattended: EventBridge fires → Lambda fetches Madurai's current conditions from Open-Meteo → deterministic rules select a thinai → DynamoDB returns imagery from recent days of that same thinai → Bedrock writes a bilingual stanza from the landscape's fixed vocabulary, excluding recent imagery → three validators check the output, retrying once on failure → the poem is written to DynamoDB with its full weather provenance → the  /today  page serves it to whoever arrives next.
Notably, this Lambda has no public Function URL. Its only trigger is the scheduler. That is what makes it an agent rather than an API with a cron job pointed at it.



What I learned

Negative constraints are still context. The single most useful thing I found. Telling a model not to use something places that thing in front of it, and it will sometimes reach for it anyway. If a category of output must not appear, filter it out before the prompt is built — do not describe it in the prompt as forbidden.
Validators need to check for absence, not just presence. My first validator caught wrong words appearing. It could not catch right words disappearing. Those are genuinely different failure modes, and in a second language I read but the model handles imprecisely, the second one is easier to ship without noticing.
But there is a ceiling on validators. Adding a fourth to enforce temporal coherence would have produced stanzas that pass every check and read like a checklist. Some qualities have to stay in the prompt and be accepted as imperfect. Knowing which is a judgement call, not a rule.
Deterministic where it matters, generative where it doesn't. The thinai choice is code. The vocabulary is code. Only the arrangement of images into verse is model work. Every time I let the model take on more of the structural decisions, the output got worse in ways that were hard to see from the outside — which is the dangerous kind.
An agent's output distribution tells you something true about the world it observes. I built a system to write in five landscapes and it writes overwhelmingly in one. My instinct was to fix that. The correct response was to notice that Madurai in August really is a landscape of waiting, and to let the agent say so.
Design the evidence, not just the system. The challenge asks for demonstrated autonomy, not claimed autonomy. That changed how I built: structured logging from the first run, generation timestamps surfaced in the UI, a dated archive, and honest labelling separating backfilled entries from scheduled ones. A system that works but cannot show it worked is, for evaluation purposes, indistinguishable from one that doesn't.



Link

The repository contains the agent Lambda, the weather-to-thinai mapping with its thresholds, all three validators, the backfill script, and a  DECISIONS.md  recording every non-obvious choice made across both weekends — including the failures above, written up as they happened rather than tidied afterwards.
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