AWS Builder Center
Weekend Showcase Challenge: Tinai Poet

Weekend Showcase Challenge: Tinai Poet

Encoding 2,000-year-old Tamil poetics in Python so Nova Pro writes within the rules instead of guessing at them.

Introduction

Tinai Poet is a Sangam Tamil poetry engine built on Amazon Bedrock. It started as my entry for the Weekend Creative Challenge, then grew a second half — Tinai Poet Daily, an autonomous agent that writes and publishes one poem a day without me touching it — for the Weekend Creative Agent Challenge.
For this season finale I am submitting them as one build, because that is what they actually are: an engine and the agent that drives it. This article covers both.



The Problem

Classical Tamil poetry from the Sangam era is not decorative verse. It runs on a formal system called thinai — a poetics where landscape, season, time of day, flora, fauna and emotional mood are bound together by convention. Kurinji (hills) carries union. Mullai (forest) carries patient waiting. Marutham (farmland) carries lovers' quarrels. Neithal (coast) carries separation. Palai (wasteland) carries hardship and parting.
If you ask a general-purpose LLM for "a Sangam Tamil poem," you get something that reads Tamil-ish and ignores the system entirely. It will put a heron in the hills and a monsoon in the wasteland. The form is the meaning, and a model guessing at it produces output that a reader who knows the tradition will immediately reject.



The Solution

I did not try to prompt the model into understanding thinai. I encoded the mapping deterministically in code and gave the model a much narrower job.
The flow is: real-world inputs (location, season, weather, time of day) → a deterministic thinai resolver written in plain Python that selects the landscape and the permitted imagery set → a tightly constrained prompt to Amazon Bedrock Nova Pro that generates the verse within those constraints → storage and display.
The model writes the poetry. The rule engine decides what a valid poem is allowed to contain. That split is the whole design.



Vision

Two entry points, one engine:
  • On demand — a reader opens the app, and gets a poem grounded in a real landscape and a real thinai, with a short note explaining which thinai was selected and why. The explanation is the educational part.
  • Autonomous — Tinai Poet Daily wakes up on a schedule, pulls live weather from Open-Meteo, resolves the thinai from actual conditions, generates the day's poem, and writes it to the archive. Nobody is in the loop. On August 22 I confirmed a fully autonomous scheduled run end to end.



Key Features

  • Deterministic thinai resolution — landscape, season and mood are selected by rules, not by the model
  • Live weather grounding via Open-Meteo, so the poem reflects real conditions
  • Amazon Bedrock Nova Pro for generation under an explicit imagery constraint set
  • Autonomous daily generation on an EventBridge schedule
  • A growing archive of past poems, each with its resolved thinai recorded
  • Runs entirely within AWS Free Tier



How I Built It

Weekend one — the engine. Built the thinai resolver first, before touching Bedrock at all. Once I could feed it conditions and get back a correct landscape and imagery set, the model integration was the easy part. Frontend on AWS Amplify, poems and metadata in DynamoDB.
Weekend two — the agent. Wrapped the engine in a scheduled execution path, added the Open-Meteo fetch so the inputs came from the real world instead of from me, and put it on an EventBridge schedule. The hard part was not the agent logic — it was proving it actually ran unattended.
This weekend — the showcase. Bringing both halves together and documenting the design properly.



Technical Stack

Layer
Technology
Frontend
AWS Amplify «confirm framework — React?»
Backend
«AWS Lambda / Amplify backend — confirm»
Database
Amazon DynamoDB
AI
Amazon Bedrock — Nova Pro
External data
Open-Meteo weather API
Scheduler
Amazon EventBridge
Hosting
AWS Amplify
Authentication
«fill or delete this row if the app is open»

AWS Services Used

AWS Service
Purpose
Amazon Bedrock (Nova Pro)
Generates the Tamil verse within the constraints supplied by the thinai resolver
AWS Amplify
Hosts and deploys the frontend
Amazon DynamoDB
Stores generated poems, resolved thinai, and the conditions each poem was grounded in
Amazon EventBridge
Triggers the daily autonomous generation run
AWS Lambda
Executes the scheduled generation path «confirm»
Amazon CloudWatch
Logs from the scheduled runs — how I verified the agent actually fired unattended



Architecture

┌──────────────────────┐
│ EventBridge Schedule│
│ (daily run) │
└───────────┬──────────┘
│
▼
Open-Meteo ──────► ┌───────────────────┐
(live weather) │ Thinai Resolver │
│ (deterministic │
│ Python rules) │
└─────────┬─────────┘
│ landscape + permitted imagery
▼
┌───────────────────┐
│ Amazon Bedrock │
│ Nova Pro │
└─────────┬─────────┘
│ generated verse
▼
┌───────────────────┐
│ DynamoDB │
│ (poem archive) │
└─────────┬─────────┘
│
▼
┌───────────────────┐
│ AWS Amplify │
│ (frontend) │
└───────────────────┘

