  Through a combined first-principles and Boltzmann transport theory, we
systematically investigate the thermal and electrical transport properties of
the unexplored ternary quasi two-dimensional KMgSb system of KMgX (X = P, As,
Sb, and Bi) family. Herein, the transport properties of KMgSb under the
application of hydrostatic pressure and alloy engineering are reported. At a
carrier concentration of $\sim8\times10^{19}~\mathrm{cm^{-3}}$, the figure of
merit zT ($\sim0.75$) for both the $n$-type and $p$-type of KMgSb closely
matched, making it an attractive option for engineering both legs of a
thermoelectric device using the same material. This is particularly desirable
for high-performance thermoelectric applications. Furthermore, the zT value
increases as pressure decreases, further enhancing its potential for use in
thermoelectric devices. In the case of substitutional doping (replacing 50 \%
Sb by Bi atom), we observed $\sim49~\%$ (in-plane) increase in the peak
thermoelectric figure of merit (zT). The maximum zT value obtained after alloy
engineering is $\sim1.45$ at 900~K temperature. Hydrostatic pressure is
observed to be a great tool to tune the lattice thermal conductivity
($\kappa_L$). We observed that the negative pressure-like effects could be
achieved by chemically doping bigger-size atoms, especially when $\kappa_L$ is
a property under investigation. Through our computational investigation, we
explain that hydrostatic pressure and alloy engineering may improve
thermoelectric performance dramatically.
