This article details Pelago's implementation of an AI-powered assistant for healthcare, leveraging an event-driven serverless architecture on AWS. It highlights how asynchronous processing with SNS and Lambda enabled rapid development, decoupled services, and efficient LLM inference while maintaining HIPAA compliance and providing instant user experience.
Read original on AWS Architecture BlogPelago, a digital health company, needed an AI assistant to support their care team with personalized member interactions. Key challenges included maintaining long-term conversation context, ensuring human-in-the-loop oversight, adhering to Protected Health Information (PHI) requirements by keeping data within their AWS VPC, and providing instant suggestions to coaches despite potentially long Large Language Model (LLM) processing times. The solution also needed to be rapidly developed and scalable.
The core of Pelago's solution is an event-driven serverless architecture utilizing AWS services. This approach decouples concerns and allows for asynchronous processing of computationally intensive tasks, such as AI inference. By treating each incoming member message as an event, the system can fan out processing to independent consumers without blocking the user experience.
The architecture involves several AWS services working in concert:
When a coach opens a conversation, pre-generated suggestions are retrieved from MySQL via API Gateway and Lambda in under 100 milliseconds, ensuring a responsive user experience regardless of the LLM generation time. This read-your-writes consistency is achieved by storing the results of asynchronous processing for synchronous reads.