How do you make AI to stop following you after a certain distance?

What’s happening exactly is when my first person character gets in front of the AI’s pawn sensing it starts to chase me but when I’m out of range of the pawn sensing it still chases me. The only way it goes back to patrolling is if you go around the back of it.