Preprint
Brief Report

This version is not peer-reviewed.

CardioAgent: A Traceable Agentic and Retrieval-Augmented Architecture for Cardiovascular Clinical Decision Support

Submitted:

17 July 2026

Posted:

20 July 2026

You are already at the latest version

Abstract
Large language models (LLMs) can generate fluent clinical text but remain limited by non deterministic numerical reasoning, lack of direct access to updated guidelines, and limited observability of the process leading to a recommendation. We present CardioAgent, a proof-of- concept cardiovascular clinical decision-support architecture that embeds an LLM within a stateful Reasoning–Acting–Observing workflow. The system combines a LangGraph-based ReAct agent, a suite of deterministic clinical tools, retrieval-augmented generation (RAG) over European Society of Cardiology (ESC) guidelines, session memory, structured output, an operational audit trail, and a numerical consistency checker. The same base model was evaluated in three progressively more structured configurations: a generic zero-shot LLM, a cardiology-specialized LLM, and the complete agentic architecture. In a controlled set of nine synthetic cardiovascular cases, weighted accuracy increased from 55.6% for the generic LLM to 66.7% after domain prompting and to 100% with the complete agent. The complete system achieved a mean normalized keyword recall of 93.5%, invoked the expected tool in 88.9% of cases, and used 2.2 tools per query on average. Mean latency was 17.7 s and median latency was 8.9 s; one case with repeated retrieval calls required 82.3 s. The observed 9/9 accuracy corresponded to a 95% Wilson confidence interval of 70.1–100%. On a separate, author-constructed set of ten cardiology multiple-choice questions inspired by MedQA/USMLE, the tool-guided pipeline selected all expected answers correctly (95% Wilson confidence interval, 72.2–100%). Functional safety checks correctly handled four anomalous inputs, verified nine of nine correct numerical claims, and detected five of five intentionally altered values. These results demonstrate technical feasibility and suggest that deterministic tools, guideline retrieval, and action-level traceability can improve the controllability of LLM-based clinical support. However, the small synthetic test sets, keyword-based scoring, absence of independent cardiologist adjudication, and lack of real-world validation preclude conclusions about clinical effectiveness or safety.
Keywords: 
;  ;  ;  ;  ;  ;  ;  

1. Introduction

Clinical decision-making in cardiology requires the integration of heterogeneous information, including symptoms, comorbidities, laboratory values, electrocardiographic and imaging findings, current medications, validated risk scores, and continuously evolving guideline recommendations. Conventional clinical decision-support systems (CDSSs) can provide reproducible rule-based alerts and calculations, but their utility is often constrained by rigid knowledge representations, high maintenance costs, limited handling of unstructured text, and poor contextualization. Large language models (LLMs) provide a complementary capability: they can interpret free text, synthesize information, and generate clinically readable explanations. Their use as standalone systems, however, introduces well-recognized risks, including hallucinated facts, unreliable arithmetic, outdated knowledge, and limited process traceability.
Recent work has shown that LLMs can encode substantial clinical knowledge and perform well on medical question-answering tasks[1,2]. Nevertheless, examination-style accuracy does not directly translate into safe or effective clinical decision support. Clinical workflows require access to patient-specific data, deterministic calculations, external evidence, and explicit mechanisms for human review. Retrieval-augmented generation (RAG) can ground model outputs in external documents[3], while tool-using agents can decompose a request into actions, invoke specialized functions, observe their outputs, and continue the workflow iteratively[4,5]. In parallel, recent clinical studies have begun to evaluate RAG-assisted and multi-agent workflows at substantially larger scales[6,7,8,9]. This rapidly evolving literature makes it important to distinguish architectural novelty from clinical evidence: integrating an LLM with tools is no longer sufficient by itself; the scientific contribution must be defined by the domain-specific workflow, the controls imposed on the model, and the quality of the evaluation.
This study presents CARDIOAGENT, a cardiology-focused architecture designed around four principles: (i) deterministic operations should be delegated to explicit clinical tools rather than generated from model memory; (ii) guideline-sensitive statements should be supported by retrieval from an updateable ESC knowledge base; (iii) the system should expose an operational action trace rather than only a final answer; and (iv) output correctness and process adherence should be evaluated as distinct dimensions. The system does not expose or claim access to the model’s private internal chain of thought. Instead, it records externally observable events, including tool selection, tool inputs and outputs, retrieved evidence, and the final structured response.
The present work makes three contributions. First, it describes a modular architecture integrating ReAct orchestration, deterministic cardiology tools, guideline RAG, structured reporting, session memory, audit logging, and numerical consistency checking. Second, it proposes a preliminary evaluation framework that jointly measures final-answer quality, concept coverage, expected-tool use, latency, robustness, and action-level traceability. Third, it reports a controlled ablation study using the same base LLM to separate the contribution of domain prompting from that of the complete agentic architecture. The study is explicitly framed as a technical proof of concept rather than a clinical validation.

