A probe sent to a distant planet has sent some interesting images back to Earth. Carved in the walls of P3R-272 are a set of characters that resemble one of the four languages inscribed on the wall at Heliopolis -- a great meeting place of four ancient races, discovered by SG-1 more than a year ago ("The Torment of Tantalus").The meeting hall -- where Daniel Jackson discovered invaluable "meaning-of-life" sorts of things -- was destroyed, but SG-1 retained some records of the room. Daniel theorizes that one of the four languages is that of the Asgard, a powerful alien race who oppose the Goa'uld ("Thor's Chariot"). It stands to reason, then, that the other three races are their allies and also oppose the Goa'uld. SG-1 gates to the planet where the symbols of one of the other three races has been found.
They find strangely little: just a small room with bare walls and a circle of light in the center. With no apparent way out, they move to leave. But as Jack O'Neill steps through the circle of light, a viewing port of some sort opens up on the wall. Teal'c looks inside, and sees darkness filled with colorful lights.
O'Neill looks next, and the device reaches out of the wall and grabs his head. He is held stationary for several moments, then released. O'Neill collapses to the floor in a catatonic state.
SG-1 hurries back to Earth, where O'Neill regains consciousness a few hours later. Dr. Fraiser can find nothing wrong with him, but Jack is encouraged to take things easy for a few days.
It isn't long before he begins acting strange. During a briefing, O'Neill casually substitutes the word "cruvis" for the word "wrong." Later, while sparring with Teal'c in the gym, he refers to legs as "kozars." More and more, Jack is unwillingly speaking an ancient, alien language that he does not know. Daniel finds a linguistic connection to medieval Latin, and can eventually interpret most of what Jack is saying.
The team soon finds O'Neill sitting at the computer terminal in the Stargate control room, entering new data at a tremendous speed and rewriting massive amounts of computer code. When he has finished, he has expanded the Stargate database to include many new gates throughout the universe, with addresses not even present on the Abydos Cartouche from which all other known gate addresses are calculated ("Children of the Gods").
O'Neill has not only become the repository of an alien language, but of an entire database of ancient alien knowledge. Fraiser determines that his brain is operating at over 90 percent capacity -- nearly ten times normal.
Frustrated, Jack eventually loses the ability to speak in anything but the alien language. He doesn't entirely understand it himself, and he feels compelled to go "somewhere" through the Stargate.
SG-1 begins to send probes and SG teams to the new planets entered by O'Neill, in hopes of finding some connection to the ancient alien race, to help O'Neill. The alien database inside his mind is threatening his life as it continues to progress. When one probe finds more of the alien text enscribed on a tablet on another planet, Teal'c and Carter (accompanied by two other S.G.C. officers) go through the gate to investigate.
While they are gone, Jack is compelled to build something. He works on it for hours, and finally completes the small machine. He does not know what it is or what is does, nor does anyone else.
Hammond soon learns that Teal'c, Carter, and their team is in trouble. The probe did not detect the presence of a second sun, which will soon raise the planetary temperature to nearly 200 degrees Fahrenheit. When the group tried to dial home, the D.H.D. malfunctioned and became stuck in mid-dial.
Only Colonel O'Neill can find a solution to the problem. The knowledge in his head is that of "the Ancients," Daniel surmises -- the builders of the Stargate transit system. Because of this latent knowledge of the gates, O'Neill draws schematics of the dial-home device with instructions for fixing a mid-dial lockup.
Carter and company return alive and well, but unsuccessful in finding a way to help Jack. But soon he has found his own solution. O'Neill hooks up his finished device -- a power generator, apparently -- to the Stargate power system. The computer begins to automatically dial a new address, and command personnel cannot regain access to the computer.
But the seventh chevron locks, and amazingly, it is not the point of origin. The gate continues to dial to an eighth chevron, and engages a wormhole. Having never seen such a thing before, Carter theorizes that the extra chevron may be used to gate to a world that is farther away -- even another galaxy.
O'Neill goes through the gate alone, and ends up on an Asgard world. The advanced aliens recognize that he is speaking the language of the Ancients, and kindly remove the knowledge from his mind. O'Neill is thankful, and engages in a profound dialog with the aliens -- "meaning of life" stuff.
The Asgard confirm Daniel's theory: there was once an alliance of four great races in the galaxy. These were the Asgard, the Nox ("The Nox"), the Furlings, and the Ancients -- the builders of the Stargates. Humans have much to prove, Jack is told, but they have taken the first step toward becoming "the fifth race."
Jack returns to Earth, his mind restored -- along with his faith in the future of humanity.