Usually chemistry deals with processes, tending towards thermodynamic equilibrium. However, living organisms display contradictory behavior by carrying chemical reactions out of thermodynamic equilibrium. We are interested to study out-of-equilibrium processes by developing artificial systems, which employ light-sensitive materials, termed photoacids and photobases. These substances are aromatic molecules, showing properties of weak acid or base in their ground electronic state, but exhibiting large pKa drop or increase, respectively, in their excited state. Here we present self-assembly of nanoparticles, sustained by light as external energy supply, hence termed dynamic self-assembly. We use gold nanoparticles (AuNPs), decorated with pH sensitive ligands, introduced into light-responsive photoacid and photobase medium. Upon light illumination, proton transfer occurs, resulting in AuNPs assembly and disassembly cycles. The uniqueness of our design strategy is underlined by fast conversion rates between the assembled and disassembled AuNPs states both in aqueous and non-aqueous solution.