Both the on-demand path and the scheduled path converge on the same resolver and the same Bedrock call. The only difference is where the input conditions come from — a user request, or the clock plus a weather API.



AI Architecture

The interesting decision here is how little the model is asked to do.
Prompt engineering as constraint, not instruction. The prompt does not say "write a Sangam poem." It says: here is the thinai, here is the landscape, here is the permitted imagery, here is the mood — write within this. The rules arrive as data in the prompt, resolved before the model is invoked.
Deterministic guardrails. Because thinai selection happens in code, the same conditions always produce the same landscape. The creative variance sits entirely inside the generation step, where variance is actually wanted. This also makes the system testable — I can assert on resolver output without calling the model at all.
Why Nova Pro. Good multilingual handling for Tamil, and the cost profile made a daily scheduled run genuinely free-tier viable.



Development Challenges

Challenge
Solution
Model ignoring poetic conventions when asked directly
Moved thinai selection out of the prompt entirely and into deterministic Python; the model now generates within supplied constraints rather than choosing them
Verifying the agent was truly autonomous
Waited for an unattended scheduled execution and confirmed it in CloudWatch logs rather than trusting a manual invoke
AWS account and infrastructure setup issues
A significant amount of this project's time went into account, permission and region configuration before any code ran — budget for this if you are building on a weekend deadline
Grounding poems in something real
Wired Open-Meteo in so conditions come from actual weather rather than random selection

Engineering Decisions

Rules over prompting. The single decision that made this project work. Every time I moved logic out of the prompt and into code, output quality went up and debugging got easier.
DynamoDB over a relational store. Access pattern is "get today's poem" and "list the archive." No joins, no reason for SQL.
Amplify over rolling my own hosting. For a weekend build, deployment time is the scarcest resource.

Security

  • IAM roles scoped to the specific Bedrock model and DynamoDB table the functions need, rather than broad service access
  • No secrets in source — configuration through environment variables «confirm»
  • DynamoDB encryption at rest is on by default
  • Open-Meteo requires no API key, which removed a secrets-management surface entirely

Performance

Poem generation is not latency-critical — the daily run has no user waiting on it, and on-demand generation is a few seconds of Bedrock inference. Cold starts are irrelevant for a once-daily schedule. The resolver itself is pure computation and effectively free.

Cost Analysis

Service
Estimated Monthly Cost
Amazon Bedrock (Nova Pro)
Cents at one generation per day
DynamoDB
Free Tier
EventBridge
Free Tier
Lambda
Free Tier
Amplify
Free Tier
The whole thing runs inside Free Tier at this volume.



What I Learned Across the Summer

Technical. Constrain the model, do not instruct it. The more structure I could resolve deterministically before the LLM call, the better and more consistent the output.
AWS. EventBridge plus a small function is a complete autonomous agent. You do not need heavy orchestration to make something run on its own. Separately: account and IAM setup will eat more of your weekend than you plan for.
AI. A cultural or formal system encoded in code beats the same system described in a prompt. Every time.
Architecture. Building the on-demand path first and the scheduled path second meant the agent was almost free — it reused the entire engine and only changed the input source.
What surprised me. Watching a scheduled run fire on its own and produce a correct poem felt qualitatively different from running it myself. That is the actual line between an app and an agent.



Future Improvements

  • Audio recitation of the generated verse
  • Multiple regional grounding, so the thinai reflects the reader's own landscape
  • Side-by-side classical references so readers can compare the generated poem against the tradition
  • Deeper archive browsing by thinai



Conclusion

Tinai Poet started as a weekend experiment in whether a 2,000-year-old poetics could be encoded well enough to constrain a modern language model. It ended as a small autonomous system that writes a grounded poem every day on its own. The lesson I am taking out of this summer is that the interesting engineering in AI applications is usually in what you decide before the model call, not in the model call itself.
If you know Sangam literature far better than I do, I would genuinely like to be told where the resolver gets it wrong.



Resources

  • Design decisions and postmortems:  DECISIONS.md  in the repo — the account migration story, the bug writeups, and why each call went the way it did



Tagging a Builder

Thanks to Saravanan R — «one line on what he actually helped with this summer». Also to the AWS User Group Madurai and the Madurai AI Community for keeping the momentum going all season.
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