A short-term memory can be evoked by different inputs and control separate targets in different behavioral contexts. To address the circuit mechanisms underlying context-dependent memory function, we determined through optical imaging how memory is encoded at the whole-network level in two behavioral settings. Persistent neural activity maintaining a memory of desired eye position was imaged throughout the oculomotor integrator after saccadic or optokinetic stimulation. While eye position was encoded by the amplitude of network activity, the spatial patterns of firing were context dependent: cells located caudally generally were most persistent following saccadic input, whereas cells located rostrally were most persistent following optokinetic input. To explain these data, we computationally identified four independent modes of network activity and found these were differentially accessed by saccadic and optokinetic inputs. These results show how a circuit can simultaneously encode memory value and behavioral context, respectively, in its amplitude and spatial pattern of persistent firing.