Compact 3D quantum memory