Nagas are serpent beings of Indian tradition, a class rather than an individual, associated with water, with the subterranean realm called Patala, and with treasure, fertility and hidden knowledge; they can take human form and are ruled by kings such as Vasuki, Shesha and Takshaka. They are ambivalent rather than evil: they send the rains and guard wealth, but a broken taboo or an insult brings drought, snakebite or flood. Shesha (Ananta), the cosmic serpent of a thousand heads, supports the god Vishnu as he sleeps on the ocean between the ages, and serpent-worship (naga-puja) remains a living village practice across South Asia, with stone naga-images set beneath sacred trees and festivals such as Nag Panchami.
The Mahabharata supplies the fullest Puranic account of the nagas' origin and near-destruction: born as the many sons of the sage Kashyapa's wife Kadru, the serpents lost a wager with their co-wife Vinata (mother of Garuda) and were made her servants, a grievance that runs through their later enmity with Garuda's line. Generations on, King Janamejaya, avenging his father Parikshit's death by the naga Takshaka's bite, undertook the great snake-sacrifice, the sarpa satra, intended to exterminate the entire naga race by drawing them into a sacrificial fire; the rite was halted only when the sage Astika, himself of mixed naga and Brahmin descent, intervened and won its termination.