If memory serves clause
The phrase is sometimes extended to “if my memory serves me correctly/right/rightly”.
If my memory is accurate
Her name is Anne, if memory serves.
If my memory serves me right, they got married 3 years ago.
Used to indicate that it is very easy to guess something
Relying on guessing and luck
Doing something but having no initial plans or estimation.
The speaker uses this phrase to admit that he or she has learned something by an unconventional way.