Initial commit for AI routines