Nine years before the events of the first Kingdom Hearts, Kairi appeared off the coast of the Destiny Islands during a meteor shower. Sora, then five years old, carefully approaches her and asks, "Who are you? Where did you come from?"
Sometime later, Sora and Riku were in the Secret Cave and talking about "the new girl at the mayor's house". This provides the player a kind of insight into her origins: Kairi is not a native of the Destiny Islands, and was adopted by their mayor.
Kairi later became very close friends with Sora and Riku who playfully competed for her attention. She often supported these competitions, although she didn't know they were contests for her affection and not just innocent rivalry. She bears no memory of her life before the Islands, and her mysterious past sparks curiosity in Sora and Riku, who are anxious to leave Destiny Islands and see other worlds. This leads the trio to build a raft in the hopes of traveling to other worlds. However, before they can leave, their Islands are attacked by the Heartless, and Sora finds Kairi in their Secret Cave. She turned towards him, looking sad and a little ill, then a huge gust of wind swept through the cave and Kairi flew towards him. Sora opened his arms to catch her, but she vanished right as she was about to be swept into his embrace. During this time, it is speculated that Kairi's heart chose Sora as a vessel and when she passed through him, her heart was left behind in him while her body vanished to some distance world.
Sora and Kairi watch the sunsetShe then becomes the game's driving force, as much of the game's story centers around Sora's and Riku's attempts at finding Kairi. However, Riku is hostile to Sora (having been manipulated by Maleficent into believing that Sora no longer cared for either Kairi or himself).
Riku finds her first, but she is in a comatose state, with a vacant, lifeless expression and a limp body. She'd lost her heart and because of her Princess status, her body remained untouched by the darkness that usually produced a Heartless. With empty promises by Maleficent, Riku was convinced that he alone could locate Kairi's heart and restore her to health.
In Neverland, Sora finally encounters her, along with a painful reunion with Riku; who is very defensive about her and ends up locking her in a room with Wendy so that Sora can't get to her. When Sora reaches the room below her cell, he extends his hand towards her, desperately hoping for a reaction as he is just now discovering the full lengths of Kairi's condition. Unconsciously, her hand twitches before going still again, much to Sora's relief. Riku then takes her away yet again, having new knowledge of where Kairi's heart is. After the defeat of Captain Hook, Goofy ponders aloud whether or not Kairi had indeed lost her heart, but Donald, not wanting to upset Sora, promptly shushes him. Sora, however, appears to be in denial, pondering over his disbelief that he could fly and whether or not Kairi would believe him.
Their friendship severed for the time being, Sora continues his journey, destined to clash with Riku in the near future once again over Kairi.