A primary objective in developing a neural prosthesis is to replace neural circuitry in the brain that no longer functions appropriately. Such a goal requires artificial reconstruction of neuron-to-neuron connections in a way that can be recognized by the remaining normal circuitry, and that promotes appropriate interaction. In this study, the application of a specially designed neural prosthesis using a multi-input/multi-output (MIMO) nonlinear model is demonstrated by using trains of electrical stimulation pulses to substitute for MIMO model derived ensemble firing patterns. Ensembles of CA3 and CA1 hippocampal neurons, recorded from rats performing a delayed-nonmatch-to-sample (DNMS) memory task, exhibited successful encoding of trial-specific sample lever information in the form of different spatiotemporal firing patterns. MIMO patterns, identified online and in real-time, were employed within a closed-loop behavioral paradigm. Results showed that the model was able to predict successful performance on the same trial. Also, MIMO model-derived patterns, delivered as electrical stimulation to the same electrodes, improved performance under normal testing conditions and, more importantly, were capable of recovering performance when delivered to animals with ensemble hippocampal activity compromised by pharmacologic blockade of synaptic transmission. These integrated experimental-modeling studies show for the first time that, with sufficient information about the neural coding of memories, a neural prosthesis capable of real-time diagnosis and manipulation of the encoding process can restore and even enhance cognitive, mnemonic processes.