Scientists are using AI to design better thermoelectric generators—devices that turn wasted heat into electricity.