2. Materials and Methods

2.1. System Overview

CARDIOAGENT was implemented as a modular, stateful workflow in which the LLM acts as an orchestrator rather than the sole source of clinical content. The user interacts with a browser-based Gradio interface. A LangGraph workflow manages the session state and implements a ReAct-style cycle comprising request interpretation, tool selection, tool execution, observation of structured results, and either further action or response generation[4,10]. The generative component was GPT-4o-mini, configured with temperature 0 and a maximum output length of 2048 tokens. The architecture also included temporary multi-turn memory maintained in random-access memory for the duration of each session.
Figure 1 summarizes the main data flow. A clinical request is associated with a session identifier and passed to the agent. Depending on the request, the agent may retrieve a synthetic patient record, invoke one or more deterministic clinical tools, query the ESC guideline knowledge base, or request additional information. Tool outputs are returned to the agent as structured observations and are integrated into a six-section response. In parallel, the system records an audit log, reconstructs the externally observable action path, and applies numerical consistency checks when patient-specific claims can be compared with the synthetic record.

2.2. Domain Specialization and Structured Output

The system prompt defines the role of the agent, requires use of patient data and tools when relevant, and constrains the final answer to six sections: (1) retrieved clinical data, (2) calculations and scores, (3) consulted guidelines, (4) safety alerts, (5) clinical recommendation, and (6) limitations and responsibility statement. The structured format was intended to separate factual inputs, deterministic calculations, retrieved evidence, and model-generated synthesis. It also facilitates manual inspection and automated parsing.
The prompt instructs the agent to retrieve the patient record before making patient-specific recommendations, to use deterministic functions for scores and calculations, and to check interactions or contraindications before suggesting therapeutic changes. Tool order is not fully hard-coded; the agent can select and sequence actions according to the request and the observations returned during the workflow.

2.3. Deterministic Clinical Tool Suite

The prototype includes thirteen main clinical tools and a RAG-enabled variant of the ESC guideline tool. Each tool is implemented as a Python function and exposed to the agent through tool calling. Tool descriptions specify the intended use, input schema, and output format. The tools do not call the LLM; they operate on synthetic records, pre-specified tables, or deterministic formulas and return reproducible structured text.
The tool suite covers the following functional groups:
  • patient-record retrieval and clinical data access;
  • cardiovascular risk assessment, including CHA2DS2-VASc, HAS-BLED, GRACE, and TIMI-related calculations;
  • renal-function assessment using CKD-EPI and Cockcroft–Gault formulations, with medication-relevant interpretation;
  • medication-safety checks, including drug–drug interactions and recommendation validation;
  • cardiovascular treatment support, including target evaluation and dose-adjustment logic;
  • acute-care and safety functions, including critical-value detection and acute coronary syndrome assessment;
  • ESC guideline consultation through either a structured internal knowledge tool or the RAG module.
This separation assigns numerical and rule-based tasks to deterministic modules while retaining the LLM for interpretation, orchestration, and communication. In particular, the architecture distinguishes a clinically correct final statement from a process in which the expected deterministic tool was actually used.

2.4. Retrieval-Augmented Guideline Module

The RAG module provides access to a document collection derived from ESC guidelines relevant to heart failure, atrial fibrillation, acute coronary syndromes, and cardiovascular prevention[11,12,13,14]. PDF documents were loaded using PyPDFLoader, filtered to remove short cover pages and selected formatting artifacts, and segmented using a RecursiveCharacterTextSplitter with a chunk size of 800 characters and an overlap of 150 characters. A total of 1,834 chunks were generated. Embeddings were produced using sentence-transformers/all-MiniLM-L6-v2, normalized, and stored in ChromaDB. At inference time, the four most similar chunks were retrieved and supplied to the agent as supporting context.
The RAG module is exposed as an agent tool. The agent can formulate a semantic query, retrieve relevant passages, inspect the returned context, and either continue the workflow or produce a final response. The design allows the guideline corpus to be updated independently of the underlying LLM. However, retrieval quality depends on PDF extraction, segmentation, embedding quality, cross-language matching, and the relevance of the retrieved sections. The guideline documents were predominantly in English, whereas user interaction was primarily in Italian; the embedding model was not specifically selected for multilingual clinical retrieval. RAG was therefore treated as supporting evidence rather than an autonomous decision source.

2.5. Parallel Report-Generation Pipeline

