Paris and Torres are confronted by aliens who materialize on their shuttle, fire a weapon at the pair and disappear as quickly as they'd appeared. Although Paris sustains serious injuries from the charge, Torres recovers sufficiently to get them back to Voyager. Neelix tells Janeway that he doesn't know these aliens by name, only by reputation. They attack any outsider who dares to enter their territory, swarming in mass like angry insects. Unfortunately, charting a route around their huge territory isn't feasible, so Janeway opts to stay on course.
In Sickbay, the Doctor can't remember how to complete an operation; the Emergency Medical Hologram's memory circuits seem to be degrading. The only way to help him is to reinitialize his program, but Torres reveals that if she does that, all of the memories the Doctor has acquired in the past two years would be lost, along with much of his personality. Torres transfers the Doctor's program to a holodeck recreation of Jupiter Station, where his database originally had been written. There, they meet a holographic recreation of Dr. Lewis Zimmerman, creator of the EMH. "Zimmerman" explains the Doctor's "meltdown" is understandable, since his program was designed to run for only 1,500 hours.
The crew adjusts Voyager's shields so that the ship can slip through the aliens' sensor net without being spotted. But as Voyager proceeds, one of the tiny alien ships fires a polaron burst that makes the starship once again visible on their sensors. The "swarm" begins to pursue Voyager and the crew assumes battle stations. The small ships attach themselves to the ship and begin draining its energy. Realizing that every vessel in the swarm is connected at some quantum level, the crew is able to create an explosive chain reaction that drives them off long enough for the ship to get through their territory.
With the Doctor's memory degradation becoming worse every minute, Kes convinces the Zimmerman program to graft his matrix onto the Doctor's. The procedure works, although it will be a matter of time before they know if the Doctor retained all of his memories.