Rework of the NG agent to use cache