
Avila Science
Avila Science is a healthcare technology company focused on providing telemedicine support to patients experiencing early pregnancy loss. Their digital assistant, Ava, helps guide patients through sensitive clinical workflows, providing timely communication, treatment guidance, and escalation to human clinicians when needed. Avila's mission is to combine empathy, clarity, and clinical accuracy in digital healthcare delivery.
Company Background
Avila Science is a healthcare technology company focused on providing telemedicine support to patients experiencing early pregnancy loss. Their digital assistant, Ava, helps guide patients through sensitive clinical workflows, providing timely communication, treatment guidance, and escalation to human clinicians when needed. Avila's mission is to combine empathy, clarity, and clinical accuracy in digital healthcare delivery.
The Challenge
Avila's existing system for patient interaction was functional but inflexible. Built on a traditional rules engine, it relied on hardcoded logic trees that required engineers to modify code for even minor changes. As a result, updating treatment flows, adjusting workflows, or scaling the platform to support new use cases was both slow and resource-intensive.
This rigidity was particularly problematic given the emotionally sensitive nature of early pregnancy loss. The system needed to support natural, human-like interactions, while remaining auditable, secure, and compliant with clinical standards. It also had to escalate appropriately when the AI wasn't confident, preventing silent failures or miscommunications with patients.
The team sought a more adaptive, reliable, and maintainable solution to meet these evolving demands.
The Solution
Avila partnered with Stride Consulting to rearchitect the Ava assistant using LangGraph, LangChain's graph-based orchestration framework. The goal was to transition from brittle conditional logic to a flexible, LLM-powered agent system while preserving compliance, reliability, and transparency.
A Graph-Based AI Architecture
Stride placed an LLM (Claude Sonnet) at the center of the architecture, allowing it to reason over current patient state, message history, and clinical anchors. However, the model was constrained from altering past messages or patient records—a key safeguard for clinical auditability. The LLM could instead propose actions, call tools, or generate appropriate next messages.
Intelligent Error Handling
To manage unpredictability and maintain robustness, Stride implemented several architectural patterns:
- Retry Nodes: These automatically detected malformed tool calls or silent model failures, deleted the invalid output, and retried the operation. This prevented hallucinated states and ensured stability.
- Confidence Thresholding: When the model's confidence fell below a defined threshold, the workflow escalated to a human reviewer. This allowed automation to handle routine cases while routing ambiguity to clinicians.
- Multi-message Coordination: Patients often sent multiple texts in quick succession. The system included smart delays and message invalidation logic to ensure it responded only after the full context was available.
Custom Evaluation Framework
To validate system behavior, Stride built a bespoke eval harness using LangSmith and Python. This framework tested both "happy path" and edge cases, using GPT-4 to judge outputs based on consistency, clarity, and outcome quality. It also addressed challenges like time-based variation by preprocessing timestamps and clarifying evaluation criteria within the rubric.
Rapid Treatment Expansion
Thanks to the modular LangGraph architecture, Avila was able to expand Ava to support new treatments by reusing the same workflow and simply plugging in new treatment blueprints. This extensibility required minimal new code and dramatically improved iteration speed.
The Business Outcomes
Stride helped Avila move from a rigid, rules-based assistant to a robust, LLM-driven platform designed for clinical-grade reliability and long-term scalability.
Key outcomes included:
- Improved Maintainability: Ava's workflows can now be updated or extended by editing configuration files rather than code, reducing time-to-launch for new treatments.
- Increased Reliability: Built-in retry logic and human-in-the-loop confidence handling improved resilience and trust in patient interactions.
- Stronger Compliance: LangGraph's stateful architecture, combined with deliberate model constraints, ensured Ava could never overwrite historical records or bypass required safeguards.
- Faster Iteration: Avila can now launch and evaluate new workflows in a fraction of the time, with the ability to simulate and validate complex interactions via the custom eval suite.
- Significant Operational Scaling: The new system dramatically increased Avila’s capacity. Humans on the operations team now only need to review 1 out of every 10 text message exchanges, enabling the company to handle up to 10 times as many patients without growing the support team.
By transforming Ava into a graph-based LLM agent, Avila Science gained a future-proof foundation for clinical AI—one that blends technical sophistication with the empathy and oversight required for sensitive healthcare scenarios.
Success Stories

SOLVING THE PAINS OF GROWTH

MODERN MICROSERVICES AT SPEED
