Basic format of AI function