Closed-loop strategies offer advanced therapeutic potential through intelligent disease management. Here, we develop a hydrogel-based, single-component, organic electronic device for closed-loop neurotherapy. Fabricated out of conductive hydrogels, the device consists of a flexible array of microneedle electrodes, each of which can be individually addressed to perform electrical recording and control chemical release with sophisticated spatiotemporal control, thus pioneering a smart antiseizure therapeutic system by combining electrical and pharmacological interventions. The recorded neural signal acts as the trigger for a voltage-driven drug release in detected pathological conditions predicted by real-time electrophysiology analysis. When implanted into epileptic animals, the device enables autonomous antiseizure management, where the dosing of antiepileptic drug is controlled in a time-sensitive, region-selective, and dose-adaptive manner, allowing the inhibition of seizure outbursts through the delivery of just-necessary drug dosages. The side effects are minimized with dosages three orders of magnitude lower than the usage in approaches simulating existing clinical treatments.