
Weekend Agent Challenge: Argus
Argus is an always-on AI agent that watches over chronic-care patients at home, reasons about whether each one is quietly deteriorating, and escalates to a clinician on its own before an emergency. It is named for Argus Panoptes, the hundred-eyed watchman of Greek myth who never closed all his eyes at once. Runs on synthetic, de-identified public data
Vision & What the Agent Does
Patients discharged with chronic conditions — heart failure, COPD, and the like — deteriorate slowly at home. Oxygen saturation drifts down, respiratory rate creeps up, symptoms worsen over days. Nobody is watching the daily trend, so the first unambiguous signal is often a night-time ER visit and a costly readmission. A care team cannot manually eyeball every patient's vitals every single day.
Argus does that watching. It is a genuine agent, not a threshold alarm:
- What triggers it: two ways. ① A scheduled EventBridge rule wakes it for "rounds." ② An API Gateway event — a device (or the console's "advance day & run" button) pushes a new reading — triggers an immediate check.
- What it does on its own: for each patient, it runs a Bedrock (Amazon Nova Lite) Converse tool-use loop. The agent decides which tools to call — pull history, compute the trend of each vital, compare to baseline, check medication adherence — reasons over what it finds, and then acts: it can
escalate_to_clinician,schedule_recheck,add_to_watchlist, and mustrecord_assessment. A deterministic NEWS2 early-warning score (the UK Royal College of Physicians standard) runs alongside as a safety governor that can force an escalation regardless of what the model concludes.
- How it reports back: an SES email to the care team — a ranked "who needs attention today" brief, plus immediate escalations carrying the patient's actual vitals, the agent's plain-language reasoning, and a recommended action. Every decision is also written to an AgentTrace you can watch in the console or query at
GET /trace/{id}.
Here is the live console — a monitored cohort, ranked worst-first, each patient with their vitals sparklines and current risk:

Opening a flagged patient shows why Argus is agentic, not an alarm. For Emeka Osei (#291) the decision trace records the agent pulling history, computing the trend of six vitals, checking medication adherence, then choosing to escalate — "Systolic and diastolic blood pressure trending upwards, oxygen saturation trending downwards, and NEWS2 total close to escalation threshold" — and finally recording its assessment and a watchlist note. The red
GOVERNOR: NEWS2_OVERRIDE step is the deterministic safety floor confirming the same call independently:That is the whole thesis in one screen: an LLM reasoning over multi-day trends, with a rule-based clinical score as its safety net — and every decision fully traceable.
How I Built It
The build was test-driven and subagent-driven end to end: a written spec and a bite-sized implementation plan, then each component built RED→GREEN with a fresh review pass before the next. The final suite is 49 tests, all passing on mocked AWS (moto) — no cloud cost to run.
Key decisions and the challenges behind them:
- Real data, not hand-waved. Argus runs on a public, MIT-licensed EHR dataset (2,000 patients × 30 daily readings) vendored into the repo. It's de-identified, and crucially the agent never sees the
progressed_to_criticallabel — that's held back and used only by an offline evaluation script.
- Making a static dataset behave "always-on." A DynamoDB simulation clock advances one day per run, so a 30-day file plays like a live daily feed — you literally watch a patient decline run-over-run.
- A real agent, not an LLM-in-a-cron. I hand-built the Converse tool-use loop (model requests a tool → Lambda executes it → returns the result → repeat, bounded by an iteration cap) rather than reaching for a managed runtime, so the reasoning is transparent and the trace is the product.
- Safety as a floor, not a hope. NEWS2 is computed deterministically and fails closed — a missing or non-finite vital raises rather than silently scoring "healthy." A real bug surfaced here: my first NEWS2 band tables had gaps between integer bands, so continuous values (SpO₂ 93.5) scored 0. The fix scores each value as the worse of its floor/ceil integer bands — a safety governor must always round toward danger.
- The deploy-day gotcha. The very first live analyzer run failed with
Invocation of model ID amazon.nova-lite-v1:0 with on-demand throughput isn't supported. Nova ineu-central-1must be invoked through a cross-region inference profile (eu.amazon.nova-lite-v1:0), and the IAM policy has to allow the inference-profile ARN, not just the foundation-model ARN. One-line model-id change, one IAM line — and the agent loop ran.
AWS Services Used / Architecture Overview

- Amazon EventBridge Scheduler — the "always-on" trigger; fires the agent and advances the sim clock.
- AWS Lambda ×3 —
analyzer(hosts the agent loop),ingest(device POST + the console's read API),loader(seeds the dataset on deploy).
- Amazon API Gateway (HTTP API) — the event trigger (
POST /vitals) and the console API (GET /cohort,/patient/{id},/sim,/trace/{id},POST /run), CORS-enabled.
- Amazon Bedrock — Nova Lite — the agent's reasoning, via the Converse API with forced tool use (
temperature=0).
- Amazon DynamoDB — single-table store for patient profiles, vitals history, risk assessments, agent traces, and the sim clock.
- Amazon SES — the escalation and rounds-brief emails (7 sent, 0 bounces in the live smoke test).
- Amazon CloudWatch Logs — the structured
AGENT_TRACEandRUN_SUMMARYlines: proof each run fired and a full audit trail.
- Amazon S3 (static website) — hosts the Argus Console dashboard.
Everything is one AWS SAM template, deployed with
sam deploy .What I Learned
The most interesting lesson was quantitative. I evaluated the NEWS2 governor against the dataset's hidden outcome label: precision 0.91, recall 0.086 (n=2,000). Low recall looks alarming until you see why — only ~55 of 2,000 patients ever cross a hard NEWS2 threshold across all 30 days, while ~29% eventually deteriorate. NEWS2 is a high-precision safety floor for acute breaches; it is not, and was never meant to be, an early-warning brain. That gap is the entire reason an agent earns its place: the LLM reasoning over multi-day trends is what surfaces the gradual decline (like Patient 77) that a single-reading threshold structurally cannot. Building both, and letting the deterministic rule override the model when vitals are frankly dangerous, gives you nuance without giving up the safety net.
I also learned the practical texture of shipping a Bedrock agent: cross-region inference profiles are mandatory for Nova (and the IAM to match); forced tool-use is how you get reliable structured output out of an LLM without prompt-and-pray parsing; and observability has to be designed in — an agent you can't watch reason is one you can't trust. Writing every tool call and verdict to a trace turned "the model said elevated" into "here's exactly how it got there."
Some more images below:


Link to App / Repo
- Public repo: https://github.com/ogasege/argus
- Live API: https://446md0htm3.execute-api.eu-central-1.amazonaws.com (
/cohort,/trace/6, …)
Argus runs on synthetic, de-identified public data.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article