AWS Builder Center
Weekend Agent Challenge: The Accountability Pet

Weekend Agent Challenge: The Accountability Pet

A virtual creature that lives entirely in your inbox — it doesn't wait for you to open an app, it wakes up on its own schedule, checks whether you actually did the thing you said you'd do, and reacts in character based on your real streak.

AI Engineer | AWS Community Builder
Last weekend's challenge was about paste-in, get-something-back productivity tools. This weekend's challenge asked for something with more legs: an agent that works while you're not looking, and has a result ready when you get back. That framing changed how I thought about the build almost immediately. A dashboard you have to remember to open isn't really "always-on" — it's just a tool waiting for you to show up. I wanted to build something that shows up for you instead.
That's how I landed on The Accountability Pet — a small virtual creature, built as a state machine rather than a game engine, that you keep alive by actually doing a habit you committed to. It checks in with you every day by email, on its own, and its mood visibly shifts based on whether you followed through. No dashboard required to interact with it. It just lives in your inbox and reacts to your real-world behavior, reported back with a single click.

Vision & What the Agent Does

The core idea is simple, but it's a different shape of problem than most productivity tools solve. Most habit trackers ask you to open the app and log something — which means the tool only works if you remember it exists. I wanted the opposite: a tool that remembers you, and only asks something of you once a day, briefly, in a channel you already check constantly.
Here's the full loop:
  1. Setup, once. You sign in, name your pet, tell it the habit you're building ("write 500 words a day," "go to the gym," "study Spanish"), pick a personality tone, and set a daily check-in time.
  1. It runs on its own, forever. An hourly scheduled trigger — not a button — decides whether it's a given pet's check-in hour. If it is, the agent looks at that pet's real history: did the owner respond to yesterday's check-in? If not, that's treated as a miss, and the pet's mood degrades before anything else happens.
  1. It writes something new every time. The agent asks a language model to generate an in-character message that reflects the pet's current mood, streak, and history — not a templated string, a genuinely different message shaped by what's actually happening.
  1. It reports back by email, with two buttons: "Yes, I did it" and "Not yet." One click, no login, no app to open.
  1. It reacts. Clicking either button updates the pet's streak and mood, and the agent writes a short, immediate reaction message back to you — encouraging if you kept your streak, gently worried if you didn't.
Ignore it for two or three days and the pet visibly struggles — the tone gets more worried, then more critical, and Nova switches to a stronger model to write those higher-stakes messages with real nuance instead of generic disappointment. Keep showing up and it moves toward "thriving," and the messages start referencing your actual streak number like a companion who's paying attention, not a notification.
That emotional arc is the whole point. This isn't a report. It's closer to a relationship than a tracker, which is exactly the kind of pattern I wanted to explore that felt genuinely different from the productivity-dashboard mould.




How I Built It

The stack decision

I wanted this fully serverless and fully autonomous from the first line of code — no server that has to stay running, no cron job on a box I manage. The trigger had to be a first-class AWS primitive, not a workaround.
  • Frontend: React (Vite), for the setup/dashboard companion view
  • Backend: five Python Lambda functions
  • Infrastructure: AWS CDK in Python
  • Trigger: Amazon EventBridge Scheduler, firing hourly
  • AI: Amazon Bedrock, using both Nova Lite and Nova Pro
  • State: DynamoDB
  • Delivery: Amazon SES
  • Auth: Amazon Cognito
  • Hosting: AWS Amplify
The one architectural decision I want to call out: I deliberately used two Nova models, routed by mood. Routine check-ins (thriving, content, neutral) go to Nova Lite — fast and cheap, appropriate for a message that's mostly upbeat and low-stakes. But when a pet is worried, critical, or has gone quiet for days, I route that message to Nova Pro instead. Writing a message that's genuinely, believably worried about someone — without being preachy or guilt-tripping them — needed a model with more room for nuance. That felt like the right trade-off: don't pay for the expensive model on every call, but don't cheap out on the moments that actually matter emotionally.

Key decision: the "how does it check in" problem

The most interesting design constraint was this: real SES inbound email (parsing an actual one-word reply like "yes" typed back to the pet) requires owning a domain with MX records pointed at SES. That's a reasonable thing to set up for a company, but not something I wanted to force onto a weekend personal-account build.
So instead, every check-in email contains two links, each carrying a short-lived, HMAC-signed token encoding the pet ID, the answer, and an expiry — verified statelessly by a Lambda behind API Gateway, with no login needed. It preserves the "no dashboard, one-word interaction" spirit of the original idea while staying realistically deployable in a weekend on a personal AWS account. I think of it as the async equivalent of a one-word reply: still one click, still no app-opening, just delivered through a signed link instead of a parsed inbound email.

Challenge: the SES sandbox

By default, every new AWS account's SES access lives in a sandbox: you can only send to verified addresses, capped at 200 emails a day. That's completely fine for a personal habit tracker, but it meant I had to build identity verification into the product flow itself rather than treat it as a one-time setup step. When someone signs up and hatches their first pet, the backend automatically registers their email as an SES identity and tells them, right in the UI, to check their inbox for AWS's verification link before their first check-in goes out. It's a small UX wrinkle worth being upfront about rather than hiding.

Challenge: locking down who can see whose pet

My first pass let the frontend pass an  owner_email  straight from a form field to the API — which meant anyone who knew (or guessed) an email address could see someone else's pet data. I fixed this properly rather than patching around it: added Amazon Cognito in front of API Gateway with a JWT authorizer, and rewrote every Lambda to read the caller's identity from the verified JWT claims ( event.requestContext.authorizer.jwt.claims.email ) instead of trusting anything the client sent. Every  get_pet  and  trigger_now  call also checks that the pet actually belongs to the authenticated caller before returning anything. The one-click email links stay unauthenticated by design — there's no browser session when you click a link from your email client — but they're protected by the signed token instead.

