  We study the dynamics of a two-level impurity embedded in a two-dimensional
Bose-Hubbard model at zero temperature from an open quantum system perspective.
Results for the decoherence across the whole phase diagram are presented, with
a focus on the critical region close to the transition between superfluid and
Mott insulator. In particular, we show how the decoherence and the deviation
from a Markovian behaviour are sensitive to whether the transition is crossed
at commensurate or incommensurate densities. The role of the spectrum of the
Bose-Hubbard environment and its non-Gaussian statistics, beyond the standard
independent boson model, is highlighted. Our analysis resorts on a recently
developed method [Phys. Rev. Research 2, 033276 (2020)] - closely related to
slave boson approaches - that enables us to capture the correlations across the
whole phase diagram. This semi-analytical method provides us with a deep
insight into the physics of the spin decoherence in the superfluid and Mott
phases as well as close to the phase transitions.
