AWS Builder Center
Weekend Creative Agent Challenge: CosmicWhisper — Daily Zodiac Horoscope Agent

Weekend Creative Agent Challenge: CosmicWhisper — Daily Zodiac Horoscope Agent

šŸ”® CosmicWhisper is an autonomous AI agent that generates personalized daily horoscope readings for all 12 zodiac signs every morning — powered by Amazon Bedrock Nova, scheduled via EventBridge, and served as a beautiful cosmic-themed website on S3. No manual trigger needed — it simply runs, interprets the moon phase, season, and planetary energy, and has fresh readings ready when you wake up.

Vision & What It Does

There's a peculiar magic that happens at the intersection of ancient traditions and modern technology. As someone who has spent years studying both computational systems and the enduring human fascination with celestial patterns, I found myself captivated by a deceptively simple question: What if an AI agent could channel the voice of the cosmos — not as mimicry, but as genuine creative interpretation?
CosmicWhisper was born from that question. It is an autonomous agent that awakens every morning at 6:00 AM UTC — before most of us have finished our first coffee — and generates fresh, contextually aware horoscope readings for all twelve zodiac signs. There is no button to push, no manual trigger, no human in the loop. The agent simply runs, day after day, weaving together the current moon phase, the season's energy, the ruling planet of the weekday, and broader planetary themes into twelve distinct narratives.
What makes this more than a novelty is the attention to cosmic context. The agent calculates the approximate moon phase algorithmically (using Julian Day Number calculations against a known new moon reference), determines the astronomical season, and selects from a curated set of planetary themes. All of this context is injected into a carefully engineered prompt that instructs the AI to write not as a generic fortune cookie dispenser, but as a "wise and poetic celestial oracle." The result is horoscopes that feel genuinely different each day — because the inputs are genuinely different each day.
Users simply visit the S3-hosted website, see today's cosmic conditions displayed beautifully at the top of the page, and tap their zodiac sign to reveal their personalized reading complete with a lucky number, lucky color, mood of the day, most compatible sign, and a piece of actionable daily advice. The interface is built with pure CSS — animated twinkling stars, nebula glow effects, and a responsive grid that works elegantly on both desktop and mobile.

How You Built It

The journey began, as these things often do, with prompt engineering. Getting an LLM to generate horoscopes that feel authentic rather than generic is a non-trivial creative challenge. Early iterations produced readings that were interchangeable between signs — bland affirmations that could apply to anyone on any day. The breakthrough came from two design decisions: first, injecting rich contextual data (specific moon phase percentages, named day energies, seasonal themes) so the model had concrete material to weave from; and second, explicit style instructions that demanded vivid imagery, sensory language, and sign-specific personality.
The architecture coalesced around serverless simplicity. AWS Lambda was the obvious choice — I needed a function that runs once daily for about 15 seconds, not a server sitting idle for 23 hours and 59 minutes. EventBridge provides the cron scheduling with zero operational overhead. Bedrock's Converse API gave me access to Amazon Nova Lite without managing any model infrastructure.
The most interesting technical challenge was JSON parsing robustness. Large language models, even when explicitly instructed to return "only valid JSON," occasionally wrap their response in markdown code fences, add explanatory text before or after, or produce slightly malformed structures. I built a three-layer parsing strategy: try direct Ā json.loads()Ā , then extract from markdown code blocks, then find the outermost JSON boundaries. This makes the agent resilient to the creative whims of the model.
The HTML generation was a deliberate artistic choice. Rather than using a templating engine or React, I generate the entire page as a formatted string within the Lambda function. This keeps the deployment as a single file with zero dependencies beyond boto3 (included in the Lambda runtime). The cosmic theme uses CSS custom properties, keyframe animations for star twinkling, and Ā backdrop-filterĀ  for glass-morphism effects — all pure CSS, no external assets or CDN dependencies.
Moon phase calculation deserved particular attention. Rather than calling an external API (which would add latency and a failure point), I implemented the astronomical algorithm directly: calculate the Julian Day Number, find the days elapsed since a known new moon reference (January 6, 2000), divide by the synodic month length (29.53059 days), and map the cycle position to phase names and illumination percentages. It's approximate — off by perhaps a day — but entirely sufficient for creative horoscope context and beautifully self-contained.

