Inspiration
More than two million people aged 65 or over live alone in Spain (INE, 2020), and the WHO estimates that only about half of the patients with a chronic condition follow their treatment as prescribed. Our customer context is a Madrid telecare and IoT company that serves hospitals: their users miss doses and appointments without anyone noticing in time, and every digital-care product they had seen asked an older person to install an app and learn a new interface. We wanted the opposite: a companion that lives in the messaging the person already has, notices when this person deviates from her own pattern, and brings in the family or the care team only when insisting stops making sense.
What it does
CuidAgent holds one conversation with two audiences. María, 78, who lives alone, gets her day over RCS: a carousel with one card per dose and her appointment, one-tap confirmations, and a reminder that changes shape when she does not answer. Her son Carlos lives in another city and hears from the agent on WhatsApp only when it matters: an alert that carries the evidence ("María usually confirms within four minutes; today the 2:00 pm reminder has gone 90 minutes unanswered") with two choices, "Remind her again" or "I'll call her", and a button that dials her. He can ask how the day is going and get it as a list, set a preference the agent remembers ("only alert me after six unless it is urgent"), and send a photo of a new prescription, which becomes a proposal an operator approves line by line. At night the care team and the family get the daily report by email and as a PDF on WhatsApp.
An organisation runs it as health plans (ageing at home, cardio-metabolic chronic care, post-discharge follow-up, polypharmacy review) from an operations console: who needs a human look and why, every person's conversation and history, each decision as a trace with its evidence, measured impact (adherence over the doses already due, minutes to confirm, minutes from signal to family), and the models as configuration.
The rule that shapes everything: the agent decides, the code computes. The agent chooses what to send, when, in which format and whom to involve; deterministic code computes the facts (baselines, adherence, windows) and enforces the safety floors: consent and opt-out are final, critical medication escalates, no medical advice ever, tenant isolation on every tool call.
How we built it
- Four AWS Communication Developer Services channels, called at runtime: AWS End User Messaging for RCS and SMS (
pinpoint-sms-voice-v2:SendRcsMessage,SendTextMessage), AWS End User Messaging Social for WhatsApp (socialmessaging:SendWhatsAppMessage, media download, ten Meta-approved templates in English and Spanish, interactive lists and buttons inside the 24-hour window) and Amazon SES v2 for the daily report (SendEmail, HTML with a PDF attachment). Inbound SMS/RCS and WhatsApp arrive over Amazon SNS into Lambdas that normalise, deduplicate and resolve identity before the agent wakes; a deterministic fast path handles postbacks without a model call. - Amazon Bedrock AgentCore: five Runtimes from one image. The companion agent (Strands) acts; four specialists answer it over the A2A protocol, each with its own governed model and prompt: triage on Amazon Nova 2 Lite, anomaly evaluation, report writing and prescription reading. The platform tools run behind AgentCore Gateway as an MCP target; AgentCore Memory keeps preferences and daily summaries; AgentCore Identity is a Cognito JWT authoriser; AgentCore Observability sends spans to CloudWatch, and every request also writes a business trace (signals with literal evidence, decisions, formats, tool calls, model, tokens, latency, cost). Bedrock Guardrails screen every free text the agent writes.
- Governed model catalog: allow-listed, versioned profiles and prompts in DynamoDB; administrators publish or roll back from the console and the runtime picks the change up within a minute, no redeploy. Routine steps run on small models (Amazon Nova, Claude Haiku) because they do not need heavy reasoning and it keeps the cost per person-day low.
- Platform: Lambda, SNS, EventBridge Scheduler, DynamoDB, S3 with KMS, Cognito, API Gateway, CloudFront, CloudWatch; eight CloudFormation stacks driven by idempotent scripts; a React operations console over FastAPI. Python with strict typing, more than 2,700 automated tests, Claude Code as the AI coding assistant throughout.
Challenges we ran into
- Showing a whole day in three minutes, for real. Reminders live at 09:00, 14:00 and 21:00. We built a demo clock: each step is fired with the time it would have in the real schedule, and the person's real replies inherit that clock, so a full day runs on real phones at any hour and every timestamp in the traces is coherent.
- Two agents, two channels, one conversation. RCS rich cards, WhatsApp templates and the 24-hour window, SNS fan-out, delivery events and identity resolution had to collapse into one
InboundMessage/OutboundMessagemodel so the agent never touches a channel SDK. - Keeping the model inside its lane. Every floor (opt-out, critical medication, tenant, no medical advice) had to be enforced by code regardless of what the model proposes, while still letting the agent decide format, timing and escalation. The trace had to make that split visible to an operator.
- Multi-agent on AgentCore. Five runtimes, agent cards with skills, service-client-only access to the specialists, and the companion as the only agent allowed to send messages or change a plan.
- Security review under deadline. The AWS Security Agent review (26 findings, 4 high) and a penetration test arrived mid-week; we fixed and redeployed everything safety-relevant before recording.
Accomplishments that we're proud of
- The full day works end to end on two real phones and the console, with the agent deciding at every step; nothing in the video is scripted or mocked.
- Ten WhatsApp templates approved by Meta in two languages; RCS carousel, cards and chips delivered through the End User Messaging testing agent.
- A trace per request with five actors, literal evidence and the configuration in force; impact measured from the system's own facts, not asserted.
- A model switch from the console applied to the next request without a redeploy.
- Multi-tenant, serverless, reproducible from a fresh account with the documented scripts.
What we learned
- Agentic does not mean unbounded: the most convincing demos were the ones where the agent's freedom (format, timing, whom to involve) sat on top of hard, boring, deterministic floors.
- Evidence beats alarms. "She usually confirms in four minutes" changed how the family reacted to an alert far more than any urgency label.
- Small models carry most of the day. Triage and routine turns on Nova and Haiku kept the cost per person-day in cents; the larger model is needed only where the words matter.
- Messaging channels are products with rules: templates, windows, opt-ins and carriers shape the design as much as the model does.
What's next for CuidAgent
A pilot with the telecare customer on a real health plan; the Spanish RCS country launch and the SMS long code; SES production access; complete GDPR erasure; operator management from the console; and more health plans beyond the four in the demo. The platform is tenant-aware from the first table, so each of these is a configuration and a registration, not a rewrite.
Built With
- amazon-api-gateway
- amazon-bedrock
- amazon-bedrock-agentcore
- amazon-cloudfront
- amazon-cloudwatch
- amazon-cognito
- amazon-dynamodb
- amazon-eventbridge-scheduler
- amazon-nova
- amazon-ses
- amazon-sns
- amazon-web-services
- anthropic-claude
- aws-cloudformation
- aws-end-user-messaging
- aws-end-user-messaging-social
- aws-kms
- aws-lambda
- bedrock-guardrails
- fastapi
- python
- rcs
- react
Log in or sign up for Devpost to join the conversation.