We present a predictive and general approach to investigate near-field energy transfer processes between localized defects in semiconductors, which couples first-principles electronic structure calculations and a nonrelativistic quantum electrodynamics description of photons in the weak-coupling regime. The approach is general and can be readily applied to investigate broad classes of defects in solids. We apply our approach to investigate an exemplar point defect in an oxide, the F center in MgO, and we show that the energy transfer from a magnetic source, e.g., a rare-earth impurity, to the vacancy can lead to spin nonconserving long-lived excitations that are dominant processes in the near field, at distances relevant to the design of photonic devices and ultrahigh dense memories. We also define a descriptor for coherent energy transfer to predict geometrical configurations of emitters to enable long-lived excitations, that are useful to design optical memories in semiconductor and insulators. Published by the American Physical Society 2024