AWS Builder Center

Weekend Agent Challenge: Baton - An Always-On Shift-Handoff Brief Agent for the Emergency Medicine Clinician

“Baton” is an Autonomous personal AI Agent for one emergency-medicine clinician. It wakes on a schedule 15 minutes before shift start and shares the shift-handoff brief with the healthcare professional in his/her/their email id without any involvement from a human. No human triggers it. It reports back on its own.

I am not a doctor or a healthcare professional. But, whenever I had to visit an Emergency Medicine floor myself or a family member in any hospital, I always noted the chaotic nature of the floor there. Mostly, we land there due to an emergency at an odd-hour. Even at the highly modernized super-specialty hospitals, the EM floor has confusions and concerns on both sides. For patients as well as for the healthcare staff. And if it’s a duty change hour the confusion is much more. The staff need to exchange the status to the new shift people responsibly while they need to attend the current set of patients and those in queue. As an IT professional, I always thought why don’t they have an automatic data hand-off pulled from various sources from the system itself which could make the process more meaningful.
“Baton”, the autonomous personal AI Agent wakes on a schedule 15 minutes before shift start and shares the shift-handoff brief in his/her/their email id without any human involvement from a human.
For this prototype, I play the incoming clinician - the brief lands in my inbox, fifteen minutes before a shift I imagined myself walking into.

Vision & What the Agent Does

Shift handoffs are the most legally and clinically vulnerable moments in emergency medicine. A clinician coming onto a shift usually has to wade through fragmented electronic health record (EHR) charts or rely on rushed, verbal downloads to build a mental map of the floor.
This agent acts as the doctor’s/ Nurse’s personalized "Welcome to the Shift" brief which is a kind of “baton” handed-off by the previous shift without anyone manually involved in it. Delivered straight to his/her/their secure mobile device or workstation 15 minutes before their shift starts, it gives them a clean, bulleted summary of the specific patients in their assigned zone.

How I Built It

The thought process naturally evolved from the experience I mentioned in the introduction paragraph.
  1. There is data. From various sources. The patient master data, the provider staff data, department master data, the lab data, the service data and then the EMR itself. To make it very simple, I assumed that, the relevant data of present patients in an Emergency Medicine department can be consolidated as a single view – into a DynamoDB table. Only mandatory guideline would be the format. I followed I-PASS (Illness Severity, Patient Summary, Action List, Situation Awareness/Contingency, Synthesis): Widely considered the gold standard for physician and provider shift handoffs, as it explicitly focuses on task delegation and "what if" scenarios. For this “Weekend Challenge” , the DynamoDB table has been filled with synthetic data in I-PASS format. The patient data or their ailments are synthetic and unreal and just for the agent prototype purpose. It’s not for clinical use right now.
  1. Then, there is this clinician – a doctor or a nurse - who is typically assigned to a ZONE within the Emergency Medicine department (in general, nobody is assigned to all zones in big hospitals). So, the information about the clinician, his/her/their Zone are captured as environment variables (currently hard-coded in the Lambda function).
  1. Then the main component – The Lambda Function – “baton-handoff-agent” :
  • It has a system prompt which is the most critical part of this build. Because that requires the expertise of an Emergency Medicine Specialistthe and years of experience. It clearly sets the scope for the foundation model (FM) what it should construct, how, and - just as important - what it must not. When this agent goes to production, this part needs to be strictly reviewed by an experienced Emergency Medicine Expert.
  • It fetches the patient status data from DynamoDB
  • It asks Amazon Bedrock (Nova Pro) to compose a prioritized I-PASS style shift-handoff brief for ONE clinician's assigned zone
  • Then it publishes the brief to an SNS topic -> arrives as an email 15 minutes before shift start.
The Lambda function has scoped roles to fetch data from DynamoDB, to call the Bedrock model, to publish in SNS and permissions for CloudWatch.
  1. Finally, the unattended trigger - EventBridge Scheduler : The schedules in the EventBridge will call the Lambda Function “baton-handoff-agent” based on the required intervals. This will ensure that no human intervention is required to get an up-to-date information on the status of the Emergency Medicine floor.

AWS Services Used / Architecture Overview

Baton - An Always-On Shift-Handoff Brief Agent for the Emergency Medicine Clinician

Scheduler fires → Lambda reads DynamoDB → Bedrock composes → SNS delivers
EventBridge Scheduler fires on a cron with no human action; Lambda reads DynamoDB, Bedrock composes the brief, SNS delivers it.

AWS services

EventBridge Scheduler, Lambda, DynamoDB, Amazon Bedrock (Nova Pro), SNS, CloudWatch. All within Free Tier / the $200 new-account credits.

What I’ve Learned

Each Agent Build is a new learning of course. But for me, the real insight is “how should I build when this goes to production”. It’s just not only about purely technical stuff like building the tool or coding the orchestration. It’s about how real-world problems, situations and critical decisions to be incorporated within the architecture by creatively envisaging them and carefully knit them together. When I built this, in the initial output (Fig1) , the model had folded the “vitals trend” into Situation, then repeated it under Assessment which will not be a simple mistake from a clinician’s point of view. A careful and researched edit in the system prompt improved the output significantly (Fig2).
BATON - Initial result

Fig 1

BATON - Improved result after system prompt update

Fig 2
Similarly, in the first run, the model placed Bed 11 (anticoagulated, fluctuating GCS) first among the watchers; and the second run (with updated system prompt)  placed it fourth. Acuity-band ordering held because I had pinned it with an explicit rule. Ordering within a band was the model's judgment, and it varied between runs - yet the priority list surfaced Bed 11 both times. That is the real design question with agents: decide what you pin with rules, and what you trust to the model.
The learning to keep in mind for production agent build: Always have a real-world perspective on the domain, on data architecture and security principles to follow. If not researched, get help from experts.

Link to App or Repo

Working Proof

EventBridge Schedules

EventBridge Schedules


EventBridge - Demo Schedule (15 Min Interval)

Demo Schedule - 15 min Interval


First Mail - based on demo schedule

First Mail - based on demo schedule


Proof of second mail based on Demo schedule

Proof of second mail based on Demo schedule


CloudWatch Logs of automatic invocation of Lambda function

CloudWatch Logs of automatic invocation of Lambda function


Original EventBridge Schedule

Original EventBridge Schedule

baton-handoff-agent - Lambda Function
baton-handoff-agent - Lambda Function

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