EnterpriseCaptain Picard (Patrick Stewart) has always been a student of archaeology, and in this episode he is contacted by his former mentor Professor Richard Galen (Norman Lloyd). The professor, who Picard said is "like the father who understood me", states that he has come across something in his travels which could be the most profound discovery of their time. Galen, however, will not tell him about what he has found unless Picard agrees to go with him, which means leaving the Enterprise and his career in Starfleet behind. Picard ultimately declines, although he is torn about disappointing his former mentor, who in anger remarked that Picard's job was like that of "A Roman centurion .... maintaining a dull and bloated empire".
Shortly after angrily leaving the Enterprise, Galen's transport vessel is attacked and boarded. When the Enterprise arrives, Galen is beamed to Sickbay and has just enough energy before he dies to apologize for his earlier rude remarks, saying "Jean-Luc, I was too harsh" with his dying breath. Picard is fueled by this event and decides to assume Professor Galen's research. An investigation of Galen's ship yields no results other than a series of seemingly random number blocks.
After studying the ambiguous number blocks for hours, the discovery is made that these fragments are compatible DNA strands which have been recovered from different worlds all over the galaxy. The crew eventually believe that they have discovered an embedded genetic pattern that is constant throughout many different species, and it is speculated that this was left by an early race that pre-dates all other known civilizations. This would ultimately explain why so many races are humanoid.
Picard resolves that the answer to the 'puzzle' will be revealed when the remaining DNA samples are obtained, and so the Enterprise travels to a remote, uninhabited planet that Galen had mentioned was his next destination. They encounter Klingon and Cardassian ships that appear to be on the same trail as themselves. These two groups believe, respectively, that the puzzle will yield the design of a formidable weapon and the secret of an unlimited power source.
The Enterprise hosts representatives from the Cardassians and the Klingons, and they all agree to combine the DNA samples that they have found so far, since all three parties have pieces of the puzzle that the others cannot find. Using the shared information, they determine a pattern in how several planets were aligned millions of years ago and extrapolate the position of a final planet.
The Cardassians warp off ahead of the others, firing at both ships to disable them. However, Picard had already learned of the Cardassians' attempt to sabotage the Enterprise 's defenses; the ship is fully functional, and he takes the Klingon captain to the last planet. Upon arrival, they discover that almost all life is extinct, but scans by the Enterprise detect residual lichens located on a fossilized seabed, and they beam down to investigate with their tricorders containing all previously known information. The Cardassians arrive, as well as an undetected Romulan force, creating a standoff. Reasoning that the seabed may not be completely fossilized (and thus still containing some DNA), Picard and Dr. Crusher (Gates McFadden) scan the sea-bed with their tricorder while the other parties argue.
They locate the final DNA fragment, which completes and runs the program. The program reconfigures the tricorder's emitter to project a holographic message. The recorded image of an alien humanoid (Salome Jens) is projected to the assembled company, and it explains that its race is responsible for the presence of life in the Alpha Quadrant. When the alien race first explored the Alpha and Beta Quadrants there had been no humanoid-based life other than themselves, and so they seeded various planets with their DNA to create a legacy of their existence after they had gone. The alien ends its message by saying that it hopes that the knowledge of a common origin will help produce peace.
The Cardassians are outraged at this (considering themselves a superior race), as are the Klingons (who hate the Romulans and are disgusted to be related to those "without honor"). Only the Federation representatives seem optimistic. The episode ends with all parties diverging, but the Commander of the Romulan ship contacts Picard and hints that "One day..." [there may be peace].