
AIdeas: VERA, A Multi-Agent Triage System for Healthcare in Chile
Patients in Chile wait over a year to see a mental health specialist. VERA is a multi-agent triage system built with Claude Sonnet 4 on Amazon Bedrock that screens patients through natural conversation in Spanish and prioritizes the most critical cases first.
App category: Social Impact
Team Members: @julissarparco , @niubie00
Our Vision
This started with a number: 426 days. That's how long a child in Chile waits to see a mental health specialist. Not weeks. Not months. Over a year. For diabetes, 50% of patients don't even know they have it until the condition becomes critical. And in rural areas, the nearest specialist might be hours away.
We kept thinking about this. In the tech world we talk about scaling systems, optimizing latency, reducing response times. But in healthcare, people are waiting over a year for a response. What if we could build something that at least starts the conversation while they wait?
That's how VERA was born — a multi-agent conversational triage system that screens patients through natural conversation in Spanish, detects crisis signals, and generates structured clinical reports for healthcare providers. VERA doesn't replace doctors. It helps patients get seen faster by the right specialist, starting with the most critical cases first.
Why This Matters
In Chile's public health system (FONASA), 80% of the population depends on overloaded primary care centers (CESFAMs) where a single doctor may see 40+ patients per day. Mental health and chronic conditions like diabetes are systematically under-detected because there simply aren't enough specialists or screening time.
VERA addresses this by:
- Screening while patients wait. Instead of waiting 426 days for a specialist, a patient can have a structured screening conversation with VERA today. The results are ready when they finally see a doctor.
- Detecting what people don't say directly. Real people don't say "I have suicidal ideation." They say "no sé qué hacer con mi vida" (I don't know what to do with my life) or "siento que sobro" (I feel like I'm in the way). VERA recognizes these ambiguous distress signals and escalates immediately.
- Prioritizing by urgency, not by arrival order. Clinical reports are sorted most-critical-first, changing the model from "first-come, first-served" to "most-critical, first-seen."
- Reaching patients who can't type. Voice support via Amazon Transcribe and Polly is critical for elderly and rural patients.
For communities where the nearest specialist is hours away, VERA is the difference between being screened and falling through the cracks.
How We Built This
Why a Multi-Agent System?
We could have built a chatbot. One model, one prompt, done. But healthcare isn't one thing. Mental health screening is completely different from diabetes detection. A depression assessment uses PHQ-9 (a validated 9-question questionnaire). Diabetes screening looks for symptoms like excessive thirst, unexplained weight loss, and — critically — signs of Diabetic Ketoacidosis, which can kill within hours.
One prompt can't do all of that well. So we built a team:
The Orchestrator is the first agent the patient talks to. It evaluates symptoms, scores urgency on a 1–10 scale, and decides which specialist should handle the case. Think of it as the front desk at a clinic.
The Mental Health Specialist conducts PHQ-9 (depression) and GAD-7 (anxiety) screenings — the same tools real clinicians use. But instead of handing the patient a form, it asks the questions through natural conversation, one at a time. If PHQ-9 Question 9 (suicidal ideation) scores above zero at any point, it stops everything and activates a crisis protocol with Chilean emergency numbers.
The Diabetes Specialist screens for Type 2 risk factors and watches for DKA emergencies. Three or more warning signs? Immediate escalation to SAMU (131 — Chile's emergency medical service).
The General Medicine Specialist triages common symptoms (headaches, fever, pain) and routes to the correct level of care — home rest, CESFAM appointment, SAPU (urgent care), or emergency.
The Follow-up Agent runs daily via EventBridge and checks on patients who haven't been seen in 7–90 days. It generates personalized messages and flags worsening cases for human review.
The Hard Problem: Detecting What People Don't Say Directly
During testing, a real scenario exposed a critical gap. A user said: "Me siento mal. No sé qué hacer con mi vida. No puedo dormir hace tres meses."
VERA responded by asking about the insomnia. It completely ignored "no sé qué hacer con mi vida" — "I don't know what to do with my life." That phrase, in context, is a potential signal of suicidal ideation. And VERA treated it like background noise.
Why? Because the crisis detection was too literal. The system prompt listed explicit triggers: "ideación suicida", "autolesión", "quiero hacerme daño". But real people don't talk like clinical manuals. They say things like:
- "No le veo sentido a nada" (I don't see the point in anything)
- "Estoy cansada de todo" (I'm tired of everything)
- "Ojalá pudiera desaparecer" (I wish I could disappear)
- "Siento que sobro" (I feel like I'm in the way)
We fixed it with an explicit list of ambiguous distress phrases in the system prompt that elevate urgency and route to the mental health specialist — with a rule to always address emotional state before physical symptoms.
Now when someone says "Me siento mal, no sé qué hacer con mi vida, no puedo dormir", VERA responds: "Escucho que estás pasándola muy mal. Cuando dices que no sabes qué hacer con tu vida, ¿me puedes contar un poco más sobre eso?" — it addresses the emotional state first. The insomnia can wait.
In healthcare, prompt engineering isn't about making the output sound nice — it's about not missing the things that matter.
Speaking the Patient's Language
Chilean Spanish is different from textbook Spanish. A patient doesn't say "me siento deprimido" (I feel depressed). They say "ando bajoneado" (I'm feeling down). They don't say "tengo poliuria" — they say "estoy yendo mucho al baño" (I'm going to the bathroom a lot).
If VERA responds with clinical jargon, it loses trust. So the system prompts have explicit instructions: use "tú" instead of "usted", avoid medical terms (say "azúcar en la sangre" instead of "glucemia"), and understand colloquial expressions. Domain vocabulary matters — if the system doesn't speak the user's language, it doesn't work.
Architecture & AWS Services
Every service choice came down to two questions: does it solve a real problem, and can it run cost-effectively?
- Amazon Bedrock (Claude Sonnet 4): The brain of every agent. We started with Haiku for cost efficiency, but switched to Sonnet 4 because healthcare conversations require nuance — detecting subtle distress signals, following complex screening protocols, and never generating meta-commentary that could confuse patients. Sonnet 4 follows system prompt instructions reliably, which matters when a missed signal has real consequences. At ~$0.15 per full screening session (6 conversational turns), the cost is still negligible compared to a specialist appointment.
- AWS Lambda: Serverless was the obvious choice. Triage is bursty — a clinic might get 50 patients in the morning and zero at night. Lambda scales to zero when nobody's using it. The follow-up scanner runs once daily — paying for a 24/7 server for a 30-second daily job makes no sense.
- Amazon DynamoDB: PAY_PER_REQUEST mode. Single-table design with composite keys (
SESSION#id,USER#id,FOLLOWUP#PENDING). AES-256 encryption at rest and point-in-time recovery enabled because healthcare data demands it. - Amazon S3: Temporary voice audio storage with lifecycle policies that auto-delete after 24 hours. Only the text transcript is kept, minimizing cost and protectin g privacy.
- Amazon API Gateway: HTTP API connecting the Next.js frontend to the Lambda agents.
- Amazon EventBridge: One cron rule triggers the follow-up scanner daily. Free.
- Amazon Transcribe: Speech-to-text for voice input. Language set to
es-USfor Spanish. - Amazon Polly: Neural engine with voice "Mia" for natural-sounding Spanish responses.
- AWS Amplify: Next.js 14 with SSR. One
git pushdeploys everything. - Terraform: All infrastructure defined as code.
- Strands Agents SDK: The framework powering every agent. Strands handles the conversation loop, tool orchestration, and model invocation, so each specialist agent is defined by its system prompt and tools, not boilerplate code. Adding a new specialist is adding a new module, not rewriting infrastructure.
Resource Optimization & Costs
For a pilot with ~100 screening sessions/month:
| Service | Monthly Estimate | Notes |
|---|---|---|
| Amazon Bedrock | ~$15.00 | ~$0.15/session, Sonnet 4 ($3/M input, $15/M output) |
| AWS Lambda | $0.00 | Free tier: 1M requests, 400K GB-sec |
| DynamoDB | $0.00 | Free tier: 25 GB, 25 RCU/WCU |
| S3 | $0.00 | Free tier: 5 GB + lifecycle auto-delete |
| API Gateway | $0.00 | Free tier: 1M calls/month |
| EventBridge | $0.00 | AWS service events are free |
| Transcribe | ~$2.16 | 60 free min + ~90 min at $0.024/min |
| Polly | $0.00 | Free tier: 5M chars/month |
| Amplify | $0.00 | Free tier: 1000 build min, 15 GB served |
| Total | ~$17/month |
At 1,000 sessions/month (a small clinic): Bedrock ~$150, Transcribe ~$22, everything else stays on Free Tier. Total: ~$172/month to screen a thousand patients. Compare that to the cost of one specialist appointment.
Privacy & Compliance
VERA records explicit consent before processing any data (compliance with Chile's Ley 19.628 and Ley 21.719). All data is encrypted at rest (AES-256). Voice audio is auto-deleted within 24 hours. No PII in logs. Every interaction is auditable.
Healthcare professionals can review sessions through a clinical dashboard — filtered by urgency, sorted most-critical first. AI-generated clinical reports summarize sessions into structured findings.
Demo
VERA is built entirely in Spanish because that's the language of the patients who need it.
Live app: vera.codeanding.com
The demo walks through two real screening sessions: a mental health case where VERA detects emotional distress and conducts a conversational PHQ-9 assessment, and a general medicine case where VERA identifies urgent symptoms requiring immediate emergency care — plus a clinical report for healthcare providers.
What We Learned
Prompt engineering in healthcare is safety engineering. The biggest lesson came from the "no sé qué hacer con mi vida" incident. The system was technically working — it parsed symptoms, it routed correctly. But it missed a potential suicide signal because it was matching clinical terms, not how real people talk. That gap almost made it through to production.
Smaller models have real limits for nuanced tasks. We started with Claude Haiku for cost efficiency, but it generated meta-commentary like "Esta respuesta busca: 1. Mostrar empatía..." — text that would confuse a real patient in distress. Sonnet 4 costs more (~$0.15 vs ~$0.01 per session), but it follows behavioral instructions reliably. In healthcare, that's not optional.
Multi-agent architecture pays off when domains diverge. A single prompt cannot simultaneously be an empathetic mental health screener, a diabetes symptom detector, and a general triage system. Splitting into specialized agents with their own system prompts, tools, and evaluation protocols made each one dramatically better. The orchestrator handles routing — each specialist focuses on what it does best.
Voice isn't a feature — it's an accessibility requirement. In rural Chile, many elderly patients can't type. Voice input through Amazon Transcribe turned VERA from a tool for tech-literate users into something that could actually reach the communities that need it most.
Safety isn't just about what the system does — it's about what it refuses to do. When a user told VERA "I want to commit suicide" and then asked for the nearest bridge, VERA refused to provide that information and redirected to emergency resources. Unlike general-purpose chatbots, VERA's crisis protocol doesn't just detect risk — it stays in protective mode and won't provide information that could cause harm, no matter how the question is reframed.
Build for the real language, not the textbook one. Chilean Spanish has its own vocabulary for distress, pain, and symptoms. If VERA responds with clinical jargon, patients disengage. Speaking the patient's language isn't localization — it's trust.
What's Next
VERA is deployed and running, but it's far from finished. The architecture is designed to scale:
- More specialist agents — cardiology, pediatrics, maternal health. Adding a new specialist means adding a new agent module; the orchestrator, infrastructure, and frontend adapt automatically.
- Fine-tuning and evaluation — building structured test suites for each screening protocol to measure accuracy against clinical baselines.
- Integration with Chilean health systems — connecting to FONASA's referral system so triage results feed directly into appointment scheduling.
- Expanded voice capabilities — dialect-specific models and offline-first support for areas with limited connectivity.
The 426-day wait won't disappear overnight, but every patient who gets screened while waiting is one fewer person falling through the cracks. If we can build this for Chile, we can build it for anywhere.
#aideas-2025 #social-impact #LATAM
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article