Upgrade system works similiar to the game called Rogue legacy. If you have any Gems left on you when you die , you can spend those to upgrade your skills permanently in the end game screen.
Here are the screenshots from those systems. Hopefully i will be releasing an another alpha version of the game until the end of the week :)