Tracing Cardiac Pathways: An Automated Feature Engineering Pipeline for Heart Failure Based on Evidence Chains
Clinical research and AI modeling for heart failure have long been constrained by the inefficiency and fragmentation of feature engineering in Electronic Health Records (EHR), with traditional methods struggling to balance automation and clinical interpretability. This paper introduces the Nimblemind Multi-Agent System (nMAS), constructing an automated feature engineering pipeline anchored by evidence linking and scoring criteria. Evaluated on 500 simulated patient records, the system successfully generated 132 structured features and 70 aggregated features validated against scoring criteria, undergoing integrity and provenance auditing via constrained Large Language Models. Experiments showed that incorporating these features improved the AUROC for predicting Heart Failure with reduced Ejection Fraction (HFrEF) and preserved Ejection Fraction (HFpEF) phenotypes from 0.895 to 0.963 and from 0.870 to 0.910, respectively. Independent evaluation indicated that the evidence support and methodological rigor of the features reached 81.5% of the maximum score. This study demonstrates the feasibility of automated, auditable feature engineering for complex cardiovascular EHR data, providing a traceable methodological foundation for clinical AI deployment.
Background and Context
Clinical research and artificial intelligence modeling for heart failure have long been constrained by the inefficiency and fragmentation inherent in Electronic Health Record (EHR) feature engineering. This specific workflow stage consumes between 39% and 45% of a data scientist's total workload, a burden that is particularly acute in the study of heart failure, a complex condition affecting approximately 6.7 million adults in the United States. The diagnosis and phenotyping of heart failure require the integration of highly fragmented EHR data while strictly adhering to guideline-based clinical reasoning logic. Traditional methods for extracting features from these records often struggle to balance the need for automation with the imperative for clinical interpretability.
Existing approaches, whether rule-based systems or standard Large Language Model (LLM) applications, have provided varying degrees of automation but frequently lack maintainability and traceability. This absence of clear provenance leads to a "black box" trust crisis in clinical applications, where the rationale behind specific features cannot be audited against clinical standards. To address these critical pain points, this study introduces the Nimblemind Multi-Agent System (nMAS). This system constructs an automated feature engineering pipeline anchored by evidence linking and scoring criteria, aiming to resolve the dual challenges of automation efficiency and clinical interpretability in heart failure research.
Deep Analysis
The technical architecture of nMAS centers on a sophisticated multi-agent collaboration mechanism and a robust evidence-linking strategy. Rather than simply invoking LLMs for generic text generation, the system designs a rigorous pipeline that transforms raw EHR tables into clinically meaningful aggregated features. The process begins by extracting data from nine distinct EHR source tables. Through coordinated work among multiple agents, the system parses and reorganizes this data according to specific clinical scoring rubrics. This structured approach successfully generated 132 basic structured features and further aggregated them into 70 high-order features.
A critical innovation within nMAS is the introduction of an evidence-linking mechanism that ensures every generated feature can be traced back to its original data points. The system employs constrained Large Language Models to perform integrity and provenance auditing. This audit process does not merely check for structural completeness but also verifies whether each feature aligns with pre-set clinical scoring criteria. By implementing a closed-loop strategy of "generation-validation-audit," the system effectively mitigates the hallucination issues common in traditional LLM applications. This ensures logical rigor and clinical compliance, providing high-quality, interpretable input data for subsequent machine learning models.
Industry Impact
In experimental evaluations using 500 simulated patient records from a single institution, the nMAS system demonstrated significant improvements in predictive performance for heart failure phenotypes. The study focused on two primary phenotypes: Heart Failure with reduced Ejection Fraction (HFrEF) and Heart Failure with preserved Ejection Fraction (HFpEF). The incorporation of the aggregated features generated by nMAS led to a substantial increase in the Area Under the Receiver Operating Characteristic Curve (AUROC). Specifically, the AUROC for predicting HFrEF improved from a baseline of 0.895 to 0.963, while the AUROC for HFpEF prediction rose from 0.870 to 0.910. These metrics confirm the efficacy of the feature engineering process in capturing complex cardiovascular data patterns.
Furthermore, independent evaluation based on scoring criteria indicated that the evidence support and methodological rigor of the generated features reached 81.5% of the maximum possible score. This high rating underscores the reliability of nMAS in producing clinically valid features. The system offers a new paradigm for the open-source community and industrial deployment by demonstrating how multi-agent collaboration and evidence linking can balance automation with clinical strictness. This approach lowers the barrier to entry for developing clinical AI models, particularly in specialized fields like cardiology that require deep domain expertise.
Outlook
The introduction of nMAS provides a traceable methodological foundation for the deployment of clinical AI, addressing the long-standing issue of uninterpretable automated feature extraction. By ensuring that every feature is backed by a verifiable evidence chain, the system lays the groundwork for regulatory approval and enhanced clinical trust. Although the current evaluation is limited to a single-institution cohort and requires external validation, the results sufficiently demonstrate the potential of automated, auditable feature engineering in complex cardiovascular data.
This research highlights the importance of evidence traceability in future AI development. It suggests a shift in how data scientists approach clinical research, moving from manual, opaque feature creation to automated, auditable pipelines. As healthcare systems continue to digitize, tools like nMAS will be crucial in transforming raw EHR data into actionable clinical insights. The ability to automatically generate features that are both high-performing and clinically interpretable could accelerate the translation of AI research into practical clinical decision-support tools, ultimately improving patient outcomes in heart failure management.