IL-1R1 signaling in neural stem cells reduces hippocampal neurogenesis in adult mice, potentially affecting learning and memory. Using a new mouse model, we report that IL-1β drives cognitive impairment after infection with SARS-CoV-2, and that IL-1β-driven cognitive impairment can be prevented by vaccination, even in cases of breakthrough infection.