
Weekend Agent Challenge: QloudBot
How and why I built an agent to help me study for the AWS Certified AI Practitioner.
I have been trying to get my hands dirty, that is... to put them on the keyboard and build something other than a mountain of study notes. I mean, is it so hard, Jeff? well, that is what I told myself with this weekend's challenge.
What about it? well, I was doing some other life-things and the challenge smacked me in the face. But, when I woke up, I realized that maybe that was a good thing.

You see, I have been fighting my bad habits. I know them very well —but they put up a good fight. When opportunities like these come to me, my ancient reptilian brain tells me to "rᵘunnnn" and then I hide under a rock.

NOT NOW— I say while I combobulate. I have to do this, I have to try.
Vision & What the Agent Does
This week's challenge is to build an Always-on AI agent. Since I am a student my first ideas were study related.
- To do list?
- Organization
- Study?
- Notes!
- Notes?
- Yayyy
My first idea was to make an agent that parsed messy notes (handwritten or recorded) uploaded to somewhere and then transcribe them into neat organized study notes. But that was not really that useful to me, was it? I rarely record or handwrite notes. Plus, having to upload something and then process it seemed too challenging, I don't have my AWS Certified AI Practitioner cert yet; I am just starting to study fo— waaait a minute.
- Study?
- Study!
- Quizzes
I remembered the good ol' days (like 5 months ago), where I used AI as my study buddy for the Certified Cloud Practitioner cert. Then I remembered that AWS Tech Girls is doing an AI Practitioner challenge. Annnd, that I need to build projects for my AWS SBG. Done.
So, the idea was this. What if I had an agent that could generate 1 AI Practitioner quiz every day (based on the test topics), and publish it in the form of a webpage so anyone can study from it? then the agent would send the quiz link through a telegram bot —and then add a little generated message summarizing the quiz contents and words of encouragement.
Bingo!
Every day at 6PM, EventBridge triggers an agent's Lambda function:
- The Lambda function wakes up and asks Bedrock to generate a 10-question AI Practitioner quiz focusing on a randomly selected exam domain.
- It asks Bedrock to draft a custom, Telegram message based on that specific quiz.
- It injects the JSON quiz contents into a pre-written HTML/CSS file and uploads it to an Amazon S3 bucket as
index.html.
- Finally, it uses the Telegram API to broadcast the custom message and the live S3 link to my community channel.
How I Built It
Building this required snapping together AWS services like Lego blocks. So I had to do things in order...
Phase 1: The Messenger (Telegram)
Before touching AWS, I needed a way to broadcast the daily quiz. I opened Telegram, used the official @BotFather, and created my bot, QloudBot (but the username was taken, I had to conform with Qlawsome_bot). I secured the HTTP API Token given by the @BotFather and the Chat ID for my community channel (I got this through the bot API), which I would later inject securely into my AWS Lambda environment variables.