In addition to the interactive ReAct agent, the prototype includes a LangChain Expression Language (LCEL) branching-and-merging pipeline for document generation. A single textual case is processed in parallel by three specialized chains focusing on diagnosis and risk stratification, treatment, and follow-up/monitoring. A fourth merging chain integrates the partial outputs into a structured report. This pathway is complementary to the agent and was not treated as the main decision-support component because it does not autonomously invoke the deterministic tools or guideline RAG. Its purpose is to reorganize available information into a coherent clinical document.

2.6. Audit Trail, Numerical Consistency Checking, and Operational XAI

The ClinicalLogger stores one JSONL record per interaction, including timestamp, session identifier, user query, ordered tool list, number of tools, final response, and execution time. These records support retrospective analysis of tool selection, action sequences, and latency.
The HallucinationDetector is a targeted numerical consistency checker. Regular-expression patterns extract explicit values such as BNP, INR, GFR, heart rate, potassium, creatinine, HbA1c, BMI, systolic blood pressure, weight, age, CHA2DS2-VASc, and TIMI score. When a corresponding reference value is available in the synthetic patient record, the extracted claim is compared using a field-specific tolerance and classified as consistent, inconsistent, or non-verifiable. This component does not assess the correctness of qualitative recommendations and should not be interpreted as a general hallucination detector.
The XAI module comprises the six-section response and an action-path analyzer. The analyzer reconstructs observable events, including the sequence of tool calls, tool parameters, and returned observations. The heuristic XAI score ranged from 0 to 100 and was computed from five binary indicators: patient-record retrieval (+25), ESC/RAG consultation (+25), use of a safety-related tool (+20), invocation of at least two tools (+15), and inclusion of the responsibility statement (+15). The score measured operational traceability and documentation completeness rather than clinical correctness or faithful access to the model’s internal reasoning. The approach deliberately focuses on operational provenance rather than presenting generated chain-of-thought text as a faithful explanation, because verbalized reasoning can be unfaithful to the underlying model process[15].

2.7. Evaluation Datasets

Two complementary controlled test sets were used.

Open clinical cases.

The primary evaluation comprised nine synthetic cardiovascular cases covering heart failure with reduced ejection fraction, atrial fibrillation and anticoagulation, drug interactions, CHA2DS2-VASc, renal function, secondary prevention and LDL targets, resistant hypertension, HAS-BLED, and urgent STEMI management. Each case included a natural-language query, a reference answer derived from the encoded rules and ESC material, a set of expected clinical concepts, and one or more expected tools when applicable. These cases were designed to test the architecture under controlled conditions and do not constitute real-patient validation.

Cardiology multiple-choice set.

A secondary set comprised ten author-constructed cardiology multiple-choice questions inspired by the style of MedQA/USMLE. The set was not sampled from or equivalent to the full official MedQA benchmark. Each item contained four response options, one expected answer, a short reference explanation, expected keywords, and an expected tool where appropriate. For this experiment, tool selection was guided by the protocol rather than left entirely to autonomous ReAct planning; the retrieved or calculated context was then passed to the LLM, which was required to answer using the format “Answer: X.” This setup assesses a controlled tool-guided pipeline and should not be interpreted as a full-agent benchmark.

2.8. Ablation Configurations

To isolate the contribution of the architecture while controlling for the underlying model, the same LLM was evaluated in three configurations:
  • L0, generic LLM: zero-shot prompting without cardiology specialization, patient-record access, tools, or RAG;
  • L1, specialized LLM: cardiology-specific system prompting, but without external tools or RAG;
  • Complete ReAct agent: domain-specialized LLM with patient-record retrieval, deterministic tools, and ESC guideline RAG.
All configurations were evaluated on the same nine open cases using the same scoring criteria.

2.9. Outcome Measures and Statistical Analysis

Because outputs were generative, evaluation considered both final-answer quality and process quality.
Responses were classified as correct when they covered at least 75% of expected content, partial when coverage was 40–74%, and incorrect when coverage was below 40%. Weighted accuracy assigned scores of 1, 0.5, and 0 to these categories, respectively:
Weighted Accuracy = 1 n i = 1 n s i , s i { 0 , 0.5 , 1 } .
Concept coverage was measured using normalized keyword recall. Text normalization handled capitalization, accents, spaces, hyphens, selected synonyms, and common equivalent formulations; a negation check was used to reduce false matches in statements such as “do not use” versus “recommend.” For case i, keyword recall was defined as
R i = | K i expected K i detected | | K i expected | .
The mean normalized keyword recall was computed as a macro-average by calculating keyword recall separately for each clinical case and then averaging the case-level values. Both normalized recall, including accepted alternatives, and strict literal recall were reported.
Expected-tool utilization was the proportion of cases in which the predefined priority tool was invoked. The number of tools per query and response latency were also recorded. Latency was measured from request submission to availability of the complete response. Mean and median were both reported because repeated tool calls can create substantial right-skew.
For observed proportions, 95% confidence intervals were calculated using the Wilson score method[16], which is more appropriate than the normal approximation for small samples and proportions near 0 or 1.