AWS Services Used / Architecture Overview

The architecture is intentionally minimal — four services, each doing exactly one thing:
ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│ EventBridge │────▶│ Lambda │────▶│ Bedrock Nova │ │ S3 │
│ cron(0 6 *)│ │ Python 3.12 │ │ (Converse API) │ │ Static Site │
│ │ │ │────▶│ │ │ │
│ $0.00/mo │ │ $0.00/mo │ │ ~$0.006/mo │ │ $0.00/mo │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
│ ā–²
│ Upload index.html + archive.json │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Amazon EventBridge — The heartbeat. A single cron rule (Ā cron(0 6 * * ? *)Ā ) fires at 6:00 AM UTC daily. EventBridge custom rules are entirely free — no cost regardless of volume.
AWS Lambda — The orchestrator. A single Python 3.12 function (512 MB, 90-second timeout) that calculates cosmic context, constructs the prompt, calls Bedrock, generates HTML, and publishes to S3. With 30 invocations per month at ~15 seconds each, this is deep within the Free Tier's 1 million requests and 400,000 GB-seconds.
Amazon Bedrock (Nova Lite v1) — The creative engine. Nova Lite is Amazon's efficient model, priced at approximately $0.00006 per 1,000 input tokens and $0.00024 per 1,000 output tokens. Each daily invocation costs roughly $0.0002 — about $0.006 per month. Bedrock requires no infrastructure management, no model hosting, no GPU provisioning.
Amazon S3 — The stage. Configured as a static website, it serves the generated HTML to visitors. Storage is measured in kilobytes (a single HTML page). The Free Tier provides 5 GB of storage and 20,000 GET requests — far beyond what a daily horoscope page requires.
The total monthly cost is effectively $0.006 — less than a penny. The architectural elegance here is that every component is either free or trivially cheap, yet the result is a fully autonomous creative agent that produces genuinely novel content daily.

What You Learned

Building CosmicWhisper reinforced several principles that I now emphasize in my teaching:
Prompt engineering is creative writing. The quality of the horoscopes improved dramatically not when I changed the model or the temperature setting, but when I improved the prompt. Giving the model a persona ("wise and poetic celestial oracle"), specific material to work with (moon phase data, day energies), explicit anti-patterns to avoid ("avoid generic platitudes"), and concrete structural requirements (JSON format with specific fields) — this is authorship. The prompt is the creative artifact.
Constraints breed elegance. The Free Tier limitation wasn't a burden — it was a design compass. It pushed me toward serverless (no idle EC2 costs), toward a single-file Lambda (no layers, no dependencies), toward pure CSS aesthetics (no CDN, no JavaScript frameworks), and toward S3 hosting (no server management). Every constraint simplified the architecture.
Autonomous agents need resilience, not perfection. The three-layer JSON parser, the fallback horoscope text, the graceful error handling — these aren't about making the agent perfect. They're about ensuring it runs reliably every single day without human attention. An agent that fails silently on day 47 because of an edge case in LLM output formatting isn't truly autonomous.
The Nova model surprised me. I initially chose Nova Lite purely for cost reasons, expecting to upgrade later. I never needed to. Given sufficiently rich context and clear creative direction, Nova Lite produces horoscope readings with genuine poetic quality — varied vocabulary, sign-appropriate personality, natural weaving of cosmic themes. The lesson: model selection matters less than prompt quality for creative tasks.
Serverless is the natural habitat of autonomous agents. An agent that acts once daily doesn't need a server. It needs an event, a function, and a destination. EventBridge + Lambda + S3 is perhaps the most natural expression of this pattern — pure event-driven computation with zero idle cost.

Link to App or Repo



CosmicWhisper runs autonomously every morning, rain or shine, asking nothing of us — only offering what the stars have to say. Sometimes the most profound technology is that which simply shows up, day after day, with something worth reading.
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