Hello thanks for asking from HCM for your health related queries
I can understand your concern. Ambien is Zolpidem and the drug belongs to Z-drugs class. The drug is a shorter acting drug and is usually advised for the the patients of early insomnia or in patients who have difficulty in going to sleep. You are having good onset of sleep but are waking with in 3-4 hours and for this problem of insomnia there is need to add some long acting medicine for sleep. Extended release preparations of Zolpidem are available and can be tried. This will help to maintain about 7-8 hours of sleep and will not cause next morning 
drowsiness.
If that doesn't improve the sleep then other medicines like antidepressants can be used. Doxepine, 
Trazodone, 
Mirtazapine etc drugs are commonly used for poor sleep and help in achieving good sleep. Even long acting benzodiazepines as 
Clonazepam, Diazepam etc can be used for 
short periods of time. Please visit a good 
psychiatrist for evaluation and prescription of these drugs.
Apart from this improving 
sleep hygiene will also help to maintain good sleep. Avoid tea, coffee, alcohol, carbonated drinks in evening as all these things increase the risk of insomnia.
Thanks, Hope this helps you. Take care
Dr. Seikhoo Bishnoi,
Psychiatrist.