Set in the 24th century, the series follows the adventures of the crew of the Federation starship Enterprise. In this episode, escaped nanites threaten the Enterprise as well as its critical research mission.
As the expected time of the stellar explosion nears, the ship malfunctions in odd ways, and the issue is traced to the computer core. Wesley, who had been working on a project involving microscopic nanites, realizes that he may have inadvertently let two nanites from his experiments loose. The nanites were programmed to find ways to work together and evolve. A scan of the computer core reveals that the nanites have determined a way of replicating themselves and have taken up residence in the computer core. With the computer controls unreliable, the crew and Dr. Stubbs attempt to see if they can remove the nanites from the core. However, Dr. Stubbs shoots the core with a burst of gamma radiation, destroying a large number of the nanites. They retaliate by flooding the bridge with nitrogen dioxide, which the crew overrides. Dr. Stubbs is confined to quarters, but the nanites attempt further revenge by shocking him with electricity. Captain Picard prepares to flood the computer core with gamma radiation to remove the nanites completely, but the android Second Officer Commander Data (Brent Spiner) establishes communication with the nanites and allow them to use his body to speak with Picard. Picard realizes that the nanites are self-aware and conscious and took Dr. Stubbs' actions as hostile, but they want peace. Picard negotiates a deal to send the nanites to Kavis Alpha IV, designating it as their homeworld. The nanites agree and repair the damage to the computer core before they leave it. Dr. Stubbs launches his probe on time and collects numerous volumes of data. Ensign Crusher, who feels responsible for the incident, is counseled by his mother, both of them realizing he is growing up.