Setting Up Ai with rootmotion

Hello,

I have been trying to make an AI that utilizes root motion in it movements but with no success, does anyone have a some resources that could teach how to set up an AI that moves in 8 or 4 direction(+blend) using rootmotion.

Mine keeps on walking toward one direction