Business Problem
- Lack of control and flexibility in the existing OpenAI-powered prompt orchestration.
- Inconsistent clinical note structures and accuracy challenges in generated outputs.
- No error handling or benchmarking for validating the results.
- Inability to support multi-agent logic or scalable prompt chaining workflows.
- Existing system lacked robust monitoring and compliance-ready infrastructure.
About
Mariana.AI is a cutting-edge healthcare innovation company focused on automating clinical documentation and patient engagement. To modernize its systems, Mariana.AI partnered with goML to migrate its clinical note generation and medical coding workflows from OpenAI to AWS Bedrock. The goal was to enhance performance, improve prompt engineering, and establish a scalable, compliant backend for future expansion into real-time and voice-based clinical support.
Solution
goML proposed a 4-week AWS-native PoC leveraging Claude Sonnet 3.5 on AWS Bedrock, integrated via Portkey and Langchain for advanced multi-agent prompt orchestration. The solution automates clinical note generation and medical coding workflows with strong schema validation and performance monitoring.
OpenAI to Bedrock Migration
Migrated clinical documentation logic from OpenAI to Claude Sonnet 3.5 via AWS Bedrock, ensuring better performance and alignment with enterprise cloud policies.
Data Extraction & Structuring
Implemented a robust pipeline for ingesting data from physician tools, clinical articles, and Mariana.AI's internal knowledge base.
Backend API Development
Backend APIs built with FastAPI (Python) to pull and process clinical data efficiently and securely.
Schema Validation & Quality Assurance
Developed a comprehensive validation framework to ensure outputs maintain grammatical accuracy, coherence, structural consistency, and JSON schema compliance.
Advanced Prompt Orchestration
Automated Prompt Chains created using Portkey and Langchain to generate structured clinical reports in JSON and Markdown formats.
Monitoring & Secure Data Storage
Set up end-to-end logging and monitoring with AWS CloudWatch, secure document storage using AWS S3, and metadata management via AWS RDS.
Architecture
- User Access & Security
• IAM, Security Analyzer, AWS Shield: Provides user-level and infrastructure-level protection.
• Secured Token Access: Ensures only authorized access to sensitive client data. - Data Layer & Knowledge Creation
• Client Database: Stores customer data.
• Docker + CI/CD: Code is deployed securely through a CI/CD pipeline.
• Data Preprocessing & Knowledge Base Creation: Raw data is cleaned and structured for vectorization and AI processing. - Vectorization & Storage
• Vectorizer + Worker AI: Transforms processed data into vector embeddings.
• OpenSearch Vector DB: Stores vectorized content for semantic search and retrieval. - RAG (Retrieval Augmented Generation) Pipeline
• Uses the vector DB to fetch relevant context and augment prompts.
• Powers responses in the consumption layer (agents, chatbots). - AI Agent Ecosystem
• Multiple Lambda-based AI Agents, each specialized in medical domains:
- Oncology, Gastroenterology, Urology, Cardiology, Geriatrics, Dermatology, Neurology, Orthopedics.
• These agents are powered by Claude 3.5 Sonnet via Amazon Bedrock, ensuring domain-specific insights. - Validation & Explainability
• Explainability Validator: Ensures the clinical relevance and traceability of AI responses.
• Chief Medical Officer Agent: A higher-order agent to review and approve outputs. - User Interaction & Output Handling
• CloudFront + Nginx: Manages user-facing endpoints.
• FAQ Chatbot & Document Generator: Provides two modes of interaction.
• Query Processing → API Gateway → Agents: Routes user inputs for processing via Portkey and Bedrock. - Storage & Monitoring
• S3 Bucket: Stores generated documents and clinical validations.
• CloudWatch: Logs system activities and metrics.
• SNS + Security Modules: Provides notifications and alerting with AWS-native security posture.
