Introduction
Valmiki is the sage traditionally regarded as the author of the Ramayana and as the first poet (adi kavi). He also appears within the story as the sage who gave shelter to Sita and raised her sons Lava and Kusha.
This article primarily follows the Valmiki Ramayana. Where a well-known detail comes from a later retelling or tradition, the article identifies it.
The first verse
According to the Bala Kanda, Valmiki asked the sage Narada who the ideal man was, and Narada told him the story of Rama. Later, while bathing at a river, Valmiki saw a hunter shoot one of a pair of mating krauncha birds. Filled with grief, he spoke a curse in a new metre, the shloka. Brahma appeared and told him that this was to be the metre in which he would compose the story of Rama.
In the story
In the Uttara Kanda, Sita was left near his hermitage, and he gave her a home. He taught Lava and Kusha the Ramayana, and brought them to Ayodhya to sing it before Rama.
Origins
In the text, Valmiki calls himself a son of Prachetas. A later and popular tradition says he was a highway robber named Ratnakara who changed his life after meeting sages, meditated so long that an anthill (valmika) grew around him, and so took the name Valmiki. This story is not in the Ramayana itself.