Agnel was born in Nîmes in 1992, the son of a nurse and a liberal director of human resource. He was named after French tennis player Yannick Noah. Agnel began swimming at the age of eight after a neighbor spotted his talent and urged his parents to enroll him in a swimming club.
In April 2010, Agnel set the French record in the 200-meter freestyle with a time of 1:46.35 to beat Amaury Leveaux's record of 1:46.54. In June 2010, he improved his record in the 200-meter freestyle with a time of 1:46.30.
At the 2011 World Aquatics Championships in Shanghai, Agnel competed in three events. In his first event, the 400-meter freestyle, Agnel finished in 6th place with a time of 3:45.24. In his second event, the 200-meter freestyle, Agnel finished in fifth place with a time of 1:44.99, a new French record. Agnel won his only medal of the competition, a silver, in the 4×200-meter freestyle relay. Teaming with Grégory Mallet, Jérémy Stravius, and Fabien Gilot, their team had a final time of 7:04.81, a new French record. The United States finished 1st with a time of 7:02.67.
At the 2012 Summer Olympics in London, Agnel won a total of three medals: two golds and one silver. In his first event, Agnel anchored a come-from-behind effort in the 4×100-meter freestyle relay to win gold with Amaury Leveaux, Fabien Gilot, and Clément Lefert. Diving in with a 0.55 s deficit, Agnel was able to cut that down to a 0.30 s deficit at the 350-meter mark. In the last 50-meters, Agnel pulled ahead of American Ryan Lochte and France won with a time of 3:09:93 to the United States' time of 3:10:38. Agnel swam the fastest split time of the entire field with a time of 46.74, the only individual to break 47 seconds. The next day, Agnel won his second gold medal in the 200-meter freestyle with a time of 1:43.14, the fastest in French swimming history and 1.79 seconds ahead of silver medal winners Sun Yang and Park Tae-Hwan. In the final, Agnel led from start-to-finish, recording a time of 50.64 in the first 100-meters and 52.50 in the last 100-meters. His time of 25.98 for the last 50-meters was by far the fastest in the field. Agnel won his final medal, a silver, in the 4×200-meter freestyle relay behind the United States with Amaury Leveaux, Grégory Mallet, and Clément Lefert. He had the fastest split time of the field in the final with a time of 1:43.24 as the anchor leg. In his final event, the 100-meter freestyle, Agnel finished fourth in a personal best time of 47.84, 0.04 s of a second outside the medals. The European Swimming Federation named Agnel male European swimmer of the year 2012.
On November 15, 2012, Agnel broke his first world record in the 400-meter freestyle with a time of 3:32.25 during the first day of the French short course nationals in Angers. In doing so, he bettered the previous record held by German swimmer Paul Biedermann (3.32.77) established in 2009 with a full bodysuit. A day later, he set the European record in the 800-meter freestyle and on November 18, Agnel just missed Biedermann's world record in the 200-meter freestyle (short course).