Episodic brain disorders such as epilepsy have a considerable impact on a patient's productivity and quality of life and may be life-threatening when seizures cannot be controlled with medications. We will create a second generation brain-implantable sensing and stimulating device (BISSD) based on CPS principles and practice. The BISSD will be composed of modules placed intracranially to continuously monitor brain state and vulnerability to seizure and intervene with electrical stimulation to block the development of seizure.