BackgroundBidirectional communication between the gut microbiota and the brain may play an essential role in the cognitive dysfunction associated with chronic sleep deprivation(CSD). Salvia miltiorrhiza Bunge (Danshen, DS), a famous Chinese medicine and functional tea, is extensively used to protect learning and memory capacities, although the mechanism of action remains unknown. PurposeThe purpose of this research was to explore the efficacy and the underlying mechanism of DS in cognitive dysfunction caused by CSD. MethodsDS chemical composition was analyzed by UPLC-QTOF-MS/MS. Forty rats were randomly assigned to five groups (n = 8): control (CON), model (MOD), low- (1.35 g/kg, DSL), high-dose (2.70 g/kg, DSH) DS group, and Melatonin(100 mg/kg, MT) group. A CSD rat model was established over 21 days. DS's effects and the underlying mechanism were explored using the open-field test(OFT), Morris water-maze(MWM), tissue staining(Hematoxylin and Eosin Staining, Nissl staining, Alcian blue-periodic acid SCHIFF staining, and Immunofluorescence), enzyme-linked immunosorbent assay, Western blot, quantitative real-time polymerase chain reaction(qPCR), and 16S rRNA sequencing. ResultsWe demonstrated that CSD caused gut dysbiosis and cognitive dysfunction. Furthermore, 16S rRNA sequencing demonstrated that Firmicutes and Proteobacteria were more in fecal samples from model group rats, whereas Bacteroidota and Spirochaetota were less. DS therapy, on the contrary hand, greatly restored the gut microbial community, consequently alleviating cognitive impairment in rats. Further research revealed that DS administration reduced systemic inflammation via lowering intestinal inflammation and barrier disruption. Following that, DS therapy reduced Blood Brain Barrier(BBB) and neuronal damage, further decreasing neuroinflammation in the hippocampus(HP). Mechanistic studies revealed that DS therapy lowered lipopolysaccharide (LPS) levels in the HP, serum, and colon, consequently blocking the TLR4/MyD88/NF-κB signaling pathway and its downstream pro-inflammatory products(IL-1β, IL-6, TNF-α, iNOS, and COX2) in the HP and colon. ConclusionDS treatment dramatically improved spatial learning and memory impairments in rats with CSD by regulating the composition of the intestinal flora, preserving gut and brain barrier function, and reducing inflammation mediated by the LPS-TLR4 signaling pathway. Our findings provide novel insight into the mechanisms by which DS treats cognitive dysfunction caused by CSD.