Sooner than you might think, we might be able to put electronic mesh implants inside the brain that could treat neurological problems and possibly prevent certain neurological issues from occurring.

In a new perspective for the journal Nature Biotechnology, Harvard Medical School faculty member Shaun Patel, and Joshua and Beth Friedman University Professor Charles M. Lieber, outline how mesh implants could help treat Parkinson’s disease, Alzheimer’s, addiction, and could even help prevent the brain from degrading with age.

“The next frontier is really the merging of human cognition with machines,” Patel says in the perspective. “Everything manifests in the brain fundamentally. Everything. All your thoughts, your perceptions, any type of disease.”

Patel and Lieber describe how this mesh implant can, over time, collect data from the brain and learn how its neurons are communicating. With this data, the implant can essentially map the brain and stimulate it when a neurological issue requires treatment. The main issue this kind of stimulation is helping solve is a lack of proper connectivity in the brain.

“The electrodes that deliver stimulation are ultra-small,” Patel tells Inverse. “They’re cellular and sub-cellular in size, so when you implant them into the brain, they resemble the size of the cells in the brain and the axons in the brain more than a typical electrode.”

As things stand, relatively large rods that are implanted in the brain are the main method of attempting to stimulate it to help solve neurological issues. Patel said the brain doesn’t handle these probes very well so their effectiveness decreases significantly over time.

A traditional neural electrode (top panel) provokes an immune response in the brain while a mesh electronic interface (bottom panel) does not. The size and rigidity of current electrodes provoke chronic inflammation, causing glial scarring between brain tissue and electrode and degrading the neural interface. Mesh electronics evade the immune response due to cellular and sub-cellular features and bending stiffness resembling the brain itself. Image courtesy of Shaun Patel and Charles Lieber

“Even if you can do something very meaningful, it might not last for a very long period of time,” Patel says.

This new form of electronic brain stimulation can actually encourage newly formed neurons to migrate to damaged areas in the brain and help heal them. If someone has a stroke that causes brain cells in one region of the brain to die, for example, you could move brain cells from a region that is producing cells to make up for what was lost. Patel says this is because the mesh resembles the size, shape and structure of brain cells, so new cells can migrate across the mesh just like they migrate across neurons.

“This gives you an implement, or a tool, to move these neurons to regions you choose,” Patel says.

This kind of brain stimulation could help fix failing circuitry in the brain that leads to diseases like Parkinson’s and Alzheimer’s, and it could even be used to enhance someone’s ability to learn. If someone is suffering from an addiction, Patel claims just 500 milliseconds of stimulation from the implant can prevent them from choosing to indulge in unhealthy habits when they’re feeling the urge.

See also: Neuralink: “Classic” 2003 Paper Is the Foundation for Elon Musk’s Device

This is all quite exciting, but there are also some concerning consequences that could come with adopting this sort of technology. The paper explains that this technology could lead to being able to look into someone’s most intimate thoughts. What happens when corporations or the government can gain access to the data an implant is collecting and possibly use it to their benefit? One can imagine how people could be taken advantage of or unjustly penalized for what they’re thinking or their secrets that were never meant to be shared with the world.

Putting an implant like this in the brain is not just a futuristic concept. Companies like Elon Musk’s Neuralink are currently working to develop this kind of technology. Musk said in July that he is hoping to have an implant in a patient’s brain by the end of next year. Neuralink’s implant will not be mesh, though, but will instead take the form of a small chip with probes that are inserted into the brain tissue. It’s even going to be connected to an iPhone app.

Neuralink will initially be focusing on helping treat patients who have quadriplegia from a C1-C4 spinal cord injury, but the plan is to expand what this implant will be capable of treating over time.

It may sound odd and even discomforting to imagine humans putting electronic implants in their head to treat an ailment, keep their memory strong or simply learn new things faster, but what’s clear is it is part of humanity’s future. One hopes it will only be a positive impact on humanity, but it’s quite possible we’ll have to face the negative effects of this too.

“What can you do with a stable neural interface? I think that’s a very profound and interesting question,” Patel says.