There's always the Daam K'Vosh, they toyed around with everything and it stands to reason that they started with machines before moving on to organic tinkering. The AI could be a leftover experiement left running for so long that it eventually became self aware or even something like an automated shipyard program. It doesn't need to make a lot of sense just enough so that it sounds good.