Closing the Loop: How SpikeGadgets Is Enabling Real-Time Brain Perturbation

Most electrophysiology is a one-way street: record activity, analyze it later, draw conclusions. Closed-loop experiments break that pattern. By detecting a specific pattern of neural activity — a ripple, a phase of theta, a decoded memory representation — the instant it occurs and triggering a perturbation either in the brain or in the environment in response, researchers can move from merely observing brain dynamics to testing them causally, in real time, while an animal is behaving. A recent review by Wenxuan Fang, Afsoon Mombeini, and Manu Madhav frames these efforts as part of a broader shift in experimental neuroscience, arguing that advances in real-time recording, decoding, and miniaturized stimulation hardware are letting researchers reshape neural computation it while it’s underway to gain a more detailed understanding of how the brain functions. This kind of experiment places extraordinary demands on hardware: recording and processing have to be fast enough, and precise enough, that the intervention actually lands on the neural event it’s meant to target.

SpikeGadgets’ hardware is built around this requirement directly. Our hardware streams digitized neural data to the host computer over a low-latency ethernet connection, keeping the delay between a spike occurring in the brain and that spike being available for analysis as short as possible. On the software side, SpikeGadgets’ Trodes platform exposes this live data stream through a ZMQ-based networking API (TrodesNetwork), which lets researchers write their own Python or C++ code to read spikes, LFP, position tracking, and other data live during an experiment — and to send messages back to the hardware to perturb brain activity or cues in the environment. Together, this combination of low-latency Ethernet acquisition and a real-time, developer-accessible networking layer is what makes it practical to detect a neural pattern and act on it within milliseconds. Two recent studies from researchers in Loren Frank’s lab at UCSF show how far the approach has come.

Rewards for thinking about somewhere else

A striking demonstration comes from Michael Coulter and colleagues at UCSF. Their neurofeedback system continuously decoded hippocampal population activity in rats — using recordings collected via SpikeGadgets hardware and Trodes software — to identify, moment by moment, whether the animal’s hippocampus was representing its current location or a “remote” location elsewhere in the maze. Reward was delivered whenever the decoded representation matched an experimenter-defined remote target, entirely independent of where the rat’s body actually was or any external cue. Rats learned to reliably generate these remote representations for reward, often jumping directly to the target location in neural space — establishing, for the first time, that animals can deliberately and volitionally engage a specific memory representation without a triggering cue or a behavioral report (Coulter et al., 2025, Neuron).

Separating theta rhythm from replay by perturbing exactly on beat

A second study from the Frank lab, led by Abhilasha Joshi, used closed-loop stimulation to pull apart two processes that are normally intertwined: the fine-timescale coordination of spiking within the hippocampal theta rhythm, and the offline replay of experience during sharp-wave ripples. Using theta-phase-specific optogenetic stimulation of septal parvalbumin neurons — triggered in real time off SpikeGadgets-recorded hippocampal activity — the team could disrupt theta-timescale spike timing in rats without eliminating place coding. This selectively impaired the animals’ ability to learn challenging spatial tasks, but left hippocampal replay fully intact, showing that theta coordination and replay are more dissociable, mechanistically, than previously assumed (Joshi et al., 2025, bioRxiv). The result depends entirely on the stimulation landing at the correct phase of an ongoing, fast oscillation — exactly the kind of split-second targeting that closed-loop systems make possible.

 

Closing the Loop: How SpikeGadgets Is Enabling Real-Time Brain Perturbation

Most electrophysiology is a one-way street: record activity, analyze it later, draw conclusions. Closed-loop experiments break that pattern. By detecting a specific pattern of neural activity — a ripple, a phase of theta, a decoded memory representation — the instant it occurs and triggering a perturbation either in the brain or in the environment in response, researchers can move from merely observing brain dynamics to testing them causally, in real time, while an animal is behaving. A recent review by Wenxuan Fang, Afsoon Mombeini, and Manu Madhav frames these efforts as part of a broader shift in experimental neuroscience, arguing that advances in real-time recording, decoding, and miniaturized stimulation hardware are letting researchers reshape neural computation it while it’s underway to gain a more detailed understanding of how the brain functions. This kind of experiment places extraordinary demands on hardware: recording and processing have to be fast enough, and precise enough, that the intervention actually lands on the neural event it’s meant to target.

SpikeGadgets’ hardware is built around this requirement directly. Our hardware streams digitized neural data to the host computer over a low-latency ethernet connection, keeping the delay between a spike occurring in the brain and that spike being available for analysis as short as possible. On the software side, SpikeGadgets’ Trodes platform exposes this live data stream through a ZMQ-based networking API (TrodesNetwork), which lets researchers write their own Python or C++ code to read spikes, LFP, position tracking, and other data live during an experiment — and to send messages back to the hardware to perturb brain activity or cues in the environment. Together, this combination of low-latency Ethernet acquisition and a real-time, developer-accessible networking layer is what makes it practical to detect a neural pattern and act on it within milliseconds. Two recent studies from researchers in Loren Frank’s lab at UCSF show how far the approach has come.

Rewards for thinking about somewhere else

A striking demonstration comes from Michael Coulter and colleagues at UCSF. Their neurofeedback system continuously decoded hippocampal population activity in rats — using recordings collected via SpikeGadgets hardware and Trodes software — to identify, moment by moment, whether the animal’s hippocampus was representing its current location or a “remote” location elsewhere in the maze. Reward was delivered whenever the decoded representation matched an experimenter-defined remote target, entirely independent of where the rat’s body actually was or any external cue. Rats learned to reliably generate these remote representations for reward, often jumping directly to the target location in neural space — establishing, for the first time, that animals can deliberately and volitionally engage a specific memory representation without a triggering cue or a behavioral report (Coulter et al., 2025, Neuron).

Separating theta rhythm from replay by perturbing exactly on beat

A second study from the Frank lab, led by Abhilasha Joshi, used closed-loop stimulation to pull apart two processes that are normally intertwined: the fine-timescale coordination of spiking within the hippocampal theta rhythm, and the offline replay of experience during sharp-wave ripples. Using theta-phase-specific optogenetic stimulation of septal parvalbumin neurons — triggered in real time off SpikeGadgets-recorded hippocampal activity — the team could disrupt theta-timescale spike timing in rats without eliminating place coding. This selectively impaired the animals’ ability to learn challenging spatial tasks, but left hippocampal replay fully intact, showing that theta coordination and replay are more dissociable, mechanistically, than previously assumed (Joshi et al., 2025, bioRxiv). The result depends entirely on the stimulation landing at the correct phase of an ongoing, fast oscillation — exactly the kind of split-second targeting that closed-loop systems make possible.