I see the Pym explanation simply enough: Pym is working with nanotech --- and that's how he discovers "Pym particles" and miniaturization --- and just applies that to a robot to try to create a fully functional android. The nanobot AI then takes on a life of its own.

Yeah that's a good idea really, then THEY infect Javis or Absorb Jarvis' AI to become Ultron