The AI walks until it hits a wall, turns left or right, then walks again. If no walls are between you and the AI, it 'sees' you and runs towards where you were
Feel free to remix/use the AI without credit. Yes, the AI works with a changed map and everything looking different, as long as the AI size stays roughly the same