A next-generation material that adapts to its history