The Challenge
Hospital inefficiency is rarely a clinical problem. It is a coordination problem.
At a regional health system in the American Midwest, this coordination failure was costing millions. Beds sat empty while admitted patients waited in the emergency department for an average of 4.2 hours more than double the 2-hour CMS benchmark. Operating room utilisation averaged just 67%, well below the 80%+ industry standard, primarily because sterilisation scheduling, patient prep, and anaesthesiology notifications were managed through manual calls and spreadsheets. Patients cleared for discharge spent an average of 6.8 hours waiting for pharmacy, transport, family notification, and community care to align simultaneously.
The founder a hospital administrator with 20 years of operational experience had identified these patterns across her career and arrived at a fundamental insight these coordination failures could be solved with autonomous AI agents operating across departmental boundaries, with human oversight at every step.
She came to TechEniac with a clear product vision: build a multi-agent platform where specialised AI agents handle bed management, surgical scheduling, discharge coordination, and capacity forecasting in real time. The platform needed to integrate with Epic via SMART on FHIR, maintain full HIPAA compliance, and scale to a 4-hospital regional system covering 800+ beds.
The Pain Points
Before writing a single line of code, TechEniac spent two weeks with the founder mapping every operational workflow across the four target departments. The goal was to understand not just what needed to be automated, but what should remain under human control.
The discovery process identified five critical pain points:
ED-to-Inpatient Bed Assignment Delays
4.2-hour average boarding time caused by manual coordination between charge nurses, bed management staff, and housekeeping.
Surgical Schedule Inefficiency
67% OR utilisation driven by poor downstream coordination: sterilisation not ready, patient not prepped, anaesthesiology not notified.
Discharge Coordination Bottleneck
6.8-hour post-clearance delay while pharmacy, transport, family notification, and community care were coordinated sequentially rather than simultaneously.
Capacity Forecasting Failure
Surge events caught the system unprepared. All capacity decisions were reactive rather than data-driven.
Epic EMR Integration Complexity
All operational automation needed to read from and write to Epic via SMART on FHIR demanding authentication requirements for any external system.
Based on this discovery, TechEniac designed a hub-and-spoke multi-agent architecture: a central Hospital Operations Orchestrator agent that monitors overall facility state and dispatches four specialised sub-agents, each responsible for a single operational domain.
Product Discovery & Agent Architecture Design
TechEniac built the orchestration layer using LangGraph, with GPT-4o powering the decision reasoning for each agent. The central orchestrator maintains a shared operations context store and dispatches work to four specialised sub-agents.
Technical Solution
Multi-Agent Orchestration (LangGraph)
TechEniac built the orchestration layer using LangGraph, with GPT-4o powering the decision reasoning for each agent. The central orchestrator maintains a shared operations context store and dispatches work to four specialised sub-agents. Each agent can invoke Epic API calls, trigger notifications, and escalate issues autonomously within defined approval thresholds. High-stakes decisions (bed reassignment during a surge, surgical cancellation) require human confirmation before execution.
Bed Management Agent
The Bed Management Agent monitors real-time bed status from Epic and incoming admission requests. When an admission request arrives, the agent evaluates available beds across multiple criteria simultaneously: unit type match, patient acuity, isolation requirements, and current nursing staff ratios.
The agent proposes an optimal bed assignment with a confidence-scored rationale, automatically notifies housekeeping via API for cleaning prioritisation, and confirms the assignment to the admitting team. This reduced human bed management calls by 74%.
Surgical Coordination Agent
The Surgical Coordination Agent monitors the surgical schedule 72 hours forward and identifies at-risk cases: missing pre-op orders, unconfirmed sterilisation requests, pending anaesthesiology assignments, and unscheduled patient transport.
For each at-risk case, the agent initiates targeted outreach via PerfectServe (clinical messaging integration), escalating unresolved issues to the OR charge nurse 24 hours before case start. This proactive identification model increased OR utilisation from 67% to 81% within the first quarter.
Discharge Facilitation Agent
When a physician marks a patient as medically ready for discharge, the agent launches a parallel coordination workflow simultaneously triggering up to 8 separate tasks:
Pharmacy — expedite discharge prescription processing.
Transport — book with required departure window.
Family — automated SMS notification.
Community Care — book follow-up appointments.
Social Work — confirm discharge planning completion.
The agent monitors each task's completion status and re-escalates stalled tasks every 45 minutes. This parallel approach replacing what was previously a sequential manual process reduced discharge delay from 6.8 hours to 1.9 hours.
Predictive Capacity Forecasting
TechEniac built a capacity forecasting model using Scikit-learn and Prophet, trained on historical admission patterns, seasonal disease surveillance data (CDC FluView API, local health department feeds), scheduled elective admissions, and current facility occupancy.
The model generates 72-hour rolling bed demand forecasts by unit type with confidence intervals. When forecast demand is projected to exceed 90% capacity, the system triggers a proactive alert to staffing, supply chain, and executive leadership with specific recommended interventions replacing same-day reactive decisions with 72-hour advance planning.
Engineering Challenges
1. Epic SMART on FHIR Token Management
Long-running agent sessions required continuous Epic API access, but OAuth tokens expire on a fixed schedule. TechEniac built a token lifecycle manager that proactively refreshes tokens 5 minutes before expiry and maintains a token pool for concurrent agent requests across multiple hospital instances. This eliminated mid-session authentication failures that would have caused agents to lose context during critical operations.
2. Agent Conflict on Shared Resources
When two agents attempted to claim the same bed simultaneously common during surge events the system needed conflict resolution that didn't require human intervention for every collision. TechEniac implemented optimistic locking on bed resources in the shared operations context store: the first agent to claim a bed locks it for 90 seconds, during which competing agents are automatically rerouted to available alternatives. This eliminated all agent-to-agent conflicts on shared resources.
3. Physician Resistance to Automated Discharge Triggers
Early testing revealed significant physician pushback against automated discharge workflows. The original design triggered discharge coordination automatically based on clinical indicators. TechEniac redesigned the trigger model from automatic to opt-in: the discharge agent only fires when the physician explicitly marks a patient as discharge-ready. This preserved physician autonomy while still dramatically accelerating downstream coordination. Adoption increased significantly once physicians understood the agent was accelerating their decisions, not making decisions for them.
4. Multi-Hospital Scaling
Scaling from a single-hospital pilot to a 4-hospital regional system introduced challenges beyond infrastructure. Agent state had to be isolated per facility, while the capacity forecasting model needed a cross-facility view. TechEniac deployed multi-availability-zone infrastructure on AWS for hospital-grade reliability and implemented per-facility agent instances with a shared forecasting layer that aggregates data across the system.
Beyond the AI: Product Decisions That Mattered
The founder came to TechEniac with deep operational expertise but no technical team. What she valued most wasn't the AI sophistication it was three things:
Product thinking that protected physician autonomy
When early testing showed physician resistance to automated triggers, TechEniac redesigned the discharge agent to be opt-in rather than automatic. This wasn't a technical fix it was a product decision that understood how hospitals actually work.
Architecture that scaled without rebuilding
The single-hospital pilot scaled to 4 hospitals without a rewrite. The multi-agent architecture was designed from the start to support facility-level isolation with system-level forecasting.
Full auditability from Day 1
Every agent action is logged, reversible, and auditable. For a healthcare platform, this wasn't a nice-to-have it was the difference between a product that hospitals trust and one they reject.
