Implement AI Factory.