AWS for Industries
From cloud to clinic: How AWS powers digital psychiatry at scale
Roughly half of Americans who need mental health care don’t receive it. One hundred thirty-seven million people live in a designated mental health professional shortage area, and fewer than 30 percent of rural counties have access to a practicing psychiatrist. Training more clinicians won’t close this gap in time to get help to those who need it now. What’s needed is a way to extend the impact of each clinician we have.
The smartphone that most patients already carry can serve a dual purpose: a source of continuous behavioral data between appointments and a channel for delivering therapeutic interventions. This has the potential to shift mental health treatment from brief, infrequent encounters toward ongoing, data-informed care that reaches patients wherever they are.
In this post, we describe how the Division of Digital Psychiatry at Beth Israel Deaconess Medical Center (BIDMC) and Harvard Medical School built mindLAMP, an open source digital psychiatry platform running on Amazon Web Services (AWS). Now deployed at 65 sites across 17 countries, mindLAMP enables continuous patient monitoring, digital phenotyping, and AI-augmented clinical workflows—all powered by serverless AWS infrastructure that a small academic group can operate without a dedicated site reliability engineering team.
The challenge: Making digital care work at scale
The enabling technologies for digital psychiatry already exist: telehealth, smartphone apps, wearables, virtual reality, and ambient sensing. Technology alone, however, isn’t enough. Effective digital care requires three things working together:
- Clinical context: Understanding the course of a patient’s illness, the confidence in a diagnosis, and the stakes if it’s incorrect
- The right intervention: Matching the patient to an appropriate treatment and adjusting it based on real-time signals, rather than waiting months to see if a medication is working
- Human support: Determining the optimal care team and how it should evolve over time, so that clinicians can extend their reach through social workers, nurses, and the patients themselves
Getting all three right transforms individual pieces of technology into scalable, effective clinical care. But running such a system everywhere—securely, reproducibly, and compliantly—introduces a different class of problem: data sovereignty, Health Insurance Portability and Accountability Act (HIPAA) and General Data Protection Regulation (GDPR), billions of data points syncing from phones that are often offline, and standing the whole system up efficiently for groups around the world. These are cloud problems, which is why mindLAMP is built on AWS.
The digital clinic: Proven outcomes at BIDMC
Over the past decade, the Division of Digital Psychiatry at BIDMC has developed what is now among the most established academic digital mental health programs globally. To date, the clinic has served thousands of patients, generating over 20 billion longitudinal data points in the process.
The care model works in a structured loop. Patients typically complete 6–8 virtual sessions with a clinician over the course of an 8-week program. Between sessions, digital navigators, team members trained in technology support and patient communication, help patients onboard, maintain data quality, and stay engaged with the platform.
Over 8 weeks, the patient uses the mindLAMP app on their own phone and works through therapeutic skills while passively generating behavioral data in the background. The program achieves roughly 70 percent patient adherence, which is an order of magnitude above the approximately 5 percent typical of standalone mental health apps. The difference is the digital navigator: a dedicated human point of contact who sustains engagement over time.
Clinical outcomes have been strong: the program reports roughly 70 percent clinical response and 60 percent remission rates for depression and anxiety, with resource utilization approximately half that of a comparable in-person cognitive behavioral therapy program.
mindLAMP: An open platform for digital psychiatry
Everything in the digital clinic runs on mindLAMP, an open source platform that the BIDMC team builds and maintains. The name stands for Learn, Assess, Manage, and Portal—the four components of the patient experience:
- Learn: Psychoeducation through brief, customizable modules that help patients understand their condition and develop self-management skills
- Assess: Measurement through active surveys and cognitive testing, plus passive data from the phone’s sensors (GPS, accelerometer, screen usage, and more)
- Manage: Treatment content including skills practice, mindfulness exercises, and structured care drawn from MindApps, a vetted library of mental health interventions
- Portal: Closing the loop by pushing data summaries to clinicians, navigators, and patients before each visit
Powering the analytics layer is Cortex, an open source processing pipeline that converts raw sensor data into interpretable behavioral indicators for clinical teams. The platform supports more than 10 languages and is deployed globally by independent research groups and health systems.
Digital phenotyping: From sensor streams to clinical signal
Digital phenotyping is the process of turning raw smartphone sensor data into indicators of psychiatric state. The data pipeline flows from the phone into AWS.
- Raw sensors: GPS, accelerometer, screen time, and call and text logs sync from the patient’s phone into encrypted AWS storage
- Primary features: Cortex computes quantities directly from individual sensors, such as significant locations visited (from GPS clustering) or daily step count (from accelerometer data)
- Processed features: Primary features are combined into measures that carry real clinical meaning, including fraction of the day spent at home, sleep duration, social interaction patterns, and amount of green space exposure
These features track psychiatric state with remarkable sensitivity. As a patient slides into a depressive episode, home time climbs, step count drops, and sleep patterns fragment—often long before the next scheduled visit. This gives the care team an early warning system that’s not available in a traditional clinical appointment.
Running on AWS: Serverless, secure, and reproducible
The BIDMC team designed mindLAMP’s infrastructure with a guiding principle: push the operational burden onto managed services so that a small academic research group can run production-grade infrastructure without a dedicated operations team. Every component is either managed or serverless.
Architecture
The core AWS services powering mindLAMP include:
- Amazon Elastic Container Service (Amazon ECS) on AWS Fargate: All services run as serverless containers, eliminating host patching and capacity planning.
- Amazon DocumentDB: The primary data store for mindLAMP data, with AWS handling backups, replication, and failover.
- AWS Certificate Manager (ACM) combined with AWS Private Certificate Authority: Issues short-lived certificates that encrypt service-to-service traffic through Amazon ECS Service Connect, leaving no long-lived certificates to manage or leak.
- GitHub Actions with OpenID Connect (OIDC): Code deployments authenticate to AWS dynamically using temporary tokens, eliminating the need to store sensitive credentials. Each environment has a dedicated deploy role scoped to the minimum permissions required.
- Terraform (infrastructure as code): the entire environment is defined declaratively, so dev, staging, and production are built from the same modules, making them reproducible, auditable, and portable.
The high-level architecture is shown in Figure 1, which depicts the following components:
- User requests arrive through HTTPS at an Application Load Balancer, which routes by hostname to services running as serverless containers in an ECS Fargate cluster.
- Internal service-to-service traffic is encrypted using Amazon ECS Service Connect and short-lived certificates issued by AWS Private CA.
- Primary application data is stored in DocumentDB, with configuration and secrets in AWS Systems Manager Parameter Store.
- Shared account-level resources include GitHub Actions OpenID Connect for keyless continuous integration and delivery (CI/CD) and ACM public certificates for external TLS.
Figure 1: mindLAMP deployment architecture on AWS
Security by design
Four architectural decisions underpin the security model:
- Encryption in transit: Internal service traffic is encrypted through Amazon ECS Service Connect with short-lived certificates issued by a private certificate authority and rotated automatically. No long-lived certificates to leak.
- Keyless CI/CD: Deployments authenticate through OIDC federation using ephemeral credentials, with permissions narrowly scoped to the minimum required for each environment.
- Fully serverless compute: No EC2 instances to patch, no capacity to plan. ECS Fargate handles the container lifecycle.
- Everything is code: The application stack is defined in Terraform with remote state. Infrastructure changes are reviewed commits, not console click-throughs.
The underlying philosophy is straightforward: every component the team doesn’t manage directly is one that won’t produce an operational incident requiring after-hours intervention. For a clinical research group without dedicated infrastructure staff, this approach is what makes sustained production operation viable.
Global scale through infrastructure as code
Because mindLAMP is open source and self-hostable, this infrastructure isn’t running only at BIDMC. mindLAMP is deployed at 65 sites, across 42 projects, and in 17 countries around the world. Each site stands up their own instance and retains their own data, satisfying data residency and sovereignty requirements without the BIDMC team needing to build each deployment individually.
The Terraform-based approach pays off in three ways: it’s reproducible (dev, staging, and production are built from the same Terraform modules), auditable (every change is a reviewed commit in Git), and portable (the same modules that run the BIDMC clinic are what enable another institution to stand up their own). For an academic group, infrastructure as code is a best practice and what makes scaling across 65 sites possible.
What’s next: AI-augmented digital navigators
Digital navigators are central to the clinic’s high adherence rates, but their capacity is finite. Much of a navigator’s day is consumed by routine operational tasks—retrieving reports, locating educational materials, resolving device issues—rather than the direct patient interaction that drives outcomes.
The team asked navigators where their time goes and identified four routine areas that pull them away from direct patient interaction. The goal isn’t to automate the navigator role—the interpersonal connection is essential to the care model—but to free navigators from repetitive work so they can focus on patients.
This led to Corvin, an AI agent built to handle four jobs that were consuming navigator time:
- Tech support: Troubleshoots apps and devices by searching internal documentation
- Digital education: Retrieves the right guide for using a tool safely
- Tool identification: Finds the appropriate app for a specific clinical need by querying MindApps.org and other databases
- Data analysis: Runs reports and routine scripts on patient sensor data
Safety is a first-order design requirement. The system can operate on locally hosted open-source models, keeping patient data within the institution’s boundary. Every action is transparent—showing sources consulted and data accessed—so that navigators maintain oversight rather than relying on opaque outputs. Behavior is bounded through constrained prompts and classification guardrails, and the team conducts systematic accuracy evaluations before any AI-generated content enters clinical use.
This work is supported in part by an Amazon Research Award.
Conclusion
The Division of Digital Psychiatry at BIDMC, an affiliated teaching hospital of Harvard Medical School, has shown that a small academic team, powered by AWS managed services, can build and operate a production-grade digital psychiatry platform serving patients across six continents. The combination of serverless compute, managed databases, encrypted service-to-service networking, and infrastructure as code enables global scale without the operational burden that would otherwise require a large engineering organization.
Three takeaways emerge from this work:
- Mental health care is scarce and episodic: digital psychiatry has the potential to make it continuous, measurable, and accessible to everyone who needs it.
- Technology extends clinician reach; it does not replace clinicians: digital navigators, AI agents, and smartphone sensing are force multipliers for the professionals we have.
- AWS makes the leap from prototype to production possible: AWS Fargate, Amazon DocumentDB, AWS Private CA, and Terraform are what turn an academic project into a platform running reproducibly and compliantly around the world.
Contact an AWS Representative to learn how we can help accelerate your digital health initiatives.
