In 1992, junior high students Miaka Yuki and Yui Hongo go to the library after school. While the manga and anime storylines cover the same plot points around the library, some details are cut from the anime adaptation.
Stopping at the library after school, Yui picks up a textbook at the front desk while Miaka goes to a vending machine inside. There, Miaka witnesses a brilliant red bird soar up the stairs into the restricted section of the building. The two girls enter the room and a red book falls to the floor. It is old and written in ancient Mandarin. Luckily, Yui can decipher it and they discover it is called the Universe of the Four Gods.
They are suddenly engulfed in a bright red light and taken inside the pages of the book. After an encounter with slave traders and Tamahome, Yui is sent back to the library and reads along in the library as Miaka navigates the ancient world.
Connected by their school uniforms, Yui feels the same physical experiences as Miaka as she is reading. When Miaka stabs herself in the chest while trapped in Taiitsukun's mirror, Yui receives the wound as well and she begs for Miaka to stay alive. Taiitsukun soon transports Miaka back to the Real World but Yui is sucked inside the book. Miaka wakes up in an empty classroom of her school.
Realizing her friend is missing, Miaka returns to the library with a packed bag and enters the book once more, disappearing in front of Keisuke. In the library, he reads along and does extensive research about the book with his friend, Tetsuya Kajiwara, for the majority of the series.
At the library, while exchanging notes with Yui before cram school, Miaka drops her pen and follows it to the door of the restricted section. The girls enter it and the building begins to tremble. Yui suspects it is an earthquake but when the rumbling stops, a book falls from the shelf. It is a Japanese translation of a Chinese legend written by Einosuke Okuda. They begin to read but another shock wave violently shakes the room. When the two girls open their eyes, they are inside the book.
They return to the library together in a similar manner after being saved by Tamahome. Yui theorizes that they were knocked out during the supposed earthquake. They are interrupted by a furious librarian and, the next day, Yui wants to return to the library with Miaka, who declines and heads to Daichu Prep School. That night, when a fight breaks out at home, Miaka returns into the library and is sucked inside the book once again.
Miaka is transported back to the library only for a second when she begins to glow in the streets of Konan. A librarian enters soon after and finds the book open on the ground. He shuts it and puts it back on the shelf, effectively sealing her inside the book for the time-being.
While out searching for the missing Miaka, Yui hops the gate of the library and is caught by a security guard whom she promptly kicks in the face. But as she turns to run, she receives the same stab wound Miaka gives herself in the book and collapses on the steps, spooking the guard. Bleeding, Yui drags herself through the entrance and into the restricted section. She opens the book, pleading with Miaka not to die. After the wound is healed, she begins to read along with the story, but only for a short time.
Outside the restricted section, the police arrive and pound on the door. Yui shouts for Miaka to return to her world as Taiitsukun begins the ceremony to transport her home. Just as the officers get the door open, Yui is sucked inside the book and Miaka wakes at her school.
After realizing Yui is missing, Miaka rushes into the library along with Keisuke and knocks over a maintenance worker who is attempting to fix the lock on the restricted section. She promptly enters the book once more, much to her brother's surprise. Over the course of the manga, Keisuke carries the book around with him. He reads it occasionally but he is not as involved in following Miaka's story as he is in figuring out the origins of the book with Tetsuya.
In OVA 1, the Universe of the Four Gods goes missing from the National Library. It is revealed that Yui, unknowingly swayed by Tenkou, stole the book. The demon god hoped and correctly predicted that the longer people from the real world are in the book and vice versa, the link between the two worlds would weaken.