How to make an AI move away when overlaps my character?

Hey guys! I’m making a friendly AI, but sometimes when I go through corridors I can’t go back because he doesn’t move away unless I move and he follows. Do you know how to make he moves to some random target points attached to my character when they overlap eachother?