Association of Staphylococcus aureus bloodstream infection with 7-day incident delirium in critically Ill adults: a propensity-weighted competing risk analysis Authors: Jiang-Tao Deng, Wei-Jia Kong, Pu-Heng Lu, Lei Yu, Qing-Shan Zhou, Jun Jin, Xiang-Rong Nie Published: 2026 ABSTRACT AbstractBackgroundDelirium is a frequent manifestation of acute brain dysfunction in critically ill patients with bloodstream infections (BSI). While the association between sepsis and delirium is well-established, pathogen-specific neurotoxic effects, particularly those induced by Staphylococcus aureus (S. aureus), remain inadequately elucidated. This study aimed to evaluate the independent association between S. aureus BSI and the risk of 7-day incident delirium in critically ill adults.MethodsA retrospective cohort study was conducted using the MIMIC-IV database, including 3,226 adult patients with confirmed BSI. To minimize confounding bias, a “doubly robust” estimation approach was employed, combining Inverse Probability of Treatment Weighting based on Covariate Balancing Propensity Scores (IPTW-CBPS) with multivariable adjustment. Fine-Gray proportional subdistribution hazard models were utilized to assess the association between pathogen status and 7-day delirium, accounting for death as a competing risk. Explainable machine learning using the eXtreme Gradient Boosting (XGBoost) algorithm and Shapley Additive exPlanations (SHAP) value analysis was performed to identify feature importance. Sensitivity analyses for the 3-day acute risk and methicillin-resistant Staphylococcus aureus (MRSA) phenotype were also conducted.ResultsAmong 3,226 patients, 618 (19.2%) were identified with S. aureus BSI. In the fully adjusted Fine-Gray model, compared with Gram-negative infections, S. aureus BSI was robustly and independently associated with an increased risk of 7-day incident delirium (sHR 1.39; 95% CI 1.11–1.74; p = 0.005). This association was even more pronounced within the 3-day acute window (sHR 1.60; 95% CI 1.27–2.02; p < 0.001). Conversely, compared with Gram-negative BSI, the MRSA phenotype showed no significant independent association with delirium risk (sHR 1.12; 95% CI 0.81–1.55; p = 0.488). SHAP analysis identified S. aureus infection as the fourth most influential feature for delirium, surpassing age and sedative exposure. Subgroup analyses revealed that the pathogen-specific impact was significantly more prominent in patients with lower baseline illness severity (SOFA < 5) and those without a history of dementia (P for interaction < 0.001 and 0.004, respectively). SHAP value analysis further confirmed this finding by demonstrating a higher risk contribution of S. aureus in patients with lower SOFA scores.ConclusionsS. aureus BSI is a robust independent risk factor for 7-day incident delirium compared with Gram-negative BSI, with the hazard being more pronounced within the first 3 days of infection. Notably, compared with Gram-negative BSI, the MRSA phenotype was not independently associated with delirium risk. Identifying S. aureus as a critical driver of early brain dysfunction provides a pathogen-specific framework for risk stratification. Consequently, clinicians should prioritize early neurocognitive monitoring and targeted neuroprotection (e.g. the ABCDEF bundle) for all patients with S. aureus infection.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12879-026-13704-w.Keywords: Staphylococcus aureus, Bloodstream infection, Delirium, Competing risk, MRSA, ICU management Introduction Delirium represents a frequent manifestation of acute cerebral dysfunction in critically ill patients treated in the intensive care unit (ICU) suffering from sepsis [1, 2], and is particularly pronounced in patients with bloodstream infections (BSI) [3]. Characterized by fluctuating cognitive deficits and impaired attention, this clinical syndrome serves as an independent risk factor for both increased short-term mortality [4] and persistent long-term neurocognitive impairment [5] within septic populations. As a component of sepsis-induced multiorgan failure, the brain is frequently one of the earliest systems affected—a condition clinically defined as sepsis-associated encephalopathy (SAE) [6]. Although the fundamental pathways through which systemic inflammatory responses induce neurotoxicity are well-documented [7], and the general correlation between BSI and delirium is established [8], there is a notable lack of granular research focusing on the neurotoxic variations across specific pathogens. In our routine clinical practice, we have observed that patients with Staphylococcus aureus (S. aureus) infections are more prone to developing delirium. Gram-positive cocci are capable of inducing severe toxic shock syndrome, leading to hyperthermia, hypotension, and multiorgan dysfunction [9, 10] As a primary and highly virulent driver of ICU-acquired BSI, S. aureus utilizes a potent array of exotoxins—notably alpha-hemolysin and superantigens [11]—which may directly breach the blood-brain barrier (BBB) and trigger profound neuroinflammation [12]. Nevertheless, it remains to be determined whether the magnitude and temporal patterns of acute neurocognitive impact from S. aureus BSI differ substantially from other pathogens in real-world clinical practice. Furthermore, the influence of the methicillin-resistant S. aureus (MRSA) phenotype on delirium risk remains a point of clinical uncertainty. While MRSA is associated with greater therapeutic complexity [13] it remains unclear whether the resistance phenotype itself independently exacerbates delirium risk. To bridge these knowledge gaps, we performed a large-scale retrospective cohort analysis utilizing the Medical Information Mart for Intensive Care IV (MIMIC-IV) database. Our primary goal was to quantify the independent association between S. aureus BSI and 7-day incident delirium in critically ill adults. We implemented a rigorous statistical methodology, employing Inverse Probability of Treatment Weighting via Covariate Balancing Propensity Scores (IPTW-CBPS) to control for selection bias, and Fine-Gray proportional subdistribution hazard models to address the competing risk of death. By specifically examining the acute 7-day risk window and the role of the MRSA phenotype, this study seeks to provide a pathogen-specific framework for risk stratification, ultimately refining clinical decision-making for early neuroprotective strategies in patients with BSI. Methods Data source This retrospective cohort analysis leveraged clinical data extracted from the MIMIC-IV database (version 3.1), encompassing comprehensive records of patients treated at Beth Israel Deaconess Medical Center between 2008 and 2019. To maintain patient confidentiality, all personal identifiers were thoroughly de-identified. Consequently, the study was granted an exemption from formal ethical review and informed consent. Access to the dataset was officially authorized following the investigator’s (Deng) completion of the mandatory data usage certification (No. 61,424,658). Study population BSI was defined as the presence of pathogenic bacteria isolated from blood culture. Microbiological data were extracted from the microbiologyevents table. To ensure diagnostic accuracy and exclude potential contamination (e.g., coagulase-negative Staphylococci, Corynebacterium), we adhered to the Centers for Disease Control and Prevention (CDC) criteria requiring at least two separate positive cultures within 48 hours for common skin commensals. Subsequently, specific pathogens were identified, with a particular focus on S. aureus and MRSA. Delirium was assessed using the Confusion Assessment Method for the ICU (CAM-ICU), which remains the primary validated screening tool for critically ill adults according to the 2025 Focused Update to the PADIS (now PAADIS) guidelines [14]. The CAM-ICU evaluates four domains: (1) acute onset or fluctuating course, (2) inattention, (3) disorganized thinking, and (4) altered level of consciousness. A diagnosis of delirium required the presence of both domains 1 and 2, together with either domain 3 or 4. Information on delirium assessment was extracted from the chartevents table in MIMIC-IV. Specifically, delirium cases were identified based on recorded values of “Positive” or “Yes” under ItemIDs 228,303 and 228,332. The patient selection process is shown in Fig. 1. A total of 34,595 patients with positive blood cultures were initially screened from the MIMIC-IV database. We excluded patients based on the following criteria: (1) contaminated blood cultures (n = 3,163); (2) non-ICU admission or repeat ICU admissions (n = 26,517); and (3) age < 18 years (n = 0). This resulted in 4,915 patients with a confirmed first episode of BSI. Subsequently, 1,689 patients were excluded: 411 with pre-existing delirium at the time of blood culture collection (Table S2) and 1,278 with missing delirium assessment data among 7-day survivors (Table S1). The final study cohort comprised 3,226 patients, who were classified into four groups based on pathogen type: the S. aureus group (n = 618), the other Gram-positive group (n = 904), the Gram-negative group (n = 1,092), and the others/mixed group (n = 612). Flowchart of study participant selection. Detailed screening process showing inclusion and exclusion criteria for patients with bloodstream infection (BSI) from the MIMIC-IV database. The final cohort was categorized into four groups based on pathogen type: the S. aureus group, other Gram-positive group, Gram-negative group, and Others/Mixed group. Abbreviations: BSI, bloodstream infection; ICU, intensive care unit; MIMIC-IV, Medical Information Mart for Intensive Care IV; S. aureus, Staphylococcus aureus MRSA-Specific Cohort Construction. In addition to the primary cohort, an independent sub-cohort was constructed to evaluate the impact of the methicillin-resistance phenotype on incident delirium. Importantly, this MRSA-specific cohort was not derived from a simple re-classification of the primary cohort. The index event required not only a confirmed S. aureus positive blood culture but also documented antimicrobial susceptibility testing (AST) records demonstrating resistance to oxacillin, cefoxitin, or methicillin (interpretation = “R”). Patients with S. aureus BSI who lacked complete AST documentation were therefore not reclassified as methicillin-susceptible S. aureus (MSSA) into the Other Gram-positive group; instead, depending on their remaining microbiological profile, they were either reclassified into the Others/Mixed group or excluded entirely. Data extraction and processing Variable Extraction. All clinical and laboratory data were comprehensively extracted from the MIMIC-IV database. The index time (Day 0) was strictly defined as the time of the first positive blood culture collection, rather than the time of microbiological report notification, to accurately capture the baseline clinical status at the onset of infection. Baseline characteristics comprised patient demographics (age, sex) and major comorbidities, including diabetes mellitus, hypertension, heart failure, chronic kidney disease, and chronic obstructive pulmonary disease (COPD). To adjust for pre-existing cognitive impairment, a history of dementia was identified using relevant ICD diagnosis codes. The severity of illness was measured using the Sequential Organ Failure Assessment (SOFA) score and Glasgow Coma Scale (GCS) score at the time of blood culture collection. A broad set of laboratory indicators was retrieved within the 24-hour window surrounding this index time, grouped into: (1) Hematology: white blood cell (WBC) count, hemoglobin, platelets, and red cell indices (MCV, MCHC, RDW); (2) Biochemistry and Electrolytes: sodium, potassium, chloride, bicarbonate, blood urea nitrogen (BUN), creatinine, glucose, magnesium, phosphate, total calcium, and lactate; (3) Liver Profiles: ALT, AST, and alkaline phosphatase; (4) Coagulation Profiles: PT, PTT, and INR; (5) Arterial Blood Gas: pH, pO2, and pCO2. To evaluate iatrogenic precipitating factors, data on the administration of vasoactive agents, sedatives, and mechanical ventilation were specifically extracted. Additionally, antibiotic-related variables, including the timing of effective therapy (relative to the culture collection time) and antibiotic type, were included as key covariates in the multivariable models. Data Preprocessing. During the initial SQL-based data extraction phase, records were rigorously screened for physiological plausibility; outliers were filtered using predefined clinical ranges to preserve valid extreme physiological states while excluding erroneous data entries. Following extraction, variables with a missingness rate exceeding 20% were removed (Figure S1). To mitigate multicollinearity, a hierarchical screening approach was implemented: first, for variable pairs with a Pearson correlation coefficient |r| >0.70, the more redundant feature was excluded (Figure S2); second, a stepwise elimination procedure was applied until all remaining variables reached a variance inflation factor (VIF) <5 (Table S3). Finally, remaining missing values were addressed via Multiple Imputation by Chained Equations (MICE) across five iterations, ensuring the stability and completeness of the final analytical cohort. Covariate selection Covariates for the multivariable Fine-Gray proportional subdistribution hazard models were determined using a hybrid approach combining data-driven machine learning with clinical expertise. First, to identify robust features from high-dimensional data, we implemented a dual-feature selection strategy utilizing two distinct algorithms: (1) Least Absolute Shrinkage and Selection Operator (LASSO) regression with 10-fold cross-validation to select a parsimonious set of features based on an optimal tuning parameter, and (2) the Boruta algorithm, a random forest-based method, to identify all relevant features. Variables identified by the intersection of both algorithms were retained for analysis. Second, to ensure clinical interpretability, established confounders—including demographics (age and sex), clinical history (dementia and prior surgery), life-support interventions (mechanical ventilation, vasoactive agent use, and sedative exposure), and infection-specific characteristics (infection site, antibiotic timing, and antibiotic type)—were forced into the final models a priori, irrespective of their algorithmic selection status. Statistical analysis Descriptive Statistics. Continuous variables were assessed for normality using the Shapiro–Wilk test. Non-normally distributed variables were presented as medians with interquartile ranges [IQRs] and compared between groups using the Mann–Whitney U test. Categorical variables were expressed as counts and percentages, compared using the Chi-square test. Standardized mean differences (SMDs) were calculated to assess covariate balance across the four pathogen groups, with values < 0.1 indicating negligible imbalance. Competing Risk Analysis. Considering death as a competing risk for delirium, the cumulative incidence of delirium was estimated using the Cumulative Incidence Function (CIF), and differences between groups were assessed using Gray’s test. To minimize confounding bias, IPTW was applied using the CBPS method. IPTW-adjusted multivariable Fine-Gray proportional subdistribution hazard models were constructed to evaluate the independent association between pathogen status and delirium risk. Three models were formulated: (1) Model 1: Unadjusted; (2) Model 2: Adjusted for age and sex; and (3) Model 3: Fully adjusted for a comprehensive suite of candidate covariates, including demographics, baseline comorbidities, acute illness severity, and therapeutic interventions. Results were reported as subdistribution hazard ratios (SHRs) with 95% confidence intervals (CIs). Subgroup analyses were conducted across clinically relevant strata to evaluate the consistency of the findings. Machine Learning and Model Interpretability. To further elucidate the predictive importance and non-linear associations of clinical features, an eXtreme Gradient Boosting (XGBoost) machine learning model was developed. The model’s interpretability was enhanced using Shapley Additive exPlanations (SHAP) values. Specifically, SHAP summary plots were utilized to rank clinical features based on their mean absolute SHAP values, representing their global predictive importance for incident delirium. Additionally, SHAP dependence plots were used to examine how specific features interacted with other clinical covariates to influence the risk of incident delirium. All analyses were performed using R software (version 4.4.1; R Foundation for Statistical Computing, Vienna, Austria), with a two-tailed p-value < 0.05 considered statistically significant. Results Baseline characteristics Comparison between Included and Excluded Patients. Of the 4,504 patients initially screened, 1,278 were excluded (due to missing delirium assessments), leaving 3,226 for the final analysis. As detailed in Table S1, the excluded cohort exhibited higher baseline illness severity than those included, characterized by higher SOFA scores (7.12 ± 4.33 vs. 6.01 ± 3.73), lower GCS scores (12.84 ± 3.52 vs. 13.58 ± 2.61), and higher 7-day Competing Mortality rate (36.3% vs. 15.6%; all p < 0.001). Consistently, the excluded patients required more intensive clinical support, including higher rates of mechanical ventilation (39.0% vs. 27.2%) and sedation use (50.2% vs. 36.6%) compared to the included cohort. While the included group showed a slightly higher prevalence of certain comorbidities, age and sex distributions remained balanced between the two groups. These findings indicate that the final analytical cohort represents a relatively less severe subset of the initial population, likely because the most critically ill patients were ineligible for delirium assessment due to deep sedation, rapid clinical deterioration, or early mortality. A total of 3,226 patients with BSI were included in the final analysis. Among them, 618 (19.2%) were identified with S. aureus bacteremia, while 904 (28.0%), 1,092 (33.8%), and 612 (19.0%) were identified with other Gram-positive, Gram-negative, and others/mixed infections, respectively. The baseline characteristics of the study population stratified by pathogen type are summarized in Table 1. Table 1Baseline characteristics of patients with bloodstream infection stratified by pathogen typeVariableS. aureus (n = 618)Other Gram-Positive (n = 904)Gram-Negative (n = 1092)Others/Mixed (n = 612)p-valueSMDDemographicsAge, years65.26 [53.14, 76.93]66.40 [56.01, 76.71]70.02 [59.25, 80.10]67.70 [56.16, 76.79]<0.0010.176Male sex, n (%)369 (59.7)526 (58.2)604 (55.3)348 (56.9)0.3120.049Comorbidities, n (%)Hypertension176 (28.5)310 (34.3)379 (34.7)200 (32.7)0.0490.073Diabetes mellitus240 (38.8)359 (39.7)394 (36.1)192 (31.4)0.0060.097Heart failure232 (37.5)323 (35.7)282 (25.8)186 (30.4)<0.0010.146Chronic kidney disease160 (25.9)210 (23.2)265 (24.3)136 (22.2)0.4580.047COPD57 (9.2)77 (8.5)90 (8.2)79 (12.9)0.010.08History of dementia31 (5.0)57 (6.3)70 (6.4)38 (6.2)0.6750.031Clinical Characteristics & ScoresVasoactive agent use, n (%)219 (35.4)321 (35.5)507 (46.4)164 (26.8)<0.0010.207Sedative exposure, n (%)250 (40.5)361 (39.9)352 (32.2)218 (35.6)0.0010.101Mechanical ventilation, n (%)184 (29.8)280 (31.0)257 (23.5)155 (25.3)0.0010.1Prior surgery, n (%)159 (25.7)285 (31.5)375 (34.3)208 (34.0)0.0020.103SOFA score6.00 [3.00, 8.00]5.00 [3.00, 8.00]6.00 [4.00, 9.00]6.00 [3.00, 8.00]<0.0010.13GCS score15.00 [13.00, 15.00]15.00 [14.00, 15.00]15.00 [14.00, 15.00]15.00 [13.00, 15.00]0.4260.067Infection Site, n (%)<0.0010.459Primary BSI189 (30.6)318 (35.2)343 (31.4)250 (40.8)Respiratory223 (36.1)291 (32.2)220 (20.1)201 (32.8)Urinary69 (11.2)160 (17.7)361 (33.1)61 (10.0)Intra-abdominal41 (6.6)73 (8.1)118 (10.8)69 (11.3)SSTI58 (9.4)38 (4.2)26 (2.4)17 (2.8)Other/Mixed38 (6.1)24 (2.7)24 (2.2)14 (2.3)Antibiotic Therapy, n (%)Timing<0.0010.292Timely (≤6 h)200 (32.4)302 (33.4)346 (31.7)215 (35.1)Delayed (>6 h)345 (55.8)447 (49.4)661 (60.5)246 (40.2)No timely Abx (24 h)73 (11.8)155 (17.1)85 (7.8)151 (24.7)Type<0.0010.375Vancomycin239 (38.7)258 (28.5)230 (21.1)134 (21.9)Beta-lactams124 (20.1)202 (22.3)268 (24.5)128 (20.9)Other Antibiotics182 (29.4)289 (32.0)509 (46.6)199 (32.5)None73 (11.8)155 (17.1)85 (7.8)151 (24.7)Laboratory FindingsWBC, ×109/L14.07 [9.80, 19.23]12.03 [8.15, 17.07]13.80 [8.75, 19.85]12.07 [8.15, 17.30]<0.0010.136Hemoglobin, g/dL10.10 [8.60, 11.46]9.95 [8.47, 11.65]10.30 [8.63, 11.78]9.46 [8.10, 11.38]<0.0010.09Platelets, ×109/L168.58 [103.06, 262.00]189.17 [119.50, 269.00]156.00 [106.25, 218.50]187.75 [112.60, 276.70]<0.0010.165MCV, fL91.00 [86.00, 96.31]92.50 [87.50, 97.00]92.00 [87.50, 96.67]92.50 [88.12, 97.50]0.0030.1MCHC, g/dL32.25 [31.25, 33.39]32.28 [31.25, 33.27]32.50 [31.50, 33.51]32.27 [31.13, 33.34]<0.0010.103RDW, %15.54 [14.13, 17.31]15.45 [14.00, 17.52]15.36 [14.07, 17.35]15.85 [14.20, 18.16]0.030.086Glucose, mg/dL133.25 [108.70, 178.15]133.54 [110.67, 172.18]129.00 [106.00, 165.25]134.00 [109.92, 165.93]0.0290.078Sodium, mmol/L135.67 [132.43, 139.00]137.78 [134.50, 141.00]137.25 [134.00, 140.00]137.50 [134.48, 140.50]<0.0010.188Potassium, mmol/L4.20 [3.83, 4.70]4.15 [3.83, 4.58]4.08 [3.76, 4.50]4.17 [3.85, 4.67]<0.0010.117Bicarbonate, mmol/L21.50 [18.75, 24.33]22.33 [19.38, 25.50]20.90 [18.00, 23.50]22.00 [18.48, 24.67]<0.0010.207Anion gap, mmol/L15.67 [13.50, 18.50]15.00 [12.80, 17.21]15.83 [13.67, 18.50]14.78 [12.50, 17.92]<0.0010.155BUN, mg/dL32.00 [19.00, 53.94]26.21 [16.67, 43.81]28.00 [17.75, 43.00]26.67 [17.00, 47.00]<0.0010.138Creatinine, mg/dL1.45 [0.92, 2.76]1.23 [0.85, 1.90]1.37 [0.90, 2.18]1.21 [0.82, 2.00]<0.0010.165Magnesium, mg/dL2.00 [1.80, 2.19]2.00 [1.82, 2.17]1.90 [1.70, 2.10]2.01 [1.88, 2.20]<0.0010.233Phosphate, mg/dL3.57 [2.74, 4.55]3.48 [2.80, 4.20]3.27 [2.65, 4.00]3.57 [2.90, 4.39]<0.0010.155Total Calcium, mg/dL8.20 [7.73, 8.70]8.35 [7.85, 8.80]8.15 [7.65, 8.57]8.33 [7.82, 8.84]<0.0010.163Lactate, mmol/L2.00 [1.45, 2.90]2.00 [1.40, 2.90]2.42 [1.80, 3.60]2.10 [1.50, 3.07]<0.0010.167Total Bilirubin, mg/dL0.82 [0.50, 1.50]0.80 [0.42, 1.60]1.05 [0.60, 2.63]0.84 [0.49, 1.90]<0.0010.139ALT, U/L25.25 [16.00, 49.00]27.50 [17.00, 59.67]36.08 [18.88, 82.25]28.25 [16.00, 62.75]<0.0010.028Alkaline Phosphatase, U/L105.42 [77.00, 162.12]103.00 [72.00, 168.00]120.25 [80.00, 239.62]107.67 [74.00, 168.25]<0.0010.17pH7.34 [7.23, 7.41]7.34 [7.24, 7.41]7.33 [7.22, 7.40]7.34 [7.24, 7.41]0.1780.056PT, seconds15.54 [13.60, 19.65]14.84 [12.95, 18.50]15.42 [13.50, 19.51]15.75 [13.24, 20.80]0.0010.044PTT, seconds32.17 [28.45, 40.70]32.30 [28.14, 41.02]32.59 [28.49, 39.66]33.55 [28.94, 45.86]0.0070.094Outcomes, n (%)7-day Competing Mortality125 (20.2)86 (9.5)100 (9.2)193 (31.5)<0.0010.347-day Delirium (Incident)301 (48.7)389 (43.0)386 (35.3)279 (45.6)<0.0010.381Notes: Data are presented as medians [interquartile ranges, IQRs] for continuous variables and n (%) for categorical variables. p-values were calculated using the Kruskal-Wallis test for continuous variables and the Chi-square test for categorical variables. Standardized Mean Difference (SMD) represents the magnitude of differences between groups; an SMD > 0.1 indicates a meaningful imbalance. Prior surgery was defined as major surgical procedures performed within 3 days prior to the index date (blood culture collection). Antibiotic timing was defined as the duration from the initial blood culture collection to the first administration of effective antibiotic therapy, categorized as Timely (≤6 h), Delayed (>6 h), or No timely Abx (no record of effective therapy within 24 h). Antibiotic type was categorized based on the spectrum and pharmacologic class. Abbreviations: ALT, alanine aminotransferase; BUN, blood urea nitrogen; COPD, chronic obstructive pulmonary disease; GCS, Glasgow Coma Scale; MCHC, mean corpuscular hemoglobin concentration; MCV, mean corpuscular volume; PT, prothrombin time; PTT, partial thromboplastin time; RDW, red cell distribution width; SOFA, Sequential Organ Failure Assessment; SSTI, skin and soft tissue infection; WBC, white blood cell Baseline characteristics of patients with bloodstream infection stratified by pathogen type Notes: Data are presented as medians [interquartile ranges, IQRs] for continuous variables and n (%) for categorical variables. p-values were calculated using the Kruskal-Wallis test for continuous variables and the Chi-square test for categorical variables. Standardized Mean Difference (SMD) represents the magnitude of differences between groups; an SMD > 0.1 indicates a meaningful imbalance. Prior surgery was defined as major surgical procedures performed within 3 days prior to the index date (blood culture collection). Antibiotic timing was defined as the duration from the initial blood culture collection to the first administration of effective antibiotic therapy, categorized as Timely (≤6 h), Delayed (>6 h), or No timely Abx (no record of effective therapy within 24 h). Antibiotic type was categorized based on the spectrum and pharmacologic class. Abbreviations: ALT, alanine aminotransferase; BUN, blood urea nitrogen; COPD, chronic obstructive pulmonary disease; GCS, Glasgow Coma Scale; MCHC, mean corpuscular hemoglobin concentration; MCV, mean corpuscular volume; PT, prothrombin time; PTT, partial thromboplastin time; RDW, red cell distribution width; SOFA, Sequential Organ Failure Assessment; SSTI, skin and soft tissue infection; WBC, white blood cell Patients in the S. aureus group were significantly younger than those in the other groups (median age: 65.26 years vs. a range of 66.40–70.02 years across other groups; p < 0.001). Regarding comorbidities, the prevalence of heart failure was highest in the S. aureus group (37.5%, p < 0.001), whereas hypertension was least common in this group (28.5%, p = 0.049). Significant differences across groups were also observed for diabetes mellitus (p = 0.006) and COPD (p = 0.01). Infection Site and Antibiotic Therapy. The primary source of infection varied significantly by pathogen type (p < 0.001). The S. aureus group predominantly originated from respiratory (36.1%) and primary bloodstream infections (30.6%), with a notably higher prevalence of skin and soft tissue infections (SSTI, 9.4%) compared to other cohorts. Conversely, urinary tract infections were most frequent in the Gram-negative group (33.1%). Regarding antibiotic therapy, both the timing and type of initial treatment showed significant imbalances (p < 0.001). Delayed therapy (>6 h) was most common in the Gram-negative cohort (60.5%), while the others/mixed group had the highest rate of no timely antibiotic administration within 24 h (24.7%). As expected, vancomycin was most frequently utilized in the S. aureus group (38.7%), while beta-lactams were evenly distributed across groups. Clinical Status and Laboratory Findings. At the time of BSI diagnosis, the SOFA score differed significantly across groups (median 6.00 for S. aureus vs. 5.00 for other Gram-positive; p < 0.001), although the GCS score remained consistent (median 15.00; p = 0.426). Patients in the S. aureus group had the highest rate of sedative exposure (40.5%) and a high prevalence of mechanical ventilation (29.8%). Laboratory analyses highlighted that the S. aureus group exhibited the most pronounced inflammatory and renal stress, with significantly higher WBC (median 14.07 × 109 /L, p < 0.001), serum creatinine (median 1.45 mg/dL, p < 0.001), and BUN (median 32.00 mg/dL, p < 0.001). Electrolyte disturbances were also more evident, specifically lower serum sodium levels (median 135.67 mmol/L, p < 0.001). Conversely, the Gram-negative group showed higher levels of lactate (2.42 mmol/L). Clinical Outcomes. The incident delirium rate within 7 days was highest in the S. aureus group (48.7%), significantly surpassing the Gram-negative group (35.3%; p < 0.001). Additionally, the S. aureus group faced a high 7-day mortality rate (20.2%), although the highest mortality was observed in the others/mixed group (31.5%; p < 0.001). Cumulative incidence of delirium To account for mortality as a competing event, we estimated the probability of delirium using the CIF. As illustrated in Fig. 2A, the cumulative incidence curves among the four pathogen groups diverged early (Gray’s test p < 0.001). The S. aureus group exhibited a consistently steeper trajectory and the highest 7-day cumulative incidence compared to the other three groups (Other Gram-positive, Gram-negative, and Others/Mixed). The accompanying number-at-risk table details the progressive attrition of the study population; despite the high event rate, a sufficient number of patients remained at risk across all groups to ensure robust estimation throughout the 7-day observation window. These findings confirm that S. aureus infection is associated with an accelerated and increased risk of delirium onset during the acute phase of BSI. Cumulative incidence of delirium stratified by pathogen groups. (A) cumulative incidence functions (CIF) showing the probability of developing delirium within 7 days stratified by four pathogen groups: S. aureus (red line, n = 618), other Gram-positive (purple line, n = 904), Gram-negative (blue line, n = 1092), and Others/Mixed (green line, n = 612). (B) cumulative incidence functions stratified by MRSA phenotype and other pathogens: MRSA (red line, n = 218), other Gram-positive (purple line, n = 919), Gram-negative (blue line, n = 1088), and Others/Mixed groups (green line, n = 932). In both panels, death was treated as a competing event to accurately estimate the sub-distribution probability of incident delirium. Significant differences between the pathogen groups were confirmed using Gray’s test (p < 0.001 for both panels). The tables below the x-axis (number at risk) display the number of patients remaining at risk at each daily interval, accounting for event occurrence and censoring. MRSA, methicillin-resistant Staphylococcus aureus Further analysis stratified by methicillin resistance also yielded significant results (Fig. 2B). The MRSA cohort (n = 218) showed a markedly elevated cumulative incidence of delirium, similar to the trajectory of the Others/Mixed group, and both were substantially higher than the Gram-negative and Other Gram-positive groups (Gray’s test p < 0.001). The curves separated promptly following infection confirmation, with the disparity widening over the 7-day period. These results indicate that the presence of methicillin-resistant strains contributes to the high risk of developing acute brain dysfunction in this population. Covariate balance and propensity score distribution To minimize the impact of potential selection bias and confounding factors across the four pathogen groups, we employed multinomial IPTW-CBPS weighting. A comprehensive set of baseline covariates was incorporated into the weighting model, including demographics (age, sex), comorbidities (hypertension, diabetes mellitus, heart failure, chronic kidney disease, COPD, and history of dementia), and acute clinical characteristics (SOFA score, GCS score, vasoactive agent use, sedative exposure, mechanical ventilation, and prior surgery). Additionally, high-order clinical features including infection sites, antibiotic timing, and antibiotic types were included to ensure rigorous confounding control. Laboratory findings (hematology, biochemistry, electrolytes, and coagulation parameters) were also adjusted. The covariate balance before and after weighting is illustrated in the Love plots (Fig. 3A for the total S. aureus cohort and Fig. 3C for the MRSA-specific cohort). We used the maximum pairwise absolute standardized mean difference (ASMD) to evaluate balance across all treatment pairs. In the unadjusted cohorts, severe imbalances were observed, particularly in infection sites, antibiotic regimens, and treatment timing, with maximum ASMDs exceeding 0.6 (blue dots). Following the application of IPTW-CBPS weighting, exceptional balance was achieved across all covariates, with all adjusted maximum ASMDs reduced to near zero (red dots), well below the 0.1 threshold. Covariate balance and generalized propensity score distribution across pathogen cohorts. Left panels (A, C) present love plots illustrating the maximum pairwise absolute standardized mean differences (ASMD) for baseline covariates before (blue) and after (red) IPTW-CBPS weighting in the total S. aureus cohort and MRSA-specific cohort, respectively. The dashed vertical line indicates the 0.1 threshold for clinical balance. Right panels (B, D) display density plots showing the overlap of multinomial propensity scores (probability of being in the S. aureus or MRSA group) across the four pathogen groups after weighting. Abbreviations: IPTW-CBPS, Inverse probability of treatment weighting based on Covariate Balancing propensity Score; ASMD, absolute standardized mean Difference; MRSA, methicillin-resistant Staphylococcus aureus; SOFA, Sequential Organ failure Assessment; GCS, Glasgow Coma Scale Furthermore, the generalized propensity score density plots (Figs. 3B and 3D) demonstrated extensive overlap and common support among the four groups (S. aureus/MRSA, Other Gram-positive, Gram-negative, and Others/Mixed). This confirms the robustness of the IPTW-CBPS model, ensuring that the weighted pseudo-populations were highly comparable across all pathogen groups for the subsequent competitive risk. Variable selection for multivariable analysis To ensure the robustness and predictive performance of the Fine-Gray sub-distribution hazard model, we implemented a structured feature selection strategy integrating machine learning algorithms with clinical expertise. This approach facilitated dimensionality reduction among the candidate variables, identifying the most predictive factors while adhering to the Events Per Variable (EPV) criterion. Total S. aureus Cohort. In the primary cohort, the Boruta algorithm identified 24 variables as “Confirmed” features (Fig. 4C left). Simultaneously, LASSO regression was performed for regularization. At an optimal penalty level of log(lambda) = −3.5 (Fig. 4A left), the coefficient profiles were constrained to yield the most stable features (Fig. 4B left). The intersection of the Boruta and LASSO analyses converged on 10 core variables: GCS score, mechanical ventilation, SOFA score, sodium, BUN, history of dementia, MCHC, pathogen category, infection site, and COPD (Fig. 4D left). Identification of key features for incident delirium through a synergistic machine learning approach using Boruta and LASSO algorithms. Left panels represent the total S. aureus Cohort; right panels represent the MRSA-specific cohort. (A) LASSO regression cross-validation results, illustrating the relationship between binomial deviance and log(λ). The vertical blue dashed line represents the manually selected λ for optimal feature parsimony. (B) LASSO coefficient solution paths; the vertical red dashed line indicates the variables retained at the selected λ. (C) Boruta algorithm results, displaying confirmed features ranked by their mean importance (Z-score). (D) venn diagrams showing the intersection of features selected by both Boruta (blue) and LASSO (orange). Features within the intersection (10 variables for the total cohort and 6 for the MRSA cohort) were prioritized for final model adjustments to ensure methodological rigor. Abbreviations: LASSO, least absolute shrinkage and selection Operator; MRSA, methicillin-resistant Staphylococcus aureus Furthermore, based on clinical consensus and established risk factors for delirium (e.g., the PADIS guidelines [15]), age, male sex, vasoactive agent use, and sedative exposure were forced into the final multivariable model as mandatory adjusters. To further address potential treatment bias, prior surgery, antibiotic timing, and antibiotic type were also incorporated. Consequently, the refined Fine-Gray model for the total cohort adjusted for 17 covariates in total, ensuring a rigorous control of both baseline and treatment-related confounders. MRSA Cohort (independent dataset). A congruent selection strategy was applied to the MRSA cohort. The Boruta algorithm confirmed 24 candidate variables (Fig. 4C right), while LASSO regression at log(lambda) = −3.0 identified a concise set of features (Figs. 4A and 4B right). The intersection analysis identified 6 core variables: infection site, MCHC, history of dementia, SOFA score, mechanical ventilation, and GCS score (Fig. 4D right). Consistent with the primary methodology, age, male sex, vasoactive agent use, and sedative exposure were included as mandatory clinical adjusters, alongside prior surgery and antibiotic parameters. The final Fine-Gray model for the MRSA subgroup incorporated 13 covariates, maintaining model parsimony and robust statistical inference while ensuring comprehensive adjustment for the specific clinical profile of MRSA patients. Association between pathogen category and delirium Fine-Gray Regression Analysis for 7-Day Delirium. To evaluate the independent impact of pathogen category on the development of delirium, we employed Fine-Gray sub-distribution hazard models with Gram-negative infection as the reference group (Table 2). Table 2Fine-Gray regression analyses of the association between pathogen category and delirium in patients with bloodstream infectionsVariablesModel 1 sHR (95% CI)p-valueModel 2 sHR (95% CI)p-valueModel 3 sHR (95% CI)p-value7-day deliriumGram-negative infection1 (Reference)–1 (Reference)–1 (Reference)–S. aureus infection1.45 (1.17–1.78)<0.0011.44 (1.17–1.78)<0.0011.39 (1.11–1.74)0.005Other Gram-positive infection1.25 (1.06–1.48)0.0091.25 (1.06–1.49)0.0091.29 (1.08–1.53)0.004Others/Mixed infection1.08 (0.89–1.32)0.4361.09 (0.89–1.33)0.41.09 (0.90–1.32)0.3913-day deliriumGram-negative infection1 (Reference)–1 (Reference)–1 (Reference)–S. aureus infection1.65 (1.33–2.05)<0.0011.65 (1.33–2.05)<0.0011.60 (1.27–2.02)<0.001Other Gram-positive infection1.26 (1.04–1.52)0.0161.26 (1.04–1.52)0.0161.30 (1.07–1.57)0.007Others/Mixed infection1.10 (0.89–1.36)0.3851.11 (0.89–1.37)0.3581.09 (0.88–1.34)0.441Model 1: UnadjustedModel 2: Adjusted for age and sexModel 3: Adjusted for age, sex, COPD, history of dementia, sedative exposure, vasoactive drug use, SOFA score, GCS score, sodium, MCHC, BUN, mechanical ventilation, prior surgery, infection site, antibiotic timing, and antibiotic typeAbbreviations: BUN, blood urea nitrogen; CI, confidence interval; COPD, chronic obstructive pulmonary disease; GCS, Glasgow Coma Scale; Gram-neg, Gram-negative; Gram-pos, Gram-positive; MCHC, mean corpuscular hemoglobin concentration; S. aureus, Staphylococcus aureus; sHR, subdistribution hazard ratio; SOFA, Sequential Organ Failure Assessment Fine-Gray regression analyses of the association between pathogen category and delirium in patients with bloodstream infections Model 1: Unadjusted Model 2: Adjusted for age and sex Model 3: Adjusted for age, sex, COPD, history of dementia, sedative exposure, vasoactive drug use, SOFA score, GCS score, sodium, MCHC, BUN, mechanical ventilation, prior surgery, infection site, antibiotic timing, and antibiotic type Abbreviations: BUN, blood urea nitrogen; CI, confidence interval; COPD, chronic obstructive pulmonary disease; GCS, Glasgow Coma Scale; Gram-neg, Gram-negative; Gram-pos, Gram-positive; MCHC, mean corpuscular hemoglobin concentration; S. aureus, Staphylococcus aureus; sHR, subdistribution hazard ratio; SOFA, Sequential Organ Failure Assessment Unadjusted Analysis: In the unadjusted model (Model 1), S. aureus infection was associated with the highest risk of delirium within 7 days (sHR 1.45; 95% CI 1.17–1.78; p < 0.001). Other Gram-positive infections also showed an increased risk (sHR 1.25; 95% CI 1.06–1.48; p = 0.009). Adjusted Analysis: After adjusting for age and sex in Model 2, these associations remained stable for both S. aureus (sHR 1.44; 95% CI 1.17–1.78; p < 0.001) and other Gram-positive groups (sHR 1.25; 95% CI 1.06–1.49; p = 0.009). Fully Adjusted Model: In the fully adjusted model (Model 3), which accounted for comorbidities (COPD, dementia), clinical severity (SOFA, GCS), laboratory parameters (sodium, BUN, MCHC), and treatment-related factors (sedative exposure, vasoactive support, mechanical ventilation, prior surgery, infection site, and antibiotic therapy), S. aureus infection remained a robust independent risk factor for 7-day delirium (sHR 1.39; 95% CI 1.11–1.74; p = 0.005). Other Gram-positive infections also maintained significance (sHR 1.29; 95% CI 1.08–1.53; p = 0.004). Sensitivity Analysis on the Acute Impact of Pathogen Category. To further validate our findings and explore the acute neurocognitive sequelae of infection, we conducted a sensitivity analysis focusing on the 3-day delirium incidence. The observed associations were notably more pronounced during this early phase. Compared to Gram-negative infections, S. aureus infection was associated with a 65% increased risk of acute delirium in the unadjusted model (sHR 1.65; 95% CI 1.33–2.05; p < 0.001). This relationship remained highly robust even after rigorous adjustment in Model 3, where patients with S. aureus bloodstream infections exhibited a significantly higher hazard for acute delirium (sHR 1.60; 95% CI 1.27–2.02; p < 0.001). The consistency between the primary 7-day analysis and this 3-day sensitivity analysis—specifically the substantially higher sHR (1.60 vs. 1.39) observed within the narrower 3-day window—underscores the critical and immediate role of S. aureus in precipitating acute-phase neurocognitive dysfunction among critically ill patients. Association between pathogen category and delirium in the MRSA-Specific cohort Of note, this sub-analysis was conducted in an independently extracted MRSA-specific cohort (N = 3,157), which differs in composition from the primary cohort (N = 3,226). As detailed in the Methods (MRSA-Specific Cohort Construction), this cohort required confirmed AST records to define the MRSA group, and S. aureus patients lacking complete AST documentation were not reclassified as MSSA but were either re-assigned to the Others/Mixed group or excluded. Consequently, the comparator groups in Table 3 (Other Gram-positive: N = 919; Others/Mixed: N = 932) are systematically different from those in Table 2, and this compositional shift—rather than instability in the underlying biological signal—accounts for the change in the effect estimate observed for the Others/Mixed group between the two analyses. Table 3Fine-Gray regression analyses of the association between pathogen category and delirium in the MRSA-Specific cohortVariablesModel 1 sHR (95% CI)p-valueModel 2 sHR (95% CI)p-valueModel 3 sHR (95% CI)p-value7-day deliriumGram-negative infection1 (Reference)–1 (Reference)–1 (Reference)–MRSA infection1.15 (0.83–1.58)0.4111.15 (0.83–1.58)0.3971.12 (0.81–1.55)0.488Other Gram-positive infection1.21 (1.02–1.43)0.0321.21 (1.02–1.44)0.0311.21 (1.02–1.43)0.026Others/Mixed infection1.27 (1.07–1.51)0.0081.27 (1.07–1.52)0.0071.25 (1.06–1.49)0.01Model 1: UnadjustedModel 2: Adjusted for age and sexModel 3: Adjusted for age, sex, sedative exposure, vasoactive drug use, MCHC, history of dementia, SOFA score, GCS score, mechanical ventilation, prior surgery, infection site, antibiotic timing, and antibiotic typeAbbreviations: CI, confidence interval; GCS, Glasgow Coma Scale; Gram-neg, Gram-negative; Gram-pos, Gram-positive; MCHC, mean corpuscular hemoglobin concentration; MRSA, Methicillin-resistant Staphylococcus aureus; sHR, subdistribution hazard ratio; SOFA, Sequential Organ Failure Assessment Fine-Gray regression analyses of the association between pathogen category and delirium in the MRSA-Specific cohort Model 1: Unadjusted Model 2: Adjusted for age and sex Model 3: Adjusted for age, sex, sedative exposure, vasoactive drug use, MCHC, history of dementia, SOFA score, GCS score, mechanical ventilation, prior surgery, infection site, antibiotic timing, and antibiotic type Abbreviations: CI, confidence interval; GCS, Glasgow Coma Scale; Gram-neg, Gram-negative; Gram-pos, Gram-positive; MCHC, mean corpuscular hemoglobin concentration; MRSA, Methicillin-resistant Staphylococcus aureus; sHR, subdistribution hazard ratio; SOFA, Sequential Organ Failure Assessment In a sub-analysis utilizing the MRSA-specific cohort, we examined whether the MRSA phenotype confers an additional hazard for delirium compared to other pathogen categories, with Gram-negative infection as the reference group (Table 3). Unadjusted Analysis: In the unadjusted model (Model 1), the presence of MRSA infection showed no significant association with the risk of 7-day delirium compared to Gram-negative BSI (sHR 1.15; 95% CI 0.83–1.58; p = 0.411). Adjusted Analysis: This lack of association remained consistent after adjusting for demographic confounders (age and sex) in Model 2 (sHR 1.15; 95% CI 0.83–1.58; p = 0.397). Fully Adjusted Model: In the final multivariable Fine-Gray model (Model 3), which accounted for clinical status (sedative exposure, vasoactive drug use), comorbidities (history of dementia), laboratory parameters (MCHC), severity of illness (SOFA and GCS scores), and treatment-related factors (mechanical ventilation, prior surgery, infection site, and antibiotic parameters), MRSA status did not emerge as an independent risk factor for delirium (sHR 1.12; 95% CI 0.81–1.55; p = 0.488). Notably, in the same adjusted model, other Gram-positive infections (sHR 1.21; 95% CI 1.02–1.43; p = 0.026) and mixed/other infections (sHR 1.25; 95% CI 1.06–1.49; p = 0.010) remained significantly associated with an increased hazard of delirium. These findings may suggest that the neurocognitive hazard associated with S. aureus BSI, relative to Gram-negative BSI, is not substantially increased by the methicillin-resistance phenotype itself compared to Gram-negative BSI. However, due to the independent cohort construction and the availability of antimicrobial susceptibility testing (AST) data, a direct head-to-head comparison between MRSA and MSSA was not feasible in the present study, and this remains a necessary focus for future dedicated research. Machine learning-based feature importance and model interpretation To further elucidate the independent contribution of S. aureus infection relative to Gram-negative infections beyond global discrimination metrics, we employed an explainable machine learning approach utilizing the XGBoost algorithm coupled with SHAP (Shapley Additive exPlanations) value analysis (Fig. 5). This method allowed for a granular assessment of the predictive weight of each clinical feature at the individual patient level. Interpretability of the XGBoost model using SHAP values. (A) SHAP summary plot. Features are ranked by mean absolute SHAP values, representing global predictive importance for incident delirium. Each point denotes an individual patient, with color indicating feature intensity (red: high; blue: low). S. aureus infection (mean absolute SHAP = 0.234) emerged as the fourth most influential feature, surpassing age and sedative exposure. Positive SHAP values indicate an increased probability of delirium. (B) SHAP dependence plot for S. aureus infection. The panel illustrates the marginal effect of pathogen category (S. aureus vs. Gram-negative) on model output, stratified by SOFA score. A significant negative interaction was observed: the independent impact of S. aureus on delirium risk was most pronounced in patients with lower systemic severity (blue dots). Abbreviations: GCS, Glasgow Coma Scale; S. aureus, Staphylococcus aureus; SHAP, Shapley Additive exPlanations; SOFA, Sequential Organ failure Assessment; XGBoost, eXtreme Gradient Boosting Feature Importance Ranking. The SHAP summary plot revealed that S. aureus infection was the fourth most influential feature for incident delirium, with a mean absolute SHAP value of 0.234 (Fig. 5A). Notably, it ranked higher than traditional risk factors such as age (0.187) and sedative exposure (0.109), and followed only the dominant clinical severity markers: GCS score (0.481), mechanical ventilation (0.388), and SOFA score (0.380). Visual inspection of the SHAP distribution confirmed that S. aureus infection (represented by high feature values in red) consistently contributed to positive SHAP values, indicating its robust and independent role in driving the probability of neurocognitive dysfunction. Non-linear Interactions and Clinical Insights. The SHAP dependence plot further characterized the intricate relationship between pathogen category and systemic severity, as captured by the SOFA score (Fig. 5B). We observed a distinct negative interaction between S. aureus infection and the SOFA score regarding their impact on delirium risk. Specifically, the SHAP values for S. aureus were substantially higher in patients with lower SOFA scores (represented by blue dots in the S. aureus cluster). Subgroup analysis Subgroup analyses based on multivariable Fine–Gray models were performed to evaluate the consistency of the association between S. aureus infection and delirium risk across various clinical strata (Fig. 6). Subgroup analysis of the association between S. aureus infection and the risk of incident delirium. Subgroup analyses were performed using multivariable Fine–Gray competing risk models, adjusting for all 15 covariates identified in the final model (including age, sex, SOFA, GCS, sedation, and mechanical ventilation history). Significant interactions were observed for history of dementia (P for interaction = 0.004) and SOFA score (P for interaction < 0.001), with more pronounced effects observed in patients without a history of dementia and those with lower baseline severity (SOFA < 5). The black squares represent adjusted subdistribution hazard ratios (adj. SHR), and the horizontal lines indicate 95% confidence intervals (CIs). Abbreviations: CI, confidence interval; CKD, chronic kidney disease; COPD, chronic obstructive pulmonary disease; GCS, Glasgow Coma Scale; S. aureus, Staphylococcus aureus; sHR, subdistribution hazard ratio; SOFA, Sequential Organ Failure Assessment Significant modification of the association was observed for SOFA score (P for interaction < 0.001) and history of dementia (P for interaction = 0.004). Regarding illness severity, the impact of S. aureus infection on delirium was notably pronounced in patients with lower baseline severity (SOFA < 5: adjusted sHR 2.18; 95% CI 1.56–3.04; p < 0.001), whereas no significant association was found in those with higher severity (SOFA ≥ 5: adjusted sHR 1.16; 95% CI 0.95–1.41; p = 0.140). Similarly, in patients without a history of dementia, S. aureus infection was strongly associated with an increased risk of delirium (adjusted sHR 1.51; 95% CI 1.26–1.80; p < 0.001). In contrast, among patients with a history of dementia, the association was not statistically significant (adjusted sHR 0.62; 95% CI 0.33–1.16; p = 0.140). For other subgroups, the association remained generally consistent without statistically significant interactions. The risk estimates for S. aureus infection remained significantly elevated across categories of age (P for interaction = 0.650), sex (P for interaction = 0.820), diabetes (P for interaction = 0.410), and heart failure (P for interaction = 0.920). While the point estimates appeared slightly higher in patients with CKD (adjusted sHR 1.73; p = 0.001), the interaction test indicated no significant heterogeneity in the effect of S. aureus infection across renal function strata (P for interaction = 0.190). Discussion In this large-scale retrospective cohort study involving 3,226 critically ill patients with BSI, we identified S. aureus BSI as a robust independent risk factor for 7-day incident delirium compared with Gram-negative BSI. This association remained stable after strictly adjusting for potential confounders and the competing risk of death. Notably, the neurocognitive impact was particularly pronounced during the acute phase (within 3 days), underscoring a temporally concentrated association between S. aureus BSI and early-onset brain dysfunction. In contrast, compared with Gram-negative BSI, the MRSA phenotype was not independently associated with 7-day delirium risk. Although the impact of individual pathogens on global model discrimination may appear subtle in a multi-variable context, machine learning-based importance ranking reveals that S. aureus status is a key driver of delirium risk, following only major severity markers. Collectively, these findings identify S. aureus BSI as a key biological driver of acute brain dysfunction and underscore the potential utility of integrating pathogen-specific data into delirium risk stratification. By recognizing S. aureus as a high-risk indicator, clinicians can implement more targeted neuroprotective strategies and heightened vigilance for this vulnerable cohort in the ICU. Our finding that S. aureus BSI is independently associated with an increased risk of delirium relative to Gram-negative BSI, particularly during the acute phase, aligns with and extends the current understanding of SAE [16]. While previous literature has extensively documented sepsis as a premier risk factor for delirium [17], few studies have achieved this level of granular pathogen-specific analysis. Our results are consistent with earlier observations suggesting that Gram-positive bacteremia may carry a distinct neuroinflammatory signature compared to Gram-negative infections [18, 19]. Specifically, the potent virulence of S. aureus—characterized by its diverse secretome of exotoxins (e.g., alpha-hemolysin, TSST-1) [20, 21] and its capacity to penetrate the BBB [22]—likely, at least in part, explains the elevated risk of delirium observed in our cohort. This neurotoxic impact is further exacerbated by the rapid bacterial necrosis and lysis induced by early antibiotic therapy [23], which triggers a massive, acute release of pre-formed toxins within the critical 3-day window of infection. Interestingly, our study found no association between the MRSA phenotype and an increased risk of delirium among ICU patients with bloodstream infections, compared with those with Gram-negative BSI. This suggests that the elevated delirium risk associated with S. aureus BSI, compared with Gram-negative BSI, does not appear to increase further with antibiotic resistance, encouraging clinicians to maintain vigilance for all S. aureus BSI cases regardless of resistance profile. Furthermore, the significant interactions observed between SOFA scores, history of dementia, and delirium provide critical insights into the ‘susceptibility window’ for pathogen-driven delirium. The impact of S. aureus was significantly more pronounced in patients with lower baseline severity (SOFA < 5) and those without a history of dementia. This observation appears counterintuitive at first glance but may be comprehensively explained by a “ceiling effect” in patients with high baseline vulnerability [24, 25]. In patients with severe illness (SOFA ≥ 5) or pre-existing cognitive impairment (dementia), the brain is already subjected to profound physiological stress or neurodegeneration [26, 27]. In these scenarios, the risk of delirium may be saturated by the underlying condition, thereby masking the specific additional contribution of S. aureus infection. Conversely, in patients with preserved cognitive reserve (no dementia) and lower systemic severity, the virulent invasion of S. aureus serves as a distinct and primary “second hit” that drives acute brain failure. This identification of high-risk subpopulations is a major strength of our study, distinguishing our findings from general sepsis-associated delirium studies. Potential Pathophysiological Mechanisms. The biological mechanisms underlying the potent association between S. aureus BSI and acute brain dysfunction are likely multifactorial, involving an interplay between systemic inflammatory cascades and pathogen-specific virulence factors. First, S. aureus is characterized by an extensive arsenal of exotoxins, such as alpha-hemolysin and superantigens [28], which may directly compromise the integrity of the BBB [29]. Unlike many other pathogens, S. aureus possesses a sophisticated ability to adhere to and invade endothelial cells [30, 31], potentially facilitating the direct translocation of toxins or bacteria into the central nervous system. This “toxic hit” to the cerebral microvasculature, compounded by the massive release of toxins during initial antibiotic-induced bacterial lysis, likely explains the significantly higher hazard ratios for delirium observed within the acute 3-day window. Second, our finding that the MRSA phenotype showed no significant association with delirium risk compared with Gram-negative BSI can be further elucidated by the differential kinetics of bacterial clearance and the clinical timing of antibiotic therapy. MSSA strains are highly sensitive to standard empiric bactericidal agents, such as beta-lactams [32, 33], which are typically administered immediately upon suspicion of infection. This rapid therapeutic response leads to swift bacterial lysis, triggering an acute, massive surge of pre-formed exotoxins [34] that creates a profound neuroinflammatory burden [35] in the early stage. In contrast, MRSA is resistant to these common empiric antibiotics. Targeted therapy (e.g., vancomycin) is often initiated only after microbiological sensitivity results are confirmed. Consequently, MRSA strains may undergo minimal early lysis, resulting in a lower initial release of toxins during the critical acute window. Furthermore, MRSA often exhibits a slower clinical response to glycopeptides [36], leading to more gradual bacterial attrition and a sustained but lower-intensity neuroinflammatory stimulus that may not reach the threshold required to trigger acute delirium. Third, from an evolutionary perspective, the acquisition of MRSA resistance often carries a “fitness cost”, wherein bacteria may downregulate certain high-energy virulence factors to prioritize survival under antibiotic pressure [37, 38]. This biological trade-off implies that while MRSA is more difficult to eradicate, its intrinsic neurotoxicity may not necessarily exceed that of susceptible strains, which is consistent with our observation of no significant independent association between MRSA status and delirium risk. However, this phenomenon warrants further fundamental and clinical investigation, as existing research in this area remains scarce. Finally, the significant interactions observed for SOFA scores and dementia history support the hypothesis of “neuroinflammatory vulnerability” [39] and limited cognitive reserve [40]. In patients with lower baseline severity and intact cognitive function, a robust but dysregulated immune response to high-virulence pathogens acts as a potent disruptor of neural connectivity [41]. In contrast, among patients with prior dementia or critical illness, the “ceiling effect” occurs, where the specific neurotoxic footprint of S. aureus is obscured by the cumulative burden of pre-existing neurodegeneration or multi-organ failure. Strengths and Clinical Implications. Our study possesses several notable strengths that reinforce the reliability of the findings. Methodologically, we leveraged the large-scale MIMIC-IV database to analyze a high-powered cohort of 3,226 patients with confirmed BSI. We employed a rigorous statistical framework to minimize confounding bias: the IPTW-CBPS method was utilized to achieve optimal balance across confounding variables, while multivariable Fine-Gray proportional subdistribution hazard models were implemented to accurately account for the competing risk of death. Notably, by integrating IPTW weighting with multivariable adjustment, our analysis adopted a “doubly robust” estimation approach. This ensures that the results remain consistent and stable even if one of the underlying models is misspecified [42], thereby significantly strengthening the internal validity of our findings. Furthermore, we employed a hybrid variable selection strategy that integrated data-driven insights from LASSO and Boruta algorithms with the a priori inclusion of established clinical confounders. This approach ensures that the multivariable models are both statistically parsimonious and clinically interpretable, effectively mitigating potential overfitting while maintaining relevance to bedside practice. The clinical implications of this research are significant for the management of critically ill patients with BSI. Our findings identify S. aureus BSI as a critical and early biological driver of brain dysfunction, with the hazard for delirium being most pronounced within the first 3 days of infection. This suggests that clinicians should prioritize neurocognitive monitoring and consider early implementation of neuroprotective strategies, such as the ABCDEF bundle, specifically for patients with suspected or confirmed S. aureus infections. Importantly, relative to Gram-negative BSI, the MRSA phenotype was not independently associated with an increased risk of delirium, whereas S. aureus itself was an independent risk factor. This finding simplifies risk stratification and suggests that neuroprotective vigilance should be heightened in patients with S. aureus BSI, irrespective of methicillin-resistance status. Limitations. Our study has several limitations that warrant cautious interpretation. First, the retrospective and single-center nature of this work, conducted within the MIMIC-IV database, may constrain the generalizability of our findings. While we utilized a highly granular and well-validated dataset, further multi-center, prospective validation across diverse geographic regions is necessary to confirm these pathogen-specific patterns in different clinical environments. Second, despite our efforts to minimize confounding through a rigorous, “doubly robust” framework—combining IPTW-CBPS weighting with multivariable adjustment—the possibility of residual confounding from unmeasured factors, such as baseline cognitive reserve, specific nursing care protocols, or pre-hospital functional status, cannot be entirely dismissed. Third, the exclusion of a proportion of patients due to incomplete delirium assessments (28.4%) introduces potential selection bias. Our comparative analysis (Supplementary Table S1) revealed that the excluded group exhibited higher baseline illness severity (SOFA 7.12 vs. 6.01), higher mortality, and higher rates of sedation compared to the study cohort. This suggests a Missing Not At Random (MNAR) pattern, as the most critically ill patients were often ineligible for CAM-ICU assessment due to deep sedation or rapid clinical deterioration. Consequently, our findings may be more applicable to patients with relatively lower systemic severity who remain clinically assessable at the bedside. Fourth, by rigorously defining the index date as the time of blood culture collection and strictly excluding patients with pre-existing delirium (n = 411), our study design aimed to establish a clear temporal sequence for incident delirium. However, given the high virulence of S. aureus, it is plausible that some patients developed rapid-onset encephalopathy prior to the clinical recognition of infection and subsequent blood culture collection. Excluding these “early reactors” means our analytical cohort may have been depleted of the most susceptible individuals. While the exact direction of this bias cannot be definitively confirmed without counterfactual analysis, this Missing Not At Random pattern strongly suggests that the observed sHR of 1.39 may represent a conservative underestimate of the true neurotoxic impact of S. aureus BSI.Fifth, although S. aureus BSI emerged as a high-ranking feature in the SHAP importance analysis, these SHAP values were derived from the XGBoost framework, which is distinct from the Fine–Gray competing risk model used in the primary analysis. Therefore, feature importance in this context reflects the predictive contribution within this specific machine-learning architecture and should not be directly equated with causal effect size or bedside clinical utility. These findings indicate that, although the pathogen-specific signal is statistically robust, its independent contribution to improving overall predictive performance in a multifactorial syndrome such as delirium may be limited. Nevertheless, identifying such independent biological risk factors remains of paramount importance. Elucidating the specific pathophysiological drivers of delirium is critical for advancing our mechanistic understanding of the syndrome and provides a necessary foundation for developing more precise and targeted neuroprotective strategies in the ICU. Sixth, the MRSA-specific analysis (Table 3) was not designed as a direct head-to-head comparison between MRSA and MSSA. In the MIMIC-IV database, a subset of S. aureus cases lacked complete antimicrobial susceptibility testing (AST) records, which precluded the reliable identification of a confirmed MSSA group within the same cohort. Consequently, our finding that MRSA was not independently associated with delirium relative to Gram-negative infection cannot, by itself, demonstrate equivalence between MRSA and MSSA. A definitive test of the resistance-independence hypothesis will require a single, unified cohort in which complete AST data are available for all patients with S. aureus BSI, and this remains an important direction for future. Finally, this study focused on the acute 7-day window to capture the immediate neurocognitive impact of BSI. Although our sensitivity analysis revealed a significantly more pronounced risk within the first 3 days—supporting the “acute hit” hypothesis—the long-term cognitive trajectories and functional recovery of these survivors remain essential areas for future investigation. Conclusion In conclusion, compared with Gram-negative BSI, S. aureus BSI is a robust and independent risk factor for 7-day incident delirium in critically ill adults, with the acute hazard being more pronounced within the first 3 days of infection. These findings provide a pathogen-specific framework for acute risk stratification, identifying S. aureus as a critical biological driver of early brain dysfunction. Consequently, clinical management should prioritize early neurocognitive monitoring and the implementation of neuroprotective interventions, such as the ABCDEF bundle, for patients with S. aureus BSI. Integrating pathogen-specific data into intensive care decision-making may enable more precise neuroprotection and ultimately improve clinical outcomes for survivors. Electronic supplementary material Below is the link to the electronic supplementary material. Supplementary material 1 Supplementary material 2 Supplementary material 3 Supplementary material 4 Supplementary material 5 Author Contributions Jiang-Tao Deng and Xiang-Rong Nie conceived and designed the study. Jiang-Tao Deng acquired and processed data from the MIMIC-IV database. Jiang-Tao Deng, Wei-Jia Kong, and Pu-Heng Lu performed the statistical analyses. Jiang-Tao Deng drafted the original manuscript. Jun Jin, Lei Yu, Qing-Shan Zhou, and Xiang-Rong Nie critically revised the manuscript for important intellectual content. All authors read and approved the final manuscript. Funding No funding was received for this study. Data availability This study used the publicly available Medical Information Mart for Intensive Care IV (MIMIC-IV) database (version 3.1), hosted on PhysioNet (DOI: 10.13026/kpb9-mt58). Access to the de-identified data requires completion of human-subjects protection training and signing of the PhysioNet Credentialed Data Use Agreement. The dataset can be accessed at https://physionet.org/content/mimiciv/. Declarations Ethics approval and consent to participate The study was conducted in accordance with the ethical standards of the Institutional Review Board of the Massachusetts Institute of Technology (MIT, Cambridge, MA, USA) and Beth Israel Deaconess Medical Center (BIDMC, Boston, MA, USA). Access to the MIMIC-IV database was approved after completion of the required training (Certification No. 61,424,658). Since the database is de-identified, the requirement for individual patient consent was waived. Human Ethics and Consent to Participate declarations Not applicable, as this study was a secondary analysis of an open, de-identified database (MIMIC-IV). Consent for publication Not applicable. Competing interests The authors declare no competing interests. Footnotes Publisher’s Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. References Associated Data Supplementary Materials Supplementary material 1 Supplementary material 2 Supplementary material 3 Supplementary material 4 Supplementary material 5 Data Availability Statement This study used the publicly available Medical Information Mart for Intensive Care IV (MIMIC-IV) database (version 3.1), hosted on PhysioNet (DOI: 10.13026/kpb9-mt58). Access to the de-identified data requires completion of human-subjects protection training and signing of the PhysioNet Credentialed Data Use Agreement. The dataset can be accessed at https://physionet.org/content/mimiciv/.