Introduction

With the advent of artificial intelligence (AI) models, for use by the public dominating the headlines in 2023, a fierce debate ensued about their “appropriate and inappropriate use” in academic research [1]. While the discussions mainly centre around the ethical implications of the academic writing skills of such generative AI models, it raises the question what novel opportunities generative AI presents for clinical pharmacy research [2]. As clinical pharmacy practice operates in a complex interdisciplinary healthcare system, clinical pharmacy practice research is equally complex and transdisciplinary, potentially opening up a lot of opportunity for bridging the disciplines using artifical intelligence in new ways [3]. One such potential application for artificial intelligence is the development of delirium prescribing resources across different patient groups.

Delirium as a multifactorial syndrome

Delirium is an acute disturbance in attention and cognition that is associated with significant functional decline, distress, and increased mortality [4]. It impacts up to 30% of hospitalized adults most commonly affecting patients with advanced age, cognitive decline, and medical or surgical comorbidity rising to 50–70% in mechanically ventilated patients [5, 6]. Delirium increases healthcare costs by 50% among those diagnosed with delirium superimposed on dementia (DSD) [7]. While the pathophysiology remains poorly understood, the underlying cause of delirium can involve anything that stresses the baseline homeostasis such as substance intoxication or withdrawal, medication side effects, infection, surgery, metabolic derangements, pain, or common conditions such as constipation or urinary retention [8] with 33 predisposing and 112 precipitating factors across all settings having been identified [9].

Medication-associated factors are both noted as predisposing and precipitating however, no further detail is provided that would allow the correct dosing, management, and prevention of these medication effects [10]. Published literature provides evidence that any medication that increases the anticholinergic burden, exhibits a sedative- or antimuscarinic property; precipitates a serotonin syndrome or sleep disturbances is thought to carry a substantial (cumulative) risk [11]. In addition, age related pharmacokinetic and pharmacodynamic changes as well as age related kidney and liver changes presents a risk due to the changes in drug metabolism and a possible increase in blood–brain barrier permeability [12]. To date there is no comprehensive documentation detailing the risk and use of drugs and drug classes associated with delirium providing a prescribing decision aid for clinicians. The generation of such a prescribing decision aid is the aim of the research.

Evolution of LLMs

With the advent of natural language processing (NLP) and machine learning (ML) models in healthcare since the late 1990s [13], delirium risk can now be predicted with 94.1% accuracy in geriatric internal medicines inpatients [14]. Building accurate predictive models based on logistic regression algorithm is widely used in the medical field [15] with Generative AI now offering an opportunity to augment and accompany the output compared against these logistic regression models [16, 17]. As a result, several logistic regressions, machine learning-based delirium prediction models have been developed since 2018 [18,19,20,21,22,23,24]. The minority however include medication as a predictive variable because the process of identifying predictors from among the multitude of medications in various combinations, formulations and dosages would be very complex to capture [25].

Development of a large language model (LLM) to identify medication related causes

To support the development of a comprehensive medication-related prescribing decision support application, we built a delirium specific customised large language model (LLM) based tool focused on medication related information (named DELSTAR) as a proof-of-concept. The model uses the custom function of a generative pre-trained transformer (GPT) made available by Open AI (vs.4), also known as GPT4. The proof-of-concept DELSTAR AI tool targets collections of peer reviewed papers as a source of data, using application program interfaces (APIs) where possible. APIs are a means by which one website can talk to another in a program friendly text-based data format. Plain text queries are formed, submitted and results are passed as semantic visualisations for the researcher to navigate in their pathway of inquiry. In other words, the researcher “asks” using normal language, the AI reaches out via the APIs and then “answers” using a visual map. The targeted sources include 39 internationally recognised scientific publication databases, two internationally recognised pharmacovigilance databases and two international databases detailing product characteristics. The information is presented in the form of an interactive Node Graph. Each node representing e.g. a drug class with the ambition that these can be further explored detailing drugs, context and source reference. An example of what the output node graph generated by the DELSTAR AI tool may look like is given in Fig. 1. As the information published across the 39 scientific databases is used as the source data it may be possible to identify semantic patterns between medication and other precipitating and predisposing factors as published by Ormseth (2023) [9]. Correlation to specific patient and medication related factors such as timing to exposure of medicine is limited to the reporting on the pharmacovigilance databases only. The customisation of GPT4 into DELSTAR took a matter of hours; its validation, however, will take much longer. Validation will determine how well the model captures and accurately reflects relevant information from the literature using the creation of a validation dataset, error analysis, consistency, sensitivity and specificity. Following which the model will be fine-tuned. Feedback from medical prescribers across a wide range of specialities will present the final validation step to assess its accuracy and comprehensiveness of information, relevance to practice and utility [26].

Fig. 1
figure 1

An example of what the output node graph generated by the DELSTAR AI tool may look like. Each node represents a drug class, with the ambition that each node can be further explored to detail drugs, context (symptoms, mechanism of action etc.) and source reference(s) associated with delirium. In this example, the ‘Opioid’ node has been expanded further showing different opioid drugs and key symptom associated with delirium

The output generated by DELSTAR will be compared against the information gathered across several state-of-the-art systematic reviews [submitted for publication] and the quality, completeness and accuracy of its information assessed. We are curious to learn if this approach has the potential to augment the current state-of-the-art systematic literature review process by providing the researcher with an additional semantic method of information gathering.

Implications and future directions

This proof-of-concept delirium tool shows how the advent of easily accessible generative artificial intelligence (GenAI) technology has the potential to augment clinical pharmacy practice research with relative ease to help manage and identify medication related patterns across large volumes of data [27]. This holds great promise for the development of much more comprehensive prescribing guides, practice support applications for clinical pharmacy, increased patient and prescribing safety and resultant implications for healthcare costs [28, 29]. The challenge for clinical pharmacy practice research will be to ensure its methodologically robust use and the detailed and transparent verification of its information accuracy in close collaboration with data and information-technology scientists [30].