An implant that monitors brain activity and provides personalised stimulation halved the discomfort of people living with chronic pain