Shenfu injection (SF) has demonstrated its potential to enhance cellular immunity and induce clinical regression in patients suffering from sepsis or infectious shock. However, the therapeutic effect of SF on sepsis-induced cognitive dysfunction (SAE) and the mechanisms involved are still unclear. We aimed to investigate the mechanism of SF in mice with SAE. Sepsis was constructed by caecal ligation and puncture. Mice were injected intraperitoneally with SF or NLRP3 inhibitor. The hippocampus injury of brain tissues was evaluated, and the levels of inflammatory cytokines (IL-1β, IL-18) and NLRP3 and Caspase 1 were measured. The active ingredients of SF were analyzed using network pharmacology, and molecular docking of the active ingredients of SF with NLRP3 and Caspase 1 was performed. BV-2 cells were treated with LPS or norcoclaurine. CCK-8 detected the cell viability, and the levels of inflammatory cytokines and NLRP3 and Caspase 1 were measured. SF and NLRP3 inhibitor increased survival rate and the number of crossing the platform and decreased the escape latency time of sepsis mice. Moreover, SF and NLRP3 inhibitor improved neuronal damage and apoptosis in hippocampus of sepsis mice. In addition, SF and NLRP3 inhibitor reduced the levels of inflammatory cytokines, as well as inflammasomes in sepsis mice. There were 43 active ingredients in SF. Among them, 22 were Renshen and 21 were Fuzi. Renshen and Fuzi, the main active components of SF, form a complex regulatory network with NLRP3 and Caspase 1. (R)-norcoclaurine was most closely bound to NLRP3 with binding energy of -7.2 kJ·mol-1, ignavine was most closely bound to Caspase 1 with binding energy of -8.3 kJ·mol-1. Norcoclaurine increased the cell viability and decreased inflammation and pyroptosis. SF regulated NLRP3/Caspase 1 through (R)-norcoclaurinee to prevent SAE.