The Enterprise welcomes aboard Dr. Leah Brahms, one of the lead designers of the Galaxy-class starship engines. Chief Engineer Geordi La Forge, who has previously used a lifelike simulation of Dr. Brahms in the holodeck to help save the Enterprise before (cf. "Booby Trap"), is excited to meet her, but is frustrated when she complains of the modifications he has made to the Enterprise's engines. La Forge also comes to learn that Brahms is married, a fact not noted in the holodeck simulation. Dr. Brahms learns of how La Forge previously saved the Enterprise, and asks another crewman to show her the simulation. La Forge, alarmed, tries to stop this, but arrives too late as Dr. Brahms has discovered the computer-simulated version of her, and accuses La Forge of invading her privacy.
As the Enterprise continues its mission, it is attacked by a strange space-faring creature, nearly the size of the Enterprise. Taking defense action, Captain Picard orders a low power phaser burst on the creature, but this kills it. On scanning the creature, Data finds another smaller creature inside it, and the crew realizes that the larger creature only attacked them to protect its unborn. The crew performs a Cesarean section, using the ship's phasers as a scalpel, that frees the newborn, but as they turn to leave, the newborn attaches itself to the ship and feeds off its power systems, imprinting on the Enterprise as if it were the creature's mother. As their power supplies run low, the crew finds a nearby debris field that the larger creature appeared to be headed for which would serve as a better feeding ground for the infant. When they arrive there on the last of their power reserves, the crew finds they cannot dislodge the creature. Worse, the creature emits radio signals that attract more of its kind from the debris field which head straight toward the Enterprise. La Forge and Brahms put aside their differences and devise a solution: to alter the frequency of energy as to "sour the milk", which causes the infant to leave the ship and join the other creatures. As the Enterprise power is restored, La Forge and Brahms make up and determine they can still be friends.