It seems like all you would need would be a battery of some sort going to your PIC through a diode. As long as you have a large enough capacitor on the power pins of your PIC, this would keep your memeory if the main power supply was lost. Of course, you might also want to add some sort of alarm so you can respond and fix the problem before the battery runs down.