Agattiyam (), also spelled as Akattiyam, according to Tamil tradition, was the earliest book on Tamil grammar. It is a non-extant text, traditionally believed to have been compiled and taught in the First Sangam, by Agattiar (Agastya) to twelve students. A few surviving verses of Akattiyam are said to be quoted in medieval commentaries. Sage Agattiyar (Agastya), in medieval commentaries of Tamil Hindu scholars, is variously credited with either creating the Tamil language or learning it from the god Siva. In contrast, according to medieval era Tamil Buddhist scholars, the sage learned Tamil from Avalokita. These legends are mentioned in Akitti Jataka and in Tamil Buddhist epics. There is no direct mention of the sage's name, or Agattiyam text, in Tolkappiyam or the bardic poetry of the Sangam literature. Tolkappiyar (epithet), the author of Tolkappiyam, which is the oldest extant Tamil grammar, is believed by various traditions to be one of the twelve disciples of Agattiyar. Tolkappiyar is believed to have lived during the Second Sangam and to be the author of the Tolkappiyam that has survived. The context of the Agattiyam is in the sangam legend. Sangam literally means "gathering, meeting, fraternity, academy". According to David Dean Shulman – a scholar of Tamil language and literature, the Tamil tradition believes that the Sangam literature arose in distant antiquity over three periods, each stretching over many millennia. The first has roots in the Hindu deity Shiva, his son Murugan, Kubera as well as 545 sages including the famed Rigvedic poet Agastya. The first academy, states the legend, extended over 4 millennia and was located far to the south of modern city of Madurai, a location later "swallowed up by the sea", states Shulman. The second academy, also chaired by a very long-lived Agastya, was near the eastern seaside Kapāṭapuram and lasted three millennia. This was swallowed by floods. From the second Sangam, states the legend, the Akattiyam and the Tolkāppiyam survived and guided the third Sangam scholars. Agastya convened this session and wrote Agattiyam. Agastya is one of the seven revered rishi of the Vedic literature, mentioned in the Rigveda. Surviving verses A few verses from Agattiyam have been quoted in medieval commentaries of the Tolkappiyam, Yapparunkalam virutti, and Nannūl. The Agattiyam is quoted 18 times in a 13th century commentary on Nannūl by Mayilainātar. However, the authenticity of these verses is uncertain. Kamil Zvelebil states: "In Mayilainātar's commentary on