In theory, this technology actually exists right now.
Google Engineer AI that creates other AI
The thing is that although this Artificial Intelligence by Google is quite accurate, it is just the basic version, only more powerful. Google was able to Engineer AI that tracks any and every identifiable object on an image. However, it was limited to just that.
For an AI to engineer AI a more sentient AI, the base machine will have to hold processing powers of ridiculous levels - just as that of a human.
~Vibhor Tyagi (Techie at Engineer.AI)