In this paper, we have demonstrated that optically generated fictitious magnetic fields can be utilized to extend the lifetime of quantum memories in cold atomic ensembles. All the degrees of freedom of an AC Stark shift, such as polarization, spatial profile, and temporal waveform, can be readily controlled in a precise manner. Temporal fluctuations over several experimental cycles and spatial inhomogeneities along a cold atomic gas have been compensated by an optical beam. The advantage of employing fictitious magnetic fields for quantum storage lies in the speed and spatial precision with which these fields can be synthesized. Our simple and versatile technique can find widespread application in coherent pulse and single-photon storage across various atomic species. Published by the American Physical Society 2024