Applying an evidence-linked multi-agent workflow to cardiology feature engineering from electronic health records
Aug 7, 2026

Cardiology often requires integrating evidence across multiple EHR domains, including diagnoses, medications, laboratory results, procedures, and imaging, rather than relying on a single data source. Heart failure illustrates this challenge particularly well. It affects an estimated 6.7 million U.S. adults, a number projected to rise to 8.7 million by 2030, and was reported on 14.6% of U.S. death certificates in 2023.
Before patients can be evaluated, risk-stratified, or matched to therapy, fragmented EHR data must be transformed into reliable features, a process that consumes much of the analytics effort. Data scientists spend 39–45% of their time on data loading and cleaning, and heart failure adds complexity by requiring integration of ejection-fraction thresholds, diagnoses, medications, and lab trends across multiple tables.
Why Cardiology Feature Engineering Is Hard to Get Right
Most clinical conditions can often be characterized using a small number of key measurements. Cardiology rarely follows this pattern: conditions such as heart failure are not defined by a single variable but by integrating multiple sources of evidence, including ejection-fraction thresholds, biomarker trends, medication patterns, and comorbidities, each documented in different parts of the EHR and often changing over time.
This makes data fragmentation particularly challenging in cardiology, where relevant information is distributed across demographics, diagnoses, medications, procedures, laboratory results, and ejection-fraction records, each with distinct formats and temporal patterns. Simple joins may introduce duplicate or inconsistent patient representations, and even successfully integrated data requires clinical interpretation through guideline-based criteria rather than direct extraction of individual values.
Existing rule-based approaches are often rigid and difficult to generalize. While general-purpose LLM-based extraction provides flexibility, it can introduce unsupported inferences and hallucinated features. Reliable feature engineering requires both clinical rigor and a clear evidence trail.
A Structured Pipeline for Evidence-Linked Feature Engineering
Working with partners at Rutgers University, we applied the Nimblemind Multi-Agent System (nMAS) to heart-failure data from 500 dummy patients, represented across nine EHR tables.
Within cardiology, heart failure represents a particularly demanding test case for evaluating feature-engineering pipelines. Its identification is not captured by a single diagnosis code or laboratory value; rather, it requires integrating ejection-fraction thresholds, biomarker trends such as BNP and troponin, medication patterns, and overlapping comorbidities involving renal, pulmonary, and metabolic systems, often documented concurrently for the same patient.
Because heart failure spans nearly every clinical data domain that a cardiology pipeline must process, it provides a rigorous evaluation setting. A workflow that can reliably phenotype heart failure should be adaptable to a broad range of cardiovascular conditions.
An Achievability Agent first verifies that each requested feature is supported by the available data. The feature-engineering pipeline then proceeds in two stages:
Stage 1 – Structured merge: Standardizes, deduplicates, and aggregates EHR tables by patient using clinically meaningful event keys, then merges them into a validated patient-level dataset while preserving the original patient count.
Stage 2 – Composite feature generation: Applies a literature-grounded, cardiologist-approved scoring rubric to generate 70 clinical features across eight categories: disease severity, cardiovascular risk, five organ-system comorbidity burdens, and demographic vulnerability. Each feature is linked to contributing components, scores, and source columns.
An LLM auditor verifies outputs using a restricted whitelist, without modifying evidence traces, rationales, or patient identifiers.

Does It Improve Performance?
Heart failure is not a single homogeneous condition; it comprises distinct phenotypes defined by left ventricular function, commonly assessed through ejection fraction (EF), including heart failure with reduced ejection fraction (HFrEF) and heart failure with preserved ejection fraction (HFpEF).
While HFrEF has several established guideline-directed medical therapies, HFpEF has historically presented greater therapeutic challenges with more limited treatment options. Accurate classification of these phenotypes is therefore an important test of whether engineered features capture clinically meaningful information.
nMAS generated 132 structured features and 70 rubric-scored composite features. All 500 patient records were reviewed by an LLM auditor, and all 19 automated quality checks passed without errors. When used to predict a patient's heart-failure phenotype, these engineered features increased classification accuracy from 77.6% to 89.6% for HFrEF and from 75.2% to 80.9% for HFpEF. These improvements suggest that the engineered features capture clinically relevant signals beyond what is available through the baseline approach.
Why Auditability Matters
Many approaches to clinical feature engineering involve important trade-offs.
Traditional preprocessing pipelines often rely on institution-specific scripts that are difficult to reuse or audit. Rule-based systems require continuous maintenance as clinical definitions evolve. General-purpose language models offer flexibility but may generate unsupported clinical conclusions that are difficult to verify.
nMAS combines deterministic feature engineering with evidence-linked auditing.
Every engineered feature is grounded in an explicit clinical rubric, retains links to the underlying EHR variables that contributed to its score, and preserves the clinical rationale used during feature construction. This allows researchers to review how each feature was generated rather than relying solely on model outputs.
What This Means in Practice
With data scientists spending an estimated 39–45% of their work week on data preparation—equivalent to roughly $1,180–$1,560 per week based on U.S. data-scientist total compensation—a reusable, versioned pipeline transforms recurring manual preprocessing into a one-time engineering investment. This can support faster cohort development, more consistent analyses, and clearer review of the evidence behind each feature.
The potential impact extends beyond data preparation. In heart-failure trial prescreening, manual eligibility review can require 15–20 minutes per patient, making large-scale screening resource-intensive even with dedicated coordinators. Automated, guideline-grounded feature generation enables scalable cohort screening by replacing patient-by-patient review with reproducible computational assessment.
The Nimblemind Approach
Cardiology feature engineering reflects a broader challenge throughout clinical AI: the information required for meaningful research already exists within the electronic health record, but transforming fragmented data into trustworthy, reusable features remains difficult.
The results of this study suggest that an evidence-linked workflow can substantially reduce that burden. By integrating longitudinal EHR data, generating rubric-grounded composite features, validating every output, and preserving complete evidence traceability, nMAS provides reusable infrastructure rather than a disease-specific pipeline.
Demonstrated here for heart failure, the same architecture can support other cardiovascular diseases and clinical domains by replacing the disease-specific rubric and reusing the underlying data integration, feature engineering, auditing, and validation framework.
