A photoresponsive double-layer hydrogel has been developed, in which light-sensitive cinnamic moieties are grafted onto a polyacrylamide network to produce a photoresponsive layer and pure polyacrylamide formed the supporting layer. Ag nanoparticles were dispersed using in situ reduction on the photoresponsive layer to act as the catalyst. The as-fabricated hydrogel exhibits a shape memory effect and controllable catalytic behavior under an external light stimulus. When exposed to ultraviolet (UV) light at λ > 260 nm, the resulting cycloaddition of cinnamic moieties not only fix the hydrogel’s temporary shape, but also greatly slow down the catalytic reaction rate. After irradiated with UV light at λ < 260 nm, however, the newly formed crosslinking points are reversibly cleaved. This results in the shape recovery of the hydrogel to its permanent shape. At the same time, the catalytic reaction was greatly accelerated because of the facile diffusion of the reactants into the hydrogel.