The story begins with a poem that hints at the future action but the actual story begins with Rikki Tikki Tavi being washed from his parents' home to a strange garden where he is rescued by a little boy named Teddy and his family and they take care of him.
Rikki-Tikki-Tavi quickly forms a bond with the family and begins to explore their bungalow and the garden and quickly decides that part of his job is to protect the family. He then meets Nag and Nagaina, a pair of king cobras who live in the garden and are determined to drive away this dangerous new resident. Helped by the bird Darzee, Rikki-Tikki-Tavi manages to fight both snakes and defeat them but they withdraw before he can kill them.
Rikki-Tikki-Tavi manages to save Teddy from a sand snake and his place in the family is assured. But he knows he must also stop Nag who has hatched a plot to kill the family. Rikki-Tikki-Tavi kills Nag, then stops Nagaina from taking her revenge on the family, eventually killing her in their lair and destroying the last of the king cobra eggs.