We conducted a comprehensive analysis of the mechanical, transport, and thermoelectric characteristics of XMgSb (X = K, Rb, Cs) alkali metal compounds using first-principles calculations, self-consistent phonon theory, compressive sensing technology, and the Boltzmann transport equation. Our results show that the very low lattice thermal conductivity of these materials is mainly attributed to the strong anharmonicity of the alkali metal atoms, and the lattice thermal conductivity is negatively correlated with the mass of X atoms. Furthermore, we consider five scattering mechanisms to accurately calculate transport properties and electron relaxation times. Notably, we observed that the large electronic dispersion band near the valence band maximum (VBM) leads to the high conductivity of these three compounds, with a flat electronic energy band at the Γ-Z point, which generally implies a larger Seebeck coefficient. The coexistence of good electronic band dispersion and flat electronic bands leads to high conductivity and large Seebeck coefficient, resulting in high thermoelectric (TE) power. Low lattice thermal conductivity and high TE power factor jointly determine the development potential of alkali metal compound XMgSb (X = K, Rb, Cs) in the field of thermoelectricity.