initialization of ai code