Effect of Ag doping and insulator buffer layer on the memory mechanism of polymer nanocomposites