3. Results

3.1. Performance on Nine Open Clinical Cases

The complete agent produced a response classified as correct for all nine controlled cases. No partial responses, incorrect responses, execution failures, or context-limit errors were reported. Normalized keyword recall averaged 93.5%, whereas strict literal recall was 88.9%. The expected tool was invoked in eight of nine cases (88.9%), with a mean of 2.2 tools per query. The case-level results are shown in Table 1.
The observed weighted accuracy of 100% corresponded to nine successes in nine cases and a 95% Wilson confidence interval of 70.1–100%. The wide interval illustrates the uncertainty associated with the small test set. The keyword analysis also showed why output-level classification and lexical completeness should be separated. In EVAL_03, the system correctly identified the risk of combining warfarin and ibuprofen and proposed paracetamol as a safer alternative, but one expected term was not matched. EVAL_06 correctly recognized that LDL cholesterol of 62 mg/dL was above the target of 55 mg/dL, while EVAL_07 correctly identified resistant hypertension but used only one of the two predefined lexical elements.
The only expected-tool miss occurred in EVAL_03. The agent invoked a general recommendation-validation tool rather than the dedicated drug-interaction tool. The final recommendation was correct, but the process was less directly verifiable. This case illustrates the distinction between a correct output and adherence to the intended evidence-generating workflow.
Table 2. Aggregate performance of the complete agent on the nine open cases.
Table 2. Aggregate performance of the complete agent on the nine open cases.
Metric Result
Cases evaluated 9
Correct / partial / incorrect 9 / 0 / 0
Weighted accuracy 100%
95% Wilson CI for observed accuracy 70.1–100%
Normalized keyword recall 93.5%
Strict keyword recall 88.9%
Expected-tool utilization 88.9%
Mean number of tools per query 2.2
Mean latency 17.7 s
Median latency 8.9 s

3.2. Ablation Study

Thus, domain prompting contributed an absolute increase of 11.1 percentage points. The further increase from 66.7% to 100% resulted from the combined addition of patient-record access, deterministic clinical tools, ESC guideline retrieval, and agentic orchestration, rather than from RAG alone. Relative to the generic configuration, the total observed improvement was 44.4 percentage points (Figure 2).
Case-by-case comparison between L1 and the complete agent indicated improvement in five of nine cases, no change in four, and no deterioration. The largest gain occurred in the renal-function case: the specialized standalone LLM produced an incorrect answer, whereas the agent invoked deterministic calculations for renal function and associated medication implications. Improvements were also reported for the heart-failure treatment pillars, drug-interaction assessment, CHA2DS2-VASc calculation, and LDL-target evaluation. The four unchanged cases involved questions for which the model’s parametric knowledge already identified the main response, although the agentic pathway provided additional reproducibility and provenance.

3.3. Latency and Tool-Use Behavior

Latency was strongly right-skewed. Eight of the nine cases completed in 6.5–13.4 s, whereas EVAL_02 required 82.3 s. Inspection of the action trace showed repeated RAG invocations, up to six calls, without a proportional improvement in the final answer. This event increased the mean latency to 17.7 s, while the median remained 8.9 s. The result identifies a concrete orchestration failure mode and motivates caching, context deduplication, and limits on repeated consecutive calls to the same retrieval tool.
Tool utilization should not be interpreted as a proxy for clinical accuracy. The EVAL_03 result shows that the model can produce the expected answer without the intended specialist tool, whereas repeated tool use in EVAL_02 increased cost and latency without improving the output. A mature agent should therefore optimize both tool appropriateness and tool efficiency, not simply maximize the number of calls.

3.4. Cardiology Multiple-Choice Set