I then created a channel and added the bot as administrator (that way the agent can talk through it). This Is the finished channel. I (actually) originally used a group until I remembered the existence of channels :(
you may notice the message, but that one was triggered by testing the lambda function

Phase 2: The Canvas (Amazon S3)
Next, I needed a place to host the quiz. I created an Amazon S3 bucket (6pm-cloud-quiz) and enabled Static Website Hosting. Because this needed to be accessible to all students, I disabled "Block all public access" and applied a specific Bucket Policy granting s3:GetObject permissions so the internet could actually view the HTML.


I originally uploaded one image that was going to be used by the webpage. But it looked ugly on mobile (thus, I had to add another one).
Notice the index.html file, that was uploaded through the lambda function!

Phase 3: The Brain & The Brawn (AWS Lambda + Amazon Bedrock)
Speak of the king of Rome... (I realize now, the idiom is different in English)
With the hosting ready, I built the engine. I created a Python Lambda function and attached an IAM role with S3 and Bedrock permissions.
I used the boto3 SDK to prompt the Amazon Nova Micro model to generate a strictly formatted 10-question JSON array based on a random AI Practitioner domain, plus a custom hype message for Telegram.

If you are interested in the code. Defining our interfaces to the services...
bedrock = boto3.client('bedrock-runtime', region_name='us-east-2')s3 = boto3.client('s3')The actual code that generates the quiz json
# 3. Generate the Quiz quiz_prompt = f""" Actúa como un instructor del examen AWS Certified AI Practitioner. Hoy nos enfocaremos EXCLUSIVAMENTE en este dominio del examen: "{selected_domain}". Genera 10 preguntas de opción múltiple en español sobre este dominio específico. DEBES devolver el resultado EXCLUSIVAMENTE como un arreglo JSON válido. Cada objeto dentro del arreglo debe tener exactamente estas claves: - "question" (string) - "options" (arreglo de 4 strings) - "correctAnswer" (string) - "explanation" (string) - "resourceLink" (string) No incluyas texto de introducción ni bloques de código markdown, solo el JSON puro. """ quiz_response = bedrock.converse( modelId="us.amazon.nova-micro-v1:0", messages=[{"role": "user", "content": [{"text": quiz_prompt}]}] ) quiz_json_str = quiz_response['output']['message']['content'][0]['text'] quiz_json_str = quiz_json_str.replace("```json", "").replace("```", "").strip()Which is then inserted into an HTML template fstring
html_template = f""" <!DOCTYPE html> <html lang="es"> <head> <meta charset="UTF-8"> <meta name="viewport" ..."""and updated through the S3 client.
# 6. Upload to S3s3.put_object( Bucket=BUCKET_NAME, Key='index.html', Body=html_template.encode('utf-8'), ContentType='text/html')Moving to the telegram-message side. This is the code that uses the bedrock service to generate a hype message.
hype_prompt = f"""Eres el animador del '6PM AI Practitioner Quiz', un desafío diario para estudiantes que se preparan para la certificación AWS Certified AI Practitioner.El tema de hoy es: "{selected_domain}".Acabas de generar este quiz de 10 preguntas: {quiz_json_str}
Escribe un mensaje corto (máximo 3 líneas, en español latino) y motivador para enviar por Telegram avisando que el quiz de hoy está listo. Menciona sutilmente 1 o 2 temas específicos que vienen en el quiz de hoy para generar intriga.Usa emojis. No escribas usando Markdown. NO incluyas el enlace, yo lo agregaré después."""
hype_response = bedrock.converse( modelId="us.amazon.nova-micro-v1:0", messages=[{"role": "user", "content": [{"text": hype_prompt}]}])
ai_telegram_message = hype_response['output']['message']['content'][0]['text'].strip()Of course, I present it so easily —I had a LOT of troubleshooting to do. For example, the first time I ran the AWS Lambda function test it (obviously) did not work.
Amazon Q's built-in diagnosis helped me realize my mistake: the ID I used was not the right one (it was missing the "us." part); I had to search it within the inference profiles.

After copying it and replacing the one in my code, the function ran smoothly for the first time!
#modelId="amazon.nova-micro-v1:0" wrongmodelId="us.amazon.nova-micro-v1:0" # cool
Phase 4: The Frontend
S3 static websites can't run backend code, so I programmed the Lambda function to act as a static site generator.
The result, code-wise, is not the most aesthetic; there is a giant HTML/CSS string directly in the Python script, but it works! AWS Lambda simply takes the Bedrock JSON, injects it into this SBG-themed template, and uses s3.put_object to overwrite the live index.html site every single day.
This is how the Quiz looks in the browser. There is a welcome page, the quiz itself and a finish screen. Notice how the bedrock model also recommends further reading for each question.



Uh— I got 2/10, there is still a long way to go...
Phase 5: Full Autonomy (Amazon EventBridge)
To satisfy the challenge's "unattended" rule, I connected Amazon EventBridge Scheduler to my Lambda function. I set a simple Cron expression (0 18 * * ? *) targeting the America/Santiago timezone.

Now, every single day at 6:00 PM, EventBridge wakes up Lambda, Lambda consults Bedrock, generates the SBG-themed site, uploads it to S3, and QloudBot broadcasts the link to my channel. 100% serverless, 100% autonomous.
AWS Services Used / Architecture Overview
The architecture is quite simple, indeed but it adheres to the "unattended" rule of the challenge:
- Amazon EventBridge: The alarm clock that wakes the agent up every day at 6 PM (by triggering the Lambda Function).
- AWS Lambda (Python): The arms and legs of my agent that execute the logic. The lambda function I created edits the S3 HTML object file. It also reports back by delivering a message through a telegram bot (Quiz reminder + link to S3 website).
- Amazon Bedrock (Nova Micro): The brain that reasons, generates the quiz JSON, and drafts the dynamic Telegram message.
- Amazon S3: Configured for Static Website Hosting to serve the final quiz webpage.

A Little Demo
What I Learned
Agents Don't Need to be Complicated: I used to think an AI Agent required a massive, expensive managed framework. I learned that combining Perception (EventBridge), Cognition (Bedrock), and Action (Lambda writing to S3/Telegram) is all it takes to build a true autonomous agent.
Services and the AWS Free Tier: Before this challenge I had little to no hands-on experience using Eventbridge, Lambda and bedrock. The limited experience I had was from labs. However, the free tier offers you tons more of flexibility.
Telegram bots: I did not know that you could implement Telegram bots so easily, and that you could use conversation IDs to point where to say something.
Security Best Practices: I learned the importance of never hardcoding API tokens (I did not Know that environment variables for Lambda were a thing) and accessing them securely via
os.environ .Frontend: I deepened my understanding of how CSS properties like
contain vs. cover interact with images when designing for mobile screens (this is probably what I struggled with the most).That I can build things too! even if my reptilian brain is scared of it, it is better to try and see what you can do than to not try and wonder.

Links:
Update: we are currently re-purposing this project for a certification event we are organizing through AWS Studen Builder Group Duoc Plaza Vespucio (ft. AWS SBG Duoc Virtual). Here is the new link.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article