Minimal hepatic encephalopathy (MHE) affects attention, visuo-motor coordination, and visual perception, with mixed evidence on its impact on memory. Brain-derived neurotrophic factor (BDNF) is associated with memory dysfunction, and plays a crucial role in modulating neuroplasticity. This study investigates the mediating role of BDNF in the relationship between pro-inflammatory cytokines (IL-6, IL-15, IL-18), and declarative memory performance, and the moderating effects of sex. Sixty-eight cirrhotic patients and 22 healthy volunteers performed the Psychometric Hepatic Encephalopathy Score for MHE diagnosis and logical memory subtest (Wechsler Memory Scale-III). Moderated mediation analysis using bias-corrected bootstrapping and multiple regression was performed. Results showed that increased levels of IL-18 and IL-15 were significantly associated with lower BDNF levels (p = 0.03 and p = 0.02 respectively). However, no direct effect was observed between IL-18 and IL-15 and memory. The conditional effects of BDNF on memory were significant only for women with and without MHE, and lower BDNF levels were associated with lower memory performance (without MHE: p = 0.002; MHE: p = 0.001). Moreover, BDNF mediated indirectly the relationship between pro-inflammatory cytokines and memory. IL-18 and IL-15 impacted memory through reduced BDNF levels only in women with and without MHE, whereas IL-6 showed no significant effect on BDNF or memory across groups. These findings underscore the important role of BDNF in memory in cirrhotic patients, especially women with MHE, by mediating the IL-18 and IL-15 effects. The study highlights the role of IL-18 and IL-15 cytokines in neuroplasticity-related memory decline, positioning BDNF as a key biomarker for inflammation-associated cognitive impairment in this population.