How do i get AI to look for me at Last Known Posistion?

Hi, i have this basic AI System where the AI wonders around, and if he see’s the player (Using a pawn sensing component) he will chase the player and when he gets close to the player he attacks him.

But when the player runs really far from him and hides inside of a building or somewhere where the AI Can’t see him no more, the AI Still knows where i am no matter what. I Wanna add so that whenever i’m not in his line of sight anymore, he’ll start looking for me at my last known position and search the area (Kinda like in assassins creed) Any help will be highly appreciated!

Also, i ain’t using a behavior tree. This is all done within my ZombieAI Character blueprint.

Can you upload some images of the blueprint? That will help with figuring out what needs to be changed.

Yes, i could.

Just check with a certain frequency if your npc can see the player (via line traces) and if not record the player’s location in a vector and make your npc go there.

This is basically “ai move to” node with random locations input. And another node is connected through “branch” (true or false) and to “on seeing pawn” is attached to the branch. if true, he will follow the player. if false, it will go back to “delay” node where he continues looking.
.
Based on how far you want him to look around last seen position, change the “get random point in navigable position” value. And the delay is how long he should stand there and look when he reach a place.
Check the image which I attached.
Hope I helped.