Sora and company chase the dog for what seems like forever until he comes to a crossroads. He there meets an unknown person in a black hooded cloak. He has a short conversation with this mysterious guy, who says "Ahead lies something you seek, but to find it you must lose something dear" and ends up walking down to a place known as Castle Oblivion. Here Sora begins to lose his memories piece by piece as they are replaced by others while he progresses up the floors searching for Riku and King Mickey because “somehow he knows they are there”. In truth this is only the Organization that inhabit the castle having Namine, a girl that will definitely remind you of Kairi, mess with Sora’s thoughts and feelings. She is the one that made Castle Oblivion appear before him.
Sora proceeds floor after floor and still losing more memories. He finds his way to the top after finding the truth about Namine, who had went so far on Marluxia’s orders as to disrupt Sora’s memories that she now had replaced Kairi with Namine in every aspect of his mind. Sora defeats here Larxene, Axel, and Marluxia, freeing Namine’s hold on his mind. Namine puts him in a sort of “hibernation” that will make him forget everything that happened in the castle, but gain his original memories back. Sora and Namine (he knows who she is now - Kairi's shell) make a promise to meet again someday.