On the ten author-constructed cardiology questions, the controlled tool-guided pipeline selected the expected option in all cases. The observed multiple-choice accuracy was 100%, with a 95% Wilson confidence interval of 72.2–100%. The expected tool was used for all ten questions, and the explanations were classified as complete relative to the predefined keyword sets. Mean response time was 2.2 s and median response time was 2.3 s.
These results should not be compared directly with published results on the official MedQA benchmark. The test set was small, restricted to cardiology, constructed for this prototype, and evaluated using protocol-guided tool selection. The experiment therefore verifies the controlled pipeline on in-domain items rather than establishing general medical question-answering performance.
Table 3. Secondary functional evaluations.
Table 3. Secondary functional evaluations.
Evaluation Result Interpretation
Cardiology MCQ set 10/10 expected options; 95% Wilson CI 72.2–100% Controlled, in-domain, tool-guided experiment; not the official MedQA benchmark
Expected-tool use in MCQ set 10/10 Protocol-guided rather than fully autonomous selection
MCQ latency mean 2.2 s; median 2.3 s Measures the direct tool-guided pipeline, not full ReAct orchestration
Safety-oriented cases 5/5 classified correct with expected tools Demonstrative functional check, not clinical safety validation
Anomalous-input robustness 4/4 handled as intended Empty, nonsensical, missing-patient, and insufficient-data inputs
Correct numerical claims 9/9 confirmed Limited to explicit values represented in the synthetic record
Intentionally altered numerical claims 5/5 detected BNP, INR, GFR, heart rate, and potassium inconsistencies

3.5. Error Analysis, Robustness, and Operational Traceability

No final answer in the primary or secondary test sets was classified as incorrect. However, the action-level analysis identified several non-trivial weaknesses. First, EVAL_03 used a general validation function rather than the dedicated interaction checker. Second, EVAL_06 and EVAL_07 omitted secondary lexical elements despite clinically appropriate main recommendations. Third, repeated retrieval in EVAL_02 produced a substantial latency outlier. These findings show that final-answer accuracy alone would have hidden process deviations, evaluation artifacts, and inefficiencies.
Four anomalous inputs were used to assess basic robustness: an empty query, clinically meaningless text, a non-existent patient identifier, and a request lacking necessary patient data. The system rejected the empty input, avoided generating an arbitrary clinical recommendation from meaningless text, reported that the requested record did not exist, and requested a patient identifier or additional information when required.
The numerical consistency checker confirmed nine of nine explicit values in two responses containing correct patient-specific data. In a deliberately corrupted response, it detected all five altered values: BNP, INR, GFR, heart rate, and potassium. These results verify implementation behavior in the tested examples but do not demonstrate general hallucination detection. The module cannot assess unsupported qualitative statements, incorrect causal interpretations, or inappropriate treatment recommendations.
The action-path analyzer made it possible to inspect whether a response was supported by patient data, risk calculations, safety checks, and guideline retrieval. For example, an anticoagulation assessment could be linked to patient-record retrieval, thromboembolic and bleeding-risk calculations, renal-function assessment, and ESC evidence. In the urgent STEMI scenario, the trace included patient-data retrieval, TIMI-related assessment, guideline consultation, and critical-value checks before the recommendation for urgent reperfusion. These traces increase auditability but do not guarantee that the agent interpreted every tool result correctly.

4. Discussion

This proof-of-concept study suggests that an LLM becomes more controllable when embedded in a domain-specific architecture that delegates calculations to deterministic tools, retrieves guideline evidence at run time, and records observable actions. The main scientific contribution is therefore not a new foundation model or a claim of autonomous clinical reasoning. It is the integration of complementary controls around a general-purpose LLM and the explicit evaluation of both output quality and process adherence.
The ablation results provide preliminary evidence that architecture mattered within the tested scenarios. Domain prompting improved weighted accuracy by 11.1 percentage points, while the combined addition of patient-record access, deterministic tools, ESC guideline retrieval, and agentic orchestration added a further 33.3 points. Because the same base model was used in all three configurations, the comparison reduces one important source of confounding. Nevertheless, the cases were developed in the same project as the architecture and may be closely aligned with its tool set, creating a substantial familiarity or design bias. The results should therefore be interpreted as functional verification rather than evidence of generalization.
The deterministic tools address a specific weakness of generative models: numerical and rule-based operations can be made reproducible and independently testable. The renal-function case illustrates this value directly. In addition, the distinction between final-answer correctness and expected-tool use is important for high-stakes systems. An answer that happens to be correct from model memory may be less trustworthy than one grounded in patient data and a validated calculator. Conversely, the EVAL_02 latency outlier shows that tool use can become inefficient or counterproductive when orchestration is not constrained. Future evaluation should therefore include tool-selection precision and recall, unnecessary-call rate, repeated-call rate, evidence-use faithfulness, and cost per successful case.
The guideline RAG module provides updateability and evidence access without retraining the LLM. This is especially relevant in cardiology, where recommendations and therapeutic targets evolve over time. However, RAG does not guarantee correctness. Retrieval can fail because of poor PDF extraction, inappropriate chunk boundaries, language mismatch, irrelevant sections, or weak query formulation. Even when the correct passage is retrieved, the model may ignore or misinterpret it. A stronger study should separately evaluate retrieval recall, context precision, citation correctness, answer faithfulness, and contradiction handling. Recent agentic biomedical systems have moved toward explicit evaluation of context precision, context recall, faithfulness, and hallucination[8]; these measures would materially strengthen the current framework.
The operational XAI design is intentionally narrower than full model interpretability. The system exposes which actions were taken and which external information was returned, but it does not reveal the true internal computational basis of the LLM’s output. This distinction is scientifically important. Tool traces are useful for audit, debugging, and human review; they should not be conflated with faithful access to internal reasoning. In a clinical interface, the most useful explanation may be a compact provenance report: patient facts used, calculations performed, evidence passages retrieved, safety rules triggered, uncertainty, and unresolved conflicts.
The broader literature on agentic healthcare is expanding rapidly[9,17]. Consequently, a publishable version of this work should emphasize features that are specific and testable: cardiology-oriented deterministic tools, separation of process and outcome metrics, action-level auditability, a numerical consistency layer, and an ablation design using the same base model. The present evidence supports a “design and preliminary evaluation” article. It does not yet support claims of clinical decision-support effectiveness, improved patient outcomes, reduced medical error, or regulatory readiness.

