# Serverless Medical Triage System Based on WhatsApp: Implementing Intelligent Patient Triage with AWS Native Architecture

> This article introduces a fully serverless AI medical triage system that integrates AWS Bedrock large language models via WhatsApp to automatically assess the urgency of patients' symptoms and triage them. With a monthly cost of less than $1, it provides an affordable intelligent medical solution for small and medium-sized healthcare institutions.

- 板块: [Openclaw Geo](https://www.zingnex.cn/en/forum/board/openclaw-geo)
- 发布时间: 2026-06-14T19:45:57.000Z
- 最近活动: 2026-06-14T19:49:17.938Z
- 热度: 158.9
- 关键词: 无服务器架构, 医疗AI, AWS Lambda, WhatsApp, Claude 3, Bedrock, 智能分诊, 医疗自动化, Twilio, DynamoDB, 事件驱动架构, Serverless
- 页面链接: https://www.zingnex.cn/en/forum/thread/whatsapp-aws
- Canonical: https://www.zingnex.cn/forum/thread/whatsapp-aws
- Markdown 来源: floors_fallback

---

## Serverless Medical Triage System Based on WhatsApp: Implementing Intelligent Patient Triage with AWS Native Architecture (Introduction)

This article introduces a fully serverless AI medical triage system that integrates AWS Bedrock large language models (Claude 3 Haiku) via WhatsApp to automatically assess the urgency of patients' symptoms and triage them. Adopting an event-driven architecture with a monthly cost of less than $1, it provides an affordable intelligent medical solution for small and medium-sized healthcare institutions, addressing issues of tight medical resources and low triage efficiency.

## Project Background and Pain Points of Traditional Triage

Against the backdrop of tight medical resources, traditional manual triage has the following problems: it requires a large number of trained personnel, is susceptible to subjective factors, and has low patient triage efficiency. This project aims to enable patients to obtain preliminary medical guidance anytime and anywhere through the highly popular WhatsApp via a serverless AI system, lowering the threshold for AI medical applications.

## System Architecture and Detailed Explanation of Core Components

### System Architecture
Adopting a typical serverless event-driven architecture, the data flow is: WhatsApp User → Twilio WhatsApp API → Amazon API Gateway → AWS Lambda → (DynamoDB Session Storage, Bedrock LLM Triage, S3 Encrypted Archiving, SNS High Urgency Alert, CloudWatch Monitoring) → Twilio → WhatsApp Reply to User.

### Core Components
- **Message Layer**: Twilio WhatsApp API (message reception + signature verification)
- **API Layer**: Amazon HTTP API (lightweight with no idle cost)
- **Computing Layer**: AWS Lambda (Python3.11, Graviton2 architecture, cold start optimization)
- **AI Layer**: AWS Bedrock (Claude3 Haiku model, data retained within AWS account)
- **State Layer**: DynamoDB (pay-as-you-go, 90-day TTL automatic expiration)
- **Archiving Layer**: S3 (AES-256 encryption, 1-year automatic expiration)
- **Alert Layer**: SNS (high urgency email alert)
- **Monitoring Layer**: CloudWatch (metric dashboard + alert)
- **Operations**: AWS SAM (Infrastructure as Code, one-click deployment)

## Triage Logic and Security Compliance Design

### Triage Logic
- **Level Definition**: LOW (self-care advice), MEDIUM (outpatient appointment), HIGH (emergency medical care + SNS alert)
- **LLM Integration**: Combines the latest 10 rounds of conversation history to return structured JSON output (symptoms, urgency, etc.)
- **Fallback Mechanism**: Keyword backup classifier to ensure response even when LLM is unavailable

### Security Compliance
- **Request Verification**: Twilio HMAC-SHA1 signature verification
- **Data Encryption**: DynamoDB at-rest encryption, S3 AES-256 encryption, full HTTPS
- **Access Control**: S3 blocks public access, Lambda least privilege
- **Data Desensitization**: Only last 4 digits of phone numbers are retained in logs
- **Rate Limiting**: Maximum 50 messages per user per day
- **Data Lifecycle**: DynamoDB 90-day expiration, S3 1-year deletion (GDPR compliant)

## Cost Analysis and Deployment Guide

### Cost Analysis (500 consultations/month)
| Service | Estimated Cost |
|---|---|
| Lambda | ~$0.00 (within free tier) |
| API Gateway | ~$0.00 (within free tier) |
| DynamoDB | ~$0.01 |
| S3 | ~$0.00 |
| Bedrock Claude3 Haiku | ~$0.10-$0.50 |
| SNS | ~$0.00 |
| **Total** | **< $1/month** |

### Deployment Steps
1. Clone the repository: `git clone https://github.com/mxsood1/whatsapp-health-triage-agent.git`
2. Install dependencies: `pip install -r requirements.txt`
3. Build and deploy: `sam build && sam deploy --guided`
4. Configure Twilio Webhook: Paste the output WebhookUrl into Twilio settings

Prerequisites: AWS account, Twilio account, Python3.11+, etc.

## Application Scenarios and Future Prospects

### Applicable Scenarios
- Community Health Service Centers: 24/7 initial screening service to relieve doctor pressure
- Telemedicine Platforms: First touchpoint for incoming patients, intelligent triage
- Corporate Health Services: Entry point for employee health consultation
- Disaster Medical Response: Quickly assess the urgency of a large number of patients

### Future Prospects
With the improvement of LLM capabilities and accumulation of medical data, such systems will become more intelligent and reliable, playing an important role in the healthcare system.

## Limitations and Disclaimer

**Disclaimer**: This system is only a triage tool and cannot replace professional medical diagnosis, treatment advice, or clinical guidance. It always guides patients to consult professionals.

### Current Limitations
- **Diagnostic Ability**: Only classifies urgency, does not provide specific disease diagnosis
- **Language Support**: Mainly optimized for English
- **Medical Coverage**: General medical knowledge; specific specialties require customization
- **Regulatory Compliance**: Need to confirm compliance with local medical AI regulations
