Plot
Having been rescued by the crew of the Mjolnir in the real world, Neo's body lies in the ship's medical bay. His consciousness is trapped in a subway station named Mobil Ave, a transition zone between the Matrix and the machine world. He meets a "family" of programs, including a girl named Sati. The "father" of Sati tells Neo the subway is controlled by the Trainman, a program loyal to the Merovingian. When Neo tries to board a train with the family, the Trainman refuses and overpowers him.
In the Matrix, Seraph, Morpheus, and Trinity confront the Merovingian and force him to release Neo's consciousness into the Matrix. Neo visits the Oracle, who reveals that Smith intends to destroy both the Matrix and the real world. She says that Smith is Neo's "opposite", resulting from the Matrix attempting to balance itself, and that "everything that has a beginning has an end". After Neo leaves, a large group of Smiths arrives to assimilate the Oracle. She does not resist, and Smith gains her powers of precognition.
Neo returns to his body in the real world. The crews of the Nebuchadnezzar and the Mjolnir find and reactivate Niobe's ship, the Logos. As the captains plan their return to Zion to help its defense, Neo requests a ship to travel to the Machine City. Motivated by her encounter with the Oracle, Niobe offers him the Logos. Neo departs, accompanied by Trinity.
Bane, whose consciousness has been secretly assimilated by Smith and who has stowed away on the Logos, takes Trinity hostage. Neo realizes Smith has assimilated Bane and, in their fight, Bane blinds Neo with a power cable. Neo discovers he can still "see" machine source code in the real world and uses this ability to kill Bane. Trinity pilots them to the Machine City.
Zion's shipyard is overwhelmed by a horde of Sentinels. Niobe and Morpheus rush toward Zion in the Mjolnir to aid the human defenses. After crashing through the half-open gate, the Mjolnir crew discharge its EMP, disabling all the Sentinels present but also Zion's remaining defenses. The humans are forced to retreat and wait for the next attack, thinking it will be their last stand.
The Logos approaches Machine City and is besieged by machines. Neo shuts several of them down using his newfound powers but passes out from exhaustion. To avoid their attackers, Trinity flies above them, briefly glimpsing the open sky before crashing. Impaled in the crash, Trinity declares her love for Neo before dying. Neo enters the Machine City and encounters the machine leader, the "Deus Ex Machina". Neo warns them that Smith threatens both the machine and human worlds. He offers to stop Smith in exchange for peace between humans and machines. The Deus Ex Machina agrees and the Sentinels pause their attack on Zion.
The machines plug Neo into the Matrix, whose population of humans and programs has now been entirely assimilated by Smith. The Smith-assimilated Oracle confronts Neo, having foreseen that he will be the one to defeat Neo. After a protracted fight, Smith recalls a vision and tells Neo that "everything that has a beginning has an end", unknowingly repeating what the Oracle had said to Neo earlier. This appears to cause Neo to concede defeat and allow himself to be assimilated. In the Machine City, pulses of energy surge into Neo's body, which destroys Smith-assimilated Neo and all the Smiths in the Matrix. This seemingly kills Neo but restores everyone else in the Matrix, including the Oracle. The Sentinels withdraw from Zion and the city rejoices.
The Matrix is rebooted. The Architect confronts the Oracle, scolding her for having "played a dangerous game", but begrudgingly concedes that those who desire to leave the Matrix will be freed. After the Architect leaves, Seraph asks the Oracle if she had always known Neo would save them. She replies that she did not, but she believed.