BACK

Voice-Enabled Meal Logging and Nutrition Analysis Platform

A healthcare AI and SaaS provider partnered with Aivar to design and launch a serverless, voice-enabled meal logging and nutrition analysis platform for chronic disease management, built on Amazon Bedrock, AWS Lambda, and a HIPAA-aligned security architecture.
No items found.

Customer Challenge

The client's platform serves healthcare providers managing chronic disease populations across diabetes management, bariatric surgery programs, and cardiac rehabilitation initiatives. Manual logging was failing patients and clinicians alike, and voice — the only viable fix — came with strict constraints:

  • High-friction manual logging: patients had to type or navigate menus to record dietary intake, leading to high abandonment rates and loss of clinical visibility into dietary adherence.
  • Zero-tolerance compliance requirement: voice-based meal logging, the lowest-friction modality, processes Protected Health Information and required end-to-end HIPAA Security Rule compliance with no room for post-deployment remediation.
  • Fixed 16-week launch window: without continuous, accurate nutrition data, clinicians could not intervene when patients deviated from treatment plans — and the platform needed to launch within a fixed 16-week timeline.

Solution

Aivar designed and implemented a serverless, API-first microservice architecture focused on Voice Intelligence, HIPAA-Aligned Security, and Cost-Optimized AI Inference.

  • Infrastructure as Code (IaC) & Automation: the entire AWS environment is provisioned using Terraform, covering the VPC, Lambda functions, API Gateway, OpenSearch, S3, KMS, and Secrets Manager, with zero manual console changes permitted in production.
  • Serverless Compute & Orchestration: AWS Lambda orchestrates the full meal-logging pipeline (transcription, extraction, analysis) with automatic scaling and no fixed compute capacity, while AWS Step Functions manages retry logic and dead-letter-queue handling for failed third-party API calls.
  • AI-Powered Nutrition Intelligence: Amazon Bedrock (Claude 3.5 Haiku for food extraction, Claude Sonnet for nutrition analysis) combined with Sarvam AI and Deepgram transcription services convert patient voice, audio, and text into structured nutrition data, supported by a semantic search food knowledge base on Amazon OpenSearch.

  • HIPAA-Grade Security: KMS Customer-Managed Keys encrypt all PHI at rest across S3, Secrets Manager, and OpenSearch; TLS 1.2 or higher is enforced across all data flows; and CloudTrail, GuardDuty, and AWS Config provide continuous audit logging and compliance monitoring.
  • CI/CD Pipeline: GitHub Actions automates testing, security scanning, and staged deployment through dev, staging, and production environments.

Architecture

The solution layers serverless compute, AI inference, and HIPAA-grade security controls into a single API-first architecture:

  • Terraform-provisioned AWS environment — VPC, Lambda, API Gateway, OpenSearch, S3, KMS, and Secrets Manager — forms the infrastructure foundation, with zero manual console changes permitted in production.
  • AWS Lambda and AWS Step Functions form the compute and orchestration layer, running the full meal-logging pipeline end to end and managing retry logic and dead-letter-queue handling for failed third-party calls.
  • Amazon Bedrock (Claude 3.5 Haiku and Claude Sonnet), Sarvam AI, and Deepgram form the AI inference layer, converting patient voice, audio, and text into structured nutrition data, backed by a semantic search food knowledge base on Amazon OpenSearch.
  • KMS Customer-Managed Keys, TLS 1.2+, CloudTrail, GuardDuty, and AWS Config deliver the HIPAA-grade security layer, encrypting PHI at rest, securing data in transit, and providing continuous audit logging and compliance monitoring.
  • GitHub Actions automates testing, security scanning, and staged deployment across dev, staging, and production environments.

Key Outcomes

  • Validated Performance: achieved a P95 API latency of 1.8 seconds (target under 2.0 seconds) and sustained 1,200 concurrent users without degradation (target 1,000).
  • High Extraction Accuracy: established a transcription confidence average of 0.85 (target above 0.80) across all input modalities.
  • HIPAA Compliance Achieved: zero critical findings in the HIPAA controls audit, with an executed AWS BAA and confirmed sub-processor BAAs with both transcription providers.
  • Disaster Recovery Validated: achieved an RTO of 3.5 hours and RPO of 12 minutes (targets 4 hours and 15 minutes respectively), confirmed through a formal disaster recovery test.
  • Operational Excellence: delivered the 16-week fixed-scope engagement on schedule with 82% Lambda code coverage (target above 80%).

Learnings

  • Sub-processor BAAs: Deepgram and Sarvam AI as sub-processors required separate Business Associate Agreements before any PHI could be transmitted; Aivar front-loaded third-party compliance assessment during the discovery phase so BAAs were executed in parallel with infrastructure deployment rather than blocking go-live.
  • PHI-safe logging: CloudWatch Logs must never contain raw transcripts or audio, and PHI leaks can occur inadvertently in error-handling branches; Aivar implemented explicit log redaction patterns with automated test cases and made log auditing a formal UAT success criterion.
  • Multi-model inference testing: the two-model Bedrock split (Haiku for extraction, Sonnet for analysis) required validating inference consistency and failover behavior under throttling; Aivar built comprehensive behavioral testing into the AI integration phase rather than relying on functional testing alone.

Explore Other Case Studies