As "Rikki-Tikki-Tavi" opens, Rikki-tikki, a young mongoose, is washed away from his parents in a flood, and is found by a young boy who believes him to be dead. The boy (whose name is Teddy) takes him back to his parents, where Rikki-tikki will be revived. He proceeds to quickly acclimate to his new surroundings in their home.
Later, the young mongoose will go to the garden, where he meets Darzee and his wife (two tailor-birds who have a nest there) as well as Nag the cobra, who terrorizes the garden. As he and Nag confront one another, Nag's wife, Nagaina, attacks Rikki-tikki by ambush, with the mongoose narrowly evading. When Teddy is threatened by another venomous snake, Karait, Rikki-tikki kills the snake, much to the relief of the human family.
After Teddy goes to sleep, Rikki-tikki overhears Nag and Nagaina as they conspire to kill the humans, to regain their former dominance. (It is from this conversation that he also learns that the cobras have eggs that are close to hatching.) Nag then hides himself in the bathroom, intending to kill the father when he is bathing. Rikki-tikki attacks Nag after Nag falls asleep, leaving only Nagaina and the eggs.
The next morning, Rikki-tikki attempts to employ Darzee as a distraction against Nagaina so he can kill her children before they hatch, but Darzee's wife provides the distraction itself. The mongoose returns, holding the last egg, to find Nagaina threatening Teddy. His return allows Teddy to be removed from immediate danger. The cobra and mongoose fight, with Rikki-tikki defeating Nagaina.