  We report on the first realization of an integrated optical memory for light
based on a laser written waveguide in a doped crystal. Using femto-second laser
micromachining, we fabricate waveguides in Pr$^{3+}$:Y$_2$SiO$_5$ crystal. We
demonstrate that the waveguide inscription does not affect the coherence
properties of the material and that the light confinement in the waveguide
increases the interaction with the active ions by a factor 6. We also
demonstrate that, analogously to the bulk crystals, we can operate the optical
pumping protocols necessary to prepare the population in atomic frequency
combs, that we use to demonstrate light storage in excited and spin states of
the Praseodymium ions. Our results represent the first realization of laser
written waveguides in a Pr$^{3+}$:Y$_2$SiO$_5$ crystal and the first
implementation of an integrated on-demand spin wave optical memory. They open
new perspectives for integrated quantum memories.
