Loading…
Building a serverless AI assistant at Pelago: concept to care in two weeks
AWSAnton Aleksandrov
Summary
Pelago engineered a serverless, event-driven AI assistant on AWS within two weeks to provide substance use recovery coaches with contextual response suggestions. Operating under strict Protected Health Information constraints, the system maintains clinical safety through human-in-the-loop review and keeps data confined to an Amazon VPC. Incoming messages flow via AWS AppSync and Amazon DynamoDB to an Amazon SNS topic, which fans out to independent AWS Lambda functions. The asynchronous Chat Assistant Lambda queries history, invokes Amazon Bedrock, and persists suggestions into Amazon RDS MySQL in under 10 seconds. When coaches access a conversation via Amazon API Gateway, pre-generated suggestions load in under 100 milliseconds.
Context
Pelago needed to scale personalized substance use coaching without overburdening care teams. Coaches manage dozens of conversations requiring weeks of context, making synchronous LLM generation unacceptably slow. Strict PHI regulations also required keeping all data within Pelago's AWS VPC environment with mandatory human-in-the-loop oversight.
Approach / What changed
Pelago implemented an asynchronous, event-driven serverless architecture using AWS AppSync, DynamoDB, Amazon SNS, and AWS Lambda. SNS fans out events to a Chat Assistant Lambda that invokes Amazon Bedrock in the background and writes suggestions to Amazon RDS MySQL, while API Gateway retrieves pre-generated suggestions on demand.
Takeaways
- Decoupling message delivery from LLM processing through Amazon SNS fanout prevents tens-of-seconds inference times from blocking user interactions.
- Asynchronous background inference allows Amazon API Gateway and Lambda to serve pre-generated suggestions to coaches in under 100 milliseconds.
- Pelago used DynamoDB for high-throughput conversation writes and Amazon RDS MySQL for structured suggestion querying, analytics joins, and idempotency checks.
Related reading
AWS ·
Gallup scales real-time coaching for thousands with Amazon Bedrock
Gallup needed to centralize decades of proprietary workplace performance research to provide proactive, real-time coaching for organizational leaders directly within their daily workflows. To solve this challenge, Gallup developed Gallup AI inside its Gallup Access platform using Amazon Bedrock and Anthropic Claude models. The multi-tenant serverless architecture leverages Amazon Bedrock Knowledge Bases and Amazon Kendra for retrieval-augmented generation, while AWS Lambda with FastAPI powers real-time streaming responses. Amazon ElastiCache Serverless caches recent conversation history for sub-millisecond session retrieval, Amazon RDS for MySQL provides durable transactional storage, and Amazon Bedrock Guardrails enforce content safety. Since its June 2024 launch, the system has achieved sub-second time-to-first-byte streaming latency while prompt volume grew approximately sevenfold across thousands of organizations.
Tamil SambasivamAWS ·