I wouldn’t say that Lee was retreating.
Certainly Lee had withdrawn his artillery from the mule shoe salient. He may have thought Grant was getting ready to start another flanking maneuver East. In any event it was a mistake.