Challenge: Cognito's browser polyfill gap

Small but worth mentioning for anyone hitting the same wall:  amazon-cognito-identity-js  expects Node's  global  object, which the browser doesn't have and which Vite (unlike older webpack-based tooling) doesn't polyfill automatically. It surfaced as a blank page and a  ReferenceError: global is not defined . One line in  vite.config.js  — aliasing  global  to  window  at build time — fixed it completely.



AWS Services Used / Architecture Overview

  • Amazon EventBridge Scheduler — the heartbeat. Fires hourly, invoking the check-in Lambda with no human involved.
  • AWS Lambda (Python) — five functions:  daily_checkin  (the agent itself),  process_response  (handles the email-link clicks),  create_pet ,  get_pet ,  trigger_now  (a demo/debug trigger for showing the agent act on demand).
  • Amazon Bedrock (Nova Lite + Nova Pro) — writes every in-character message via the Converse API, routed by the pet's current mood.
  • Amazon DynamoDB — single table holding each pet's streak, mood, history, and check-in schedule.
  • Amazon SES — sends the daily check-in email and the reaction email, both styled HTML with the pet's mood reflected visually.
  • Amazon Cognito — user pool + app client backing sign-up/sign-in; issues the JWT the API Gateway authorizer validates.
  • Amazon API Gateway (HTTP API) — Cognito JWT authorizer in front of all  /pets*  routes; a separate unauthenticated  /respond  route for the one-click email links, protected by the HMAC-signed token instead.
  • AWS Secrets Manager — holds the HMAC signing key for those tokens.
  • AWS CDK (Python) — the entire stack, defined and deployed as code.
  • AWS Amplify Hosting — serves the React frontend as a static build.
How the agent is triggered: EventBridge Scheduler on a  rate(1 hour)  expression invokes  daily_checkin  every hour, with no HTTP request, no button, and no human in the loop. On each tick, the function scans DynamoDB for pets whose configured check-in hour (stored in UTC) matches the current hour and are still active. For each one, it checks whether yesterday's check-in ever got a response — if not, that silence itself becomes a mood-degrading event — then asks Bedrock for a fresh message and sends it via SES. That's the entire autonomous cycle, and it runs forever without anyone touching a dashboard.

Architecture diagram



Agent-Flow Sequence Diagram



Pet mood state machine





What I Learned

1. Bedrock's Converse API makes multi-model routing trivial. Because Nova Lite and Nova Pro share the same Converse request shape, swapping models based on mood was a one-line decision in the code, not a structural change. I didn't expect model selection to be this cheap to implement once the prompt structure was stable.
2. Writing a good system prompt for "be a struggling creature, not a nagging app" takes real iteration. My first attempts at the worried/critical prompts came out either flatly robotic or overly guilt-trippy, neither of which is what I wanted. What worked was being explicit in the system prompt about what the pet is not allowed to do — no generic advice, no guilt-tripping, no "As an AI" — and handing the model the actual streak numbers so it had something concrete to react to instead of writing in the abstract.
3. EventBridge Scheduler is a genuinely different mental model from EventBridge Rules. I'd used EventBridge for event-pattern matching before, but Scheduler's job is much narrower and much easier to reason about for this use case: it's just "run this target on this cadence," with built-in retry handling, and it maps directly onto the CDK  Schedule  +  LambdaInvoke  target constructs without needing to think about event buses at all.
4. Signed, stateless tokens are a good middle ground when you don't control a domain's MX records. I went into this assuming I'd need real SES inbound email to hit the "reply in one word" spirit of the idea. HMAC-signed links with an expiry turned out to capture the same interaction pattern — one click, no login — while staying deployable on a personal account in a weekend.
5. Retrofitting auth after building the API is more work than building it in from the start, but it's the right call anyway. I built the API without Cognito first to move fast, then went back and added it once I realized the client was passing its own identity. Rebuilding around JWT claims instead of trusted client input touched every Lambda, but the alternative — shipping an app where anyone can view anyone else's pet data — wasn't something I was willing to leave in, even for a weekend build.
6. The SES sandbox forces you to design the verification step into the product, not around it. Rather than treating sandbox limits as a deployment footnote, building the "check your inbox to verify" message directly into the create-pet flow turned a limitation into a normal, expected part of onboarding.



The Result

I hatched a pet, set its habit, and used the on-demand trigger to see the full loop end to end: Bedrock wrote a first message referencing the exact habit I'd set, SES delivered it, I clicked "Yes, I did it," and got back a distinctly different, warmer message with the streak now at one. A few rounds of "Not yet" instead, and the tone audibly shifts — more worried, then handled by the stronger model once it crosses into critical territory. Watching that state machine actually feel emotionally coherent, driven purely by real data rather than a script, was the most satisfying part of this build.
The deeper thing I was testing with this challenge wasn't really "can an agent send an email on a schedule" — plenty of things can do that. It was whether an agent could feel like it's paying attention to you specifically, using nothing but a timestamp, a streak count, and a language model. I think it does.







Link to App and Repo

Final Thoughts

This challenge pushed me toward a different kind of "agent" than I expected to build — less about summarizing information and more about sustaining something over time, with real emotional continuity from one day to the next. The technical pieces (Bedrock, EventBridge Scheduler, Lambda, SES, Cognito) are all standard AWS building blocks, but arranging them around a state machine that behaves like it cares whether you showed up turned out to be the most fun I've had building something small this year.
Made with Kiro.
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