4.1. Limitations

This study has several important limitations.
First, the primary evaluation included only nine synthetic cases, and the secondary multiple-choice set included only ten author-constructed questions. Point estimates were therefore unstable, as reflected by the wide Wilson intervals. Perfect observed performance on such small sets is compatible with substantially lower performance in broader populations.
Second, the evaluation cases, expected concepts, and tool expectations were defined within the same project as the system. This creates risks of circularity, familiarity bias, and over-alignment between the test set and the implemented tool catalog. Independent case construction and blinded adjudication by cardiologists are required.
Third, the main scoring method relied on expected keywords and thresholds for correct, partial, and incorrect responses. Normalization and negation handling reduce some lexical artifacts but do not replace semantic evaluation or expert review. A clinically incomplete or poorly prioritized response may still contain the expected words, while an appropriate response may use different terminology.
Fourth, the experiment did not evaluate repeated-run stability, model-version drift, prompt sensitivity, or stochastic variability across providers and model families. Temperature 0 reduces but does not eliminate all sources of non-determinism in hosted model systems.
Fifth, patient records were synthetic and the system was not connected to an electronic health record, laboratory system, imaging repository, or live clinical workflow. The study therefore does not address interoperability, missingness patterns, temporal data, documentation noise, privacy, cybersecurity, or human factors under real clinical conditions.
Sixth, the RAG evaluation did not include a dedicated retrieval gold standard, passage-level relevance labels, citation verification, or faithfulness metrics. The effect of RAG cannot be cleanly separated from the effect of deterministic tools in the current L1-to-agent comparison. A factorial ablation is needed to isolate patient retrieval, tools, structured ESC knowledge, document RAG, numerical checking, and response formatting.
Seventh, the numerical consistency checker covers only explicit values for which a reference field exists. It cannot validate qualitative recommendations, causal reasoning, or clinical appropriateness and should not be described as a general hallucination detector.
Finally, no clinical utility, safety, fairness, calibration, prospective performance, or patient outcome was evaluated. Before any clinical use, the system would require independent external validation, human-factors testing, risk management, data-governance controls, continuous monitoring, and an appropriate regulatory assessment[18].

4.2. Recommended Validation Pathway

The current architecture can support a substantially stronger follow-up study. The highest-priority additions are:
  • an external set of at least 100–300 cardiology cases spanning multiple disease areas, complexity levels, and missing-data patterns;
  • blinded ratings by at least two independent cardiologists, with adjudication and inter-rater agreement;
  • a factorial ablation separating prompt specialization, patient context, deterministic tools, structured guideline rules, document RAG, numerical checking, and action-trace formatting;
  • repeated runs across model versions and at least one alternative LLM to assess stability and architecture dependence;
  • retrieval-specific metrics, including context recall, context precision, citation correctness, answer faithfulness, and contradiction sensitivity;
  • safety-oriented challenge cases containing ambiguous indications, contraindications, conflicting guideline statements, prompt injection, missing critical information, and out-of-distribution values;
  • workflow metrics, including unnecessary tool calls, repeated calls, total token use, cost, latency, and clinician time saved or added.

5. Conclusion

