The present invention provides a closed-loop system for treating neurological disorders, such as epilepsy. In one embodiment the system comprises an input assembly that is adapted to receive one or more signals from a patient that are indicative of a patients neurological state. The input assembly processes the one or more signals to generate one or more control input signals. An output assembly receives the one or more control input signals from the input assembly and generate a neuromodulation signal that is a function of the patients neurological state. An electrode array is configured to deliver the neuromodulation signal to a patients peripheral nerve, such as the vagus nerve.