Increasing evidence indicates the occurrence of cognitive impairment in astronauts under spaceflight compound conditions, but the underlying mechanisms and countermeasures need to be explored. In this study, we found that learning and memory abilities were significantly reduced in rats under a simulated long-duration spaceflight environment (SLSE), which includes microgravity, isolation confinement, noises, and altered circadian rhythms. Dammarane sapogenins (DS), alkaline hydrolyzed products of ginsenosides, can enhance cognition function by regulating brain neurotransmitter levels and inhibiting SLSE-induced neuronal injury. Bioinformatics combined with experimental verification identified that the PI3K-Akt-mTOR pathway was inhibited and the MAPK pathway was activated during SLSE-induced cognition dysfunction, whereas DS substantially ameliorated the changes in brain. These findings defined the characteristics of SLSE-induced cognitive decline and the mechanisms by which DS improves it. The results provide an effective candidate for improving cognitive function in spaceflight missions.