Have you had a medication evaluation with a psychiatrist? It can make all the difference.
Ambien stops working after a few weeks for most people. If you have major depression, your insomnia won't go away until the depression is treated.
Good luck! I hope you doc can help.