Quantum error correction (QEC) is fundamental for quantum information processing but entails a substantial overhead of classically-controlled quantum operations, which can be architecturally cumbersome to accommodate. Here we discuss a novel approach to designing elementary QEC memory cells, in which all control operations are performed autonomously by an embedded optical feedback loop. Our approach is natural for nanophotonic implementations in which each qubit can be coupled to its own optical resonator, and our design for a memory cell based on the quantum bit-flip or phase-flip code requires only five qubit-cavities (three for the register and two for the controller) connected by wave-guides. The photonic QEC circuit is entirely on-chip, requiring no external clocking or control, and during steady-state operation would only need to be powered by the injection of constant-amplitude coherent fields.