Prague, the beginning of the century. The narration is conducted in the first person. The hero is either sleeping or awake. A moon beam falls at the foot of his bed. The hero feels that his sleeping body is lying in bed, and “feelings have separated from the body and are no longer dependent on him” ...
Suddenly he finds himself in the gloomy courtyard of the Prague ghetto, sees his neighbors - the fourteen-year-old red-haired Rosina and the man with round fish eyes and bifurcated cleft lip - junk Aaron Wassertrum, Rosina tries to attract the attention of the hero, one of her twin brothers is jealously watching her, the teenager Loise (however, the other brother, the deaf-mute Jaromir, is also obsessed with a passion for Rosina). The hero is in his closet. Wassertrum looks at the walls of the neighboring house, adjacent to the hero's window. What can he see there? After some time, from behind the wall, a joyful female laugh is heard from a neighboring studio. The hero immediately recalls that his acquaintance, puppeteer Zwak, rented his studio a few days ago to a “young important gentleman” so that he could meet his lady of heart without spies. The female laughter behind the wall evokes the hero’s vague recollections of a rich house, where he often had to restore expensive antiques. Suddenly, a piercing scream is heard nearby, then the creak of an iron attic door. A young woman, pale as death, bursts into the room, shouting: “Master Pernat, for Christ's sake, hide me!” For a second the door swings open again, behind it is the face of Aaron Wassertrum, looking like a scary mask.
A spot of moonlight at the foot of his bed reappears before the hero. Athanasius Pernath - why does he know this name? Once upon a time he confused his hat with a stranger (and it fit him just right). On its white silk lining in gold letters was written the name of the owner - “Athanasius Pernat”.
The hero again feels himself a Pernate. An unknown engraver comes to him, a restoration engraver, and brings a book in which to correct the initial, made of two sheets of thin gold. The bird begins to leaf through the book, amazing visions arise in front of him. One of them is a pair of woven in the arms of a couple, before his eyes took the integral form of a half-man, half-woman, hermaphrodite, and sitting on a mother-of-pearl throne in a mahogany crown. Having woken up from visions, Pernat wants to find the man who brought the book, but he disappeared. Pernat tries - and cannot - remember his appearance. Just imagining himself in his place, Pernat feels that he is becoming like him: a beardless face, bulging cheekbones, slanting eyes - this is a Golem! There is a legend about the Golem. Once upon a time, one rabbi according to the canons of Kabbalah made clay of an artificial person, the Golem, to help him as a servant. The golem eked out a miserable semi-conscious existence and came to life only when the rabbi put a note with magic signs into his mouth. Once, when he forgot to take it out, the Golem became furious and began to destroy everything around. The rabbi rushed to him and took out a piece of paper with signs. Then the idol collapsed dead to the ground. They say that he appears in the city every thirty-three years.
Pernat sees himself in the courtyard, next to him is a student Harouzek in a shabby summer coat with a raised collar. The student hates the old man and assures Pernat that it is he, Harouzek, who is to blame for the death of the old man, doctor Vassori, an eye quack doctor (Wassertrum blames Dr. Savioli for this). Savioli is the name of a young gentleman who rented a room next to Pernat's closet.
Pernat receives a letter from a woman whom he recently rescued from a junkman. She asks him to meet. Angelina - that is the name of the woman - remembers Pernat from childhood. Now she needs his help: the junkman Wassertrum wants to bring the sick doctor Savioli to suicide. Angelina is married, she is afraid that her husband will find out about her betrayal, and gives Pernat his correspondence with Savioli for storage.
Next to Pernat lives Shmaya Hillel, an archivist in the Jewish town hall, with her beautiful daughter Miriam. Miriam is pure in soul and lives in anticipation of a miracle that will transform life. At the same time, expectation is so dear to her that sometimes she wants a miracle not to happen. In his visions, Pernat feels himself a Golem, and Shmaya Hillel seems to him a rabbi-master, and this peculiarly colors their real relationship. The bird carves a cameo on a moonstone with a portrait of Miriam, which reminds him of the image of an ancient book that excited him so much. Pernat loves Miriam, but still does not realize this, and before he understands, much more will happen: meetings with Angelina, Harousek's feverish speeches, full of hatred for Wassertrum (as it turns out, the junkman is his father); Wassertrum's machinations, as a result of which Pernat goes to jail on false charges; his mystical communication with Miriam, many visions that visited him ...
After leaving prison, Pernat rushes to look for Shmaya Hillel and his daughter and sees that the quarter is destroyed, reconstruction of this district of the city is underway. The Pernat cannot find his friends either - the puppeteer Zwak, the blind Neftali Shafranek. In the absence of Pernat, the junkman Wassertrum died, and the student Harouzek committed suicide on his grave, bequeathed a third of the inheritance from Pernath to Wassertrum.
Pernat is going to spend this money on the search for Shmai Hillel and his daughter. In the meantime, he rents an apartment in the only house untouched by reconstruction in the entire quarter - in the same one where, according to legend, the Golem was sometimes seen. At Christmas, when Pernat sits by a lighted Christmas tree, his double appears to him - the Golem. The house starts a fire. The bird descends down the rope, he is seen in one of the windows of Hillel and Miriam, he happily calls out to them ... and breaks off the rope.
Suddenly the hero comes to his senses: he lies on a bed at the foot of which is a spot of moonlight. And Pernat is not his name at all, it is written on a white silk lining of a hat, which he confused the day before with his in the cathedral in Hradchany. The hero is trying to follow in the footsteps of Pernath. In one of the zucchini nearby, he finds out that he married Miriam. Finally, after a long search, the hero finds himself at the house of Pernat near the “Wall at the last lamp”, “where no living soul can live.” On the bivalve gate - the hermaphrodite god on the mother-of-pearl throne. The old servant, with silver buckles on his shoes, in a frill and an old-cut frock coat, takes his hat, and in front of the hero in the span of the gate appears a garden and a temple-like marble house, and on the steps are Atanasius Pernat and Miriam. Miriam is as good and young as in the hero’s dream, and Pernat’s face seems to the hero as his own reflection in the mirror. The servant returns and gives the hero his hat.