The symptoms mentioned by you could suggest a complex partial seizure
You may consult a neurologist
with eyewitnesses who have witnessed these episodes. He may suggest EEG and other tests for diagnosis and then prescribe a medication. It is a treatable condition.
Did you have seizures as a child? Especially when you had fever
in your childhood? Does anyone in your family have epilepsy? Your parents may be able to give you this history.