Prior to Kingdom HeartsEdit
In the pursuit of knowledge, Xehanort, at the time calling himself "Ansem", willingly gave his heart to the darkness, creating both his Heartless and his Nobody, Xemnas. His Heartless was able to retain its selfhood for uncertain reasons, though it was believed by the true Ansem that this was due to Xehanort's willing abandonment of his heart.
He and legions of Heartless at his command continued his original self's pursuit of knowledge, believing it would be found in darkness, and stole countless hearts from both humans and worlds in search of this knowledge. But his ultimate goal was Kingdom Hearts, a supposed repository of tremendous power and knowledge. However, to access the heart of all worlds, he would need to open the Final Keyhole. For this, the Princesses of Heart were needed to complete the Keyhole. He also realized that the wielder of the legendary Keyblade needed to be found, for the Keyblade's ability to seal away the hearts of worlds from the preying Heartless could prove dangerous. So, believing that the Princesses and the Keyblade wielder are connected, he sent Kairi, a supposed resident of The Radiant Garden, as well as a Princess of Heart, to another world, a world where a future Keyblade wielder lived and Xehanort's original home. As he waited for his theory to be proven, Ansem continued on his path towards stealing many hearts.
Ansem, after ten years of being a Heartless, appears in a brown robe by the Destiny Islands Keyhole before the world's fall into darkness, insulting Sora's ignorance of what was to come, and completely ignoring Sora's questions.
The villain appears again to Riku, after his loss to Sora at Hollow Bastion. Shaken by his loss of control over the Keyblade to Sora, Riku lets himself be influenced by Ansem and his promise of power. Riku then lets his heart open up to the darkness, allowing Ansem to possess him.
Firmly in control of Riku's body, Ansem creates the artificial Keyblade of People's Hearts from six of the Princesses of Heart's hearts. This Keyblade possesses the power to unlock hearts, a property he soon tests on Maleficent, transforming her into a gigantic dragon. The dragon is felled by Sora and his friends, leading the Heartless to comment that the dark fairy was arrogant to believe that she manipulated the Heartless when it was actually the other way around. He insults Maleficent and takes his leave, waiting for Sora in the chamber of the Final Keyhole.
Sora arrives, finally reunited with Kairi, though she is comatose due to the loss of her heart. Ansem comments that she lacks a heart, and from his impersonal comments and unusual nature, Sora realizes that who he sees as Riku is not truly the friend he knew. Riku introduces himself as "Ansem, Seeker of Darkness". The Heartless goes on to explain that Kairi's heart is in Sora, and that his dark Keyblade is necessary to remove the imprisoned heart. Sora refuses to agree with the plan and they battle. Sora wins the duel, and Ansem retreats. However, his efforts are not in vain, as Sora stabs himself with the dark Keyblade, in order to free Kairi's heart as well as the six other Princesses. But this ends up opening the final Keyhole and the way to Kingdom Hearts, as well as the loss of Sora's heart and his brief transformation into Sora's Heartless.
Ansem shortly returns, having expelled Riku's heart and shaped his body into one resembling his original human self. Now that the final Keyhole is open from Sora's sacrifice, he plans to kill Kairi now that her purpose in his plans has been fulfilled. Donald and Goofy bravely make a stand against Ansem in order to protect Kairi, but both know that, without Sora, they may not be able to stop him. Before he can dispose of the three, Riku projects himself from Xehanort's stolen body and manages to establish enough control to stop the Heartless in his tracks, allowing Donald and Goofy to escape with Kairi. This leads to an internal struggle between the two that Riku ultimately loses. His heart is forced out of his body, and Ansem completely takes control. Ansem then allows himself to be enveloped by the darkness flowing out of the Keyhole, and travels to the End of the World and Kingdom Hearts.
As Sora, his humanity having been restored by Kairi's light, arrives at the remnants of Destiny Islands at End of the World, Ansem appears, bearing Riku's form. He explains the fall of Riku to darkness, that he desperately sought to escape the island "prison" enough to open his heart to darkness. Afterwards, Ansem explains his philosophy: that worlds and hearts begin and end in darkness. Thus, darkness is the heart's true essence. Sora denies this, in words and in battle, with Ansem. During the battle Ansem summons both his familiar, the Guardian Heartless, and a Darkside Heartless to assist him. As the battle rages on, Ansem leads the trio to the endless abyss where the Door to Darkness resides. This time, Ansem merges himself to the World of Chaos, a monstrous Heartless ship, and captures Donald and Goofy, though Sora rescues them.
After several more rounds of combat, Ansem, weakened, opens the Door to Darkness, imploring Kingdom Hearts to fill him with the power of darkness so that he can gain enough power to destroy Sora, Donald, and Goofy and shroud the universe in darkness. However, Ansem is horrified to see light pour out of the door. The overwhelming light of Kingdom Hearts envelops and destroys Ansem, allowing Riku to take back his body.
Kingdom Hearts: Chain of MemoriesEdit
However, because Riku served as the host for Ansem, a piece remains even after his destruction by the light of Kingdom Hearts. This bothers Riku greatly, who ends up in Castle Oblivion thanks to his heart resonating with Sora's, who is also in the castle.
Guided by a mysterious voice, Riku climbs through the basements of Castle Oblivion, trying to rid himself of his darkness. However, Ansem appears early on, intending to overcome Riku, but fails. Still, Ansem remains, and even stirs the darkness in Riku's heart so that he may use it in battle, if he so chooses. The dark being remains confident that Riku will eventually give into the darkness
At times, Riku almost becomes overwhelmed by the darkness, but King Mickey's light continually comes to the rescue, frustrating Ansem. Eventually, Riku overcomes his fear of the darkness, intending to use it as well as the light. He also additionally receives some guidance from the enigmatic DiZ, the true owner of the mysterious voice, who in turn leads Riku to Naminé. Naminé offers to seal away Riku's darkness and Ansem, but he instead chooses to face the Heartless on his own. DiZ then gives Riku a card that will give Ansem form, so that Riku can finish him off once and for all.
Ansem again tries to turn Riku to the darkness completely, and tries to defeat the young boy so that he can take over again. However, though he is defeated, Riku realizes that Ansem still lingers in his heart, and sets off with King Mickey in order to rid himself of the Seeker of Darkness forever.
Kingdom Hearts 358/2 DaysEdit
Though Xemnas, the Nobody counterpart of Ansem, soon becomes the main threat, the dark being still has a presence. In fact, the part of him that lingers in Riku starts to eat away at him, even forcing him to put on a blindfold over his eyes to keep him from "lying to himself".
This comes to a head when Riku travels to The World That Never Was at the behest of DiZ, with the intent to capture Roxas, the Nobody of Sora and a member of Organization XIII, so that the two can join and Sora can awaken from his slumber. However, Roxas proves to be too powerful for Riku to handle, so Riku is left with one option: Riku unleashes the darkness in himself, in order to gain the power necessary to defeat Roxas. However, this has the side effect of giving Riku the appearance of Ansem, as well as manifesting his guardian, which constricts Roxas in its fists and leaves him unconscious. In his new form, Riku mimics Xehanort before him and takes on the name Ansem.
Kingdom Hearts IIEdit
During the Battle of the 1000 Heartless at Hollow Bastion, King Mickey reveals the truth about "Ansem" to Sora, Donald, and Goofy; that he wasn't the real Ansem, but the Heartless of an impostor. While the trio are shocked and dismayed to learn this, Mickey assures them that Ansem still needed to be stopped. He also reveals that the Nobody spawned at the same time as Ansem is the leader of the Organization (as he had met the original Xehanort and been near his Nobody, it "kinda felt like bein' around the same fella.").
Riku remains like this for some time. His new appearance prompts him to refuse making contact with Sora and Kairi, despite him being able to easily do so. Still, when push comes to shove, Riku aids his friends, but never reveals himself as Riku (though Sora begins to suspect his mysterious helper's true identity), secretly leaving clues for Sora, Donald, and Goofy to find. He also took a proactive stance in aiding the people of The Land of Dragons, and briefly engaged Sora in battle before going to speak with The Emperor and informing him that Sora and his friends would be coming to help them deal with a Heartless dragon created by Organization XIII. But when Naminé chooses to use Riku's true name after he rescues her and Kairi from the Organization at The World That Never Was, things take a turn. Kairi, in her excitement, removes Riku's hood, only to see the face of the one who had endangered her a year ago. Still, she sees Riku underneath the dark form, and takes it in stride.
Riku is also forced to meet Sora when Kairi prevents him from taking his leave when Kairi and Sora reunite. At first, Sora does not realize it is Riku, refers to him as "Ansem", and informs him that he is grateful to him for Kairi's rescue while still enraged at the very thought of the evil deeds he had committed. Kairi helps him see through his altered form. They all then travel through the Nobody castle, and end up reuniting with King Mickey and DiZ, whose true name is Ansem the Wise. However, the machine that Ansem was using to encode Kingdom Hearts into data ends up exploding, allowing Riku to regain his true form. "Ansem" and his hold on Riku's heart are thought to be destroyed at this point, as the explosion's light fully restores Riku to the extent that he is robbed of his ability to open corridors of darkness.
Kingdom Hearts codedEdit
Ansem appears in a memory from Jiminy's Journal in Destiny Islands, opening a Corridor of Darkness for Riku to Hollow Bastion.
Kingdom Hearts 3D: Dream Drop DistanceEdit
It is revealed, that before possessing Riku, Ansem went back in time and met an alternate version of his younger self on Destiny Islands. He tasked Young Xehanort with gathering together 12 different versions of themselves from time/space to make up the thirteen hearts of darkness Master Xehanort needed to create the X-blade, giving him the power to move through time.
While Sora and Riku wander through the worlds in the Realm of Sleep, Ansem appears before them a few times, having been brought from the past/alternate past. In The World That Never Was, he sits to Master Xehanort's right, making him Number 3, and is the one who holds Riku down to prevent him from saving Sora from being the thirteenth vessel for Master Xehanort's heart fragment. However, when Lea, Donald and Goofy arrive, he flees along with his other selves.
Against Sora's TeamEdit
Ansem began to enrage more after Sora's victories, and gaining more allies. He keeps coming up with plans to finish them off and take over Kingdom Hearts.