We presented CARDIOAGENT, a modular proof-of-concept architecture for cardiovascular clinical decision support that combines a general-purpose LLM with ReAct orchestration, deterministic clinical tools, ESC guideline retrieval, session memory, structured reporting, operational action traces, audit logging, and targeted numerical consistency checks. In a small controlled evaluation, the complete architecture outperformed generic and domain-prompted standalone configurations of the same base model and produced correct expected outputs across the tested cases. The analysis also identified process deviations and inefficiencies that would have been hidden by final-answer accuracy alone.
The findings support the feasibility of a traceable, tool-augmented approach, but they do not establish clinical effectiveness or safety. The next scientific step is not to increase the autonomy of the agent; it is to subject the architecture to larger, independent, clinician-adjudicated, retrieval-aware, and safety-focused evaluation. Within these boundaries, CARDIOAGENT provides a structured basis for investigating how LLMs can be integrated into cardiovascular decision-support workflows while preserving human oversight and making external evidence and computational actions more visible.

Author Contributions

D.M. contributed to software development, investigation, data curation, visualization, and writing—original draft. P.H.G. contributed to conceptualization, methodology, supervision, validation, and writing—review and editing. All authors read and approved the final manuscript.

Funding

This research did not receive a specific grant from any funding agency in the public, commercial or non-profit sectors.

Data Availability Statement

The source code, software environment specifications, synthetic clinical cases, evaluation questions, prompt versions, guideline manifest, and instructions for reconstructing the vector database and reproducing the experiments will be made available in a public repository upon publication. The ESC guideline PDF documents will not be redistributed. Bibliographic references, official sources, and document-ingestion instructions will be provided instead.

Conflicts of Interest

The authors declare no competing interests.

Use of Generative AI in Manuscript Preparation.

During the preparation of this manuscript, the authors used generative AI tools for language refinement, structural editing. All scientific content, analyses, references, and final wording were critically reviewed and verified by the authors, who take full responsibility for the accuracy and integrity of the manuscript.

References

  1. Singhal, K.; Azizi, S.; Tu, T.; Mahdavi, S.S.; Wei, J.; Chung, H.W.; Scales, N.; Tanwani, A.; Cole-Lewis, H.; Pfohl, S.; et al. Large Language Models Encode Clinical Knowledge. Nature 2023, 620, 172–180. [Google Scholar] [CrossRef] [PubMed]
  2. Nori, H.; King, N.; McKinney, S.M.; Carignan, D.; Horvitz, E. Capabilities of GPT-4 on Medical Challenge Problems. arXiv 2023, arXiv:2303.13375. [Google Scholar]
  3. Lewis, P.; Perez, E.; Piktus, A.; Petroni, F.; Karpukhin, V.; Goyal, N.; Kuttler, H.; Lewis, M.; Yih, W.t.; Rocktaschel, T.; et al. Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. In Proceedings of the Advances in Neural Information Processing Systems, 2020, Vol. 33, pp. 9459–9474.
  4. Yao, S.; Zhao, J.; Yu, D.; Du, N.; Shafran, I.; Narasimhan, K.; Cao, Y. ReAct: Synergizing Reasoning and Acting in Language Models. In Proceedings of the International Conference on Learning Representations, 2023. [Google Scholar]
  5. Schick, T.; Dwivedi-Yu, J.; Dessi, R.; Raileanu, R.; Lomeli, M.; Hambro, E.; Zettlemoyer, L.; Cancedda, N.; Scialom, T. Toolformer: Language Models Can Teach Themselves to Use Tools. In Proceedings of the Advances in Neural Information Processing Systems, 2023; Vol. 36. [Google Scholar]
  6. Gaber, F.; Shaik, M.; Allega, F.; Bilecz, A.J.; Busch, F.; Goon, K.; Franke, V.; et al. Evaluating Large Language Model Workflows in Clinical Decision Support for Triage and Referral and Diagnosis. npj Digit. Med. 2025, 8, 263. [Google Scholar] [CrossRef] [PubMed]
  7. Li, R.; Wang, X.; Berlowitz, D.; et al. CARE-AD: A Multi-Agent Large Language Model Framework for Alzheimer’s Disease Prediction Using Longitudinal Clinical Notes. npj Digit. Med. 2025, 8, 541. [Google Scholar] [CrossRef] [PubMed]
  8. Nguyen, N.T.H.; et al. Med.ai ASK: An Agentic System for Biomedical Question Answering. J. Am. Med. Inform. Assoc. 2026, 33, 1134–1145. [Google Scholar] [CrossRef] [PubMed]
  9. Liu, Y.; Carrero, Z.I.; Jiang, X.; et al. Benchmarking Large Language Model-Based Agent Systems for Clinical Decision Tasks. npj Digit. Med. 2026, 9, 259. [Google Scholar] [CrossRef] [PubMed]
  10. LangChain, A.I. LangGraph: Build Stateful, Multi-Actor Applications with LLMs. Softw. Repos. Accessed. 2024. (accessed on July 2026). [Google Scholar]
  11. McDonagh, T.A.; Metra, M.; Adamo, M.; Gardner, R.S.; Baumbach, A.; Bohm, M.; Burri, H.; Butler, J.; Celutkiene, J.; Chioncel, O.; et al. 2021 ESC Guidelines for the Diagnosis and Treatment of Acute and Chronic Heart Failure. Eur. Heart J. 2021, 42, 3599–3726. [Google Scholar] [CrossRef] [PubMed]
  12. Hindricks, G.; Potpara, T.; Dagres, N.; Arbelo, E.; Bax, J.J.; Blomstrom-Lundqvist, C.; Boriani, G.; Castella, M.; Dan, G.A.; Dilaveris, P.E.; et al. 2020 ESC Guidelines for the Diagnosis and Management of Atrial Fibrillation. Eur. Heart J. 2021, 42, 373–498. [Google Scholar] [CrossRef] [PubMed]
  13. Byrne, R.A.; Rossello, X.; Coughlan, J.J.; Barbato, E.; Berry, C.; Chieffo, A.; Claeys, M.J.; Dan, G.A.; Dweck, M.R.; Galbraith, M.; et al. 2023 ESC Guidelines for the Management of Acute Coronary Syndromes. Eur. Heart J. 2023, 44, 3720–3826. [Google Scholar] [CrossRef] [PubMed]
  14. Mach, F.; Baigent, C.; Catapano, A.L.; Koskinas, K.C.; Casula, M.; Badimon, L.; Chapman, M.J.; De Backer, G.G.; Delgado, V.; Ference, B.A.; et al. 2019 ESC/EAS Guidelines for the Management of Dyslipidaemias: Lipid Modification to Reduce Cardiovascular Risk. Eur. Heart J. 2020, 41, 111–188. [Google Scholar] [CrossRef] [PubMed]
  15. Turpin, M.; Michael, J.; Perez, E.; Bowman, S.R. Language Models Don’t Always Say What They Think: Unfaithful Explanations in Chain-of-Thought Prompting. Adv. Neural Inf. Process. Syst. 2023, 36. [Google Scholar]
  16. Wilson, E.B. Probable Inference, the Law of Succession, and Statistical Inference. J. Am. Stat. Assoc. 1927, 22, 209–212. [Google Scholar] [CrossRef]
  17. Zhao, L.; Liu, S.; Xin, T.; Tan, J.; Wang, X.; Li, Y.; Bian, Z.; Chen, Y.; Kong, F.; Bian, J.; et al. AI Agent in Healthcare: Applications, Evaluations, and Future Directions. npj Artif. Intell. 2026, 2, 31. [Google Scholar] [CrossRef]
  18. Wiens, J.; Saria, S.; Sendak, M.; Ghassemi, M.; Liu, V.X.; Doshi-Velez, F.; Jung, K.; Heller, K.; Kale, D.; Saeed, M.; et al. Do No Harm: A Roadmap for Responsible Machine Learning for Health Care. Nat. Med. 2019, 25, 1337–1340. [Google Scholar] [CrossRef] [PubMed]
Figure 1. Conceptual architecture of CARDIOAGENT. The figure represents externally observable data and action flow; it does not expose or claim to represent the LLM’s private internal reasoning.
Figure 1. Conceptual architecture of CARDIOAGENT. The figure represents externally observable data and action flow; it does not expose or claim to represent the LLM’s private internal reasoning.
Preprints 223736 g001
Figure 2. Ablation study using the same base LLM across progressively more structured configurations.
Figure 2. Ablation study using the same base LLM across progressively more structured configurations.
Preprints 223736 g002
Table 1. Case-level results for the complete CARDIOAGENT architecture.
Table 1. Case-level results for the complete CARDIOAGENT architecture.
ID Clinical scenario Outcome Keywords Expected tool used Latency (s)
EVAL_01 Heart failure and SGLT2 inhibitor therapy Correct 4/4 Yes 13.1
EVAL_02 Atrial fibrillation and anticoagulation Correct 3/3 Yes 82.3
EVAL_03 Warfarin–ibuprofen interaction Correct 2/3 No 6.5
EVAL_04 CHA2DS2-VASc assessment Correct 3/3 Yes 8.1
EVAL_05 Renal function and GFR Correct 3/3 Yes 10.6
EVAL_06 Ischaemic heart disease and LDL target Correct 2/3 Yes 8.9
EVAL_07 Resistant hypertension Correct 1/2 Yes 13.4
EVAL_08 HAS-BLED assessment Correct 3/3 Yes 7.6
EVAL_09 Urgent STEMI management Correct 3/3 Yes 8.7
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

© 2026 MDPI (Basel, Switzerland) unless otherwise stated

Accessibility

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings