In recent years, halide perovskite-based memory devices have attracted extensive research interest. Among them, CsPbI3-based memory devices are a kind of important research object. Perovskite-phase CsPbI3 (α-phase CsPbI3) is unstable at room temperature and will quickly transform into δ-phase CsPbI3, so the study of δ-phase CsPbI3-based memory devices become valuable. In this paper, using the Density Functional Theory (DFT), we find that when the interstitial doped Ag atom is closer to the I vacancy (VI) defect, the formation energy of the VI defect is reduced more, thus making it easier to promote the generation of VI defect, which leads to more favorable uniformity and stability for these CsPbI3-based memory devices. The reason lies in the fact that the doped Ag atom can serve as an effective recombination center, recombining the electrons around the doping Ag atom and the unpaired holes left around the VI. Our research uncovers the principle of the effect of Ag atoms on I vacancies formation in the CsPbI3 crystal for the first time, which provides a theoretical guidance for the fabrication of δ-phase CsPbI3 memory devices in the future.