Recent experiments [Persky , ] demonstrate a magnetic memory effect in 4Hb−TaS2 above its superconducting transition temperature, where Abriokosov vortices are spontaneously generated by lowering the temperature at zero magnetic field after field training the normal state. Motivated by the experiment, we propose the chiral quantum spin liquid (QSL) stabilized in the constituent layers of 4Hb−TaS2 as a mechanism. We model 4Hb−TaS2 as coupled layers of the chiral QSL and the superconductor. Through the Kondo coupling between the localized moments and conduction electrons, there is mutual transmutation between spinons and vortices during the thermal-cycling process, which yields the magnetic memory effect observed in experiments. We also propose a mechanism to stabilize chiral and nematic superconductivity in 4Hb−TaS2 through the Kondo coupling of conduction electrons to the chiral QSL. Our picture suggests 4Hb−TaS2 as an exciting platform to explore the interplay between QSL and superconductivity through the Kondo effect. Published by the American Physical Society 2024