Olympic champion Agnel led Phelps only narrowly after 100m but extended his lead in the second half of the race to clock 1:46.99.
Phelps was second in 1:48:20, more than five seconds slower than his American record of 1:42.96, set at the 2008 Olympics.
“I got left like I was standing still in the last 50 by this guy,” Phelps, standing next to Agnel, told Universal Sports, describing it as his `slowest 50 ever`.
Phelps, 28, is back at sea level after a stint of altitude training and is using the northern California meet, his third since coming out of retirement, as part of his preparation for the U.S. nationals in August and, hopefully, the Pan Pacific Championships in Australia later the same month.
He tied for first in the 100m butterfly on Friday, and was second in the 100m freestyle.
Phelps stayed with Agnel for the first half of Saturday`s final in the outdoor pool, only 0.04 behind after 100 metres.
But Agnel pulled 0.36 clear at the final turn and Phelps barely held on for second place, slowing noticeably over the final 50m.
Phelps is scheduled to swim the 200m individual medley on Sunday.
In other events, American Elizabeth Beisel notched an impressive double, winning the 400m individual medley in 4:33.52, the fourth fastest time in the world this year.
Less than an hour later, she won the 200m backstroke in 2:09:11, the seventh fastest world time of 2014.