Researchers have successfully demonstrated how an electronic device implanted directly into the brain can detect, stop and even prevent epileptic seizures.
Source: https://medicalxpress.com/news/2018-08-electronic-device-implanted-brain-seizures.html