This is "Swarm" by Bruce Sterling, a story set in the Schismatrix universe. It was published first in 1982, in the April edition of The Magazine of Fantasy & Science Fiction.
Captain-Doctor Simon Afriel, a shaper (one of the two factions in the Schismatrix universe, the other being the mechanists) arrives on an asteroid, where another shaper, Galina Mirny, is already studying an alien species that forms a hive, like insects do. She has found a way to use pheromones to control the aliens.
Unfortunately, those interactions have triggered a countermeasure in the form of its brain caste, of which a specimen is bred when a crisis like this arrives.
One of the shapers is quickly dispatched with her body being used as a sock puppet for the brain to talk through, the other is kept around for company.
One of the tendrils had been thrust through Mirny's skull. Her body hung in midair, limp as wax. Her eyes were open, but blind.
It spoke with Mirny's voice. "Captain-Doctor Afriel..."
"I find myself awakened again," Swarm said dreamily. "I am pleased to see that there is no major emergency to concern me. Instead it is a threat that has become almost routine." It hesitated delicately. Mirny's body moved slightly in midair; her breathing was inhumanly regular. The eyes opened and closed. "Another young race."
"What are you?"
"I am the Swarm. That is, I am one of its castes. I am a tool, an adaptation; my specialty is intelligence. I am not often needed. It is good to be needed again."
It has been collected with all other Schismatrix stories in an expanded edition of Schismatrix, called Schismatrix Plus.