To implement this system into your game you need to enable AI Optimizer plugin.
If you have installed plugin through Epic Games Launcher, then you need to open Plugins tab and enable it there.

Last step you need to do to be able to use debug mode is to open Project Settings -> AI Optimzer Subsystem
Change DebugWidgetClass to WB_DebugAIOptimizer.

Now when plugin is enabled, add AIOInvokerComponent to your player character blueprint.

To Enable/Disable Debug Mode, use this code on your player character using function from AIOInvokerComponent.

And finally you can setup your AI or any other actor by adding AIOSubjectComponent to it.

Tweak optimization of AI by following one of the Usage Examples.
You can also copy paste logic from one of AI characters from Example Project.