The closest analog to the nervous system, from which consciousness springs, is the immune system. This is not original with me but I forget where I read it. Both evolved to protect us from external threats. The nervous system continued to evolve to become essential for the completion of other vital life projects such as the procurement of food, mates, and other resources.
Long term memories are analogous to T-cells while short term memories are analogous to B-cells. Immediate sensations are analogous to antigens. Looking at it this way had the advantage that both systems are the product of natural selection.
It also casts considerable doubt upon the project of creating conscious androids similar to the ones common in science fiction. Unless we create an electronic model of the immune system and go from there it won't happen. In their functioning, digital computers are nothing like the immune system. It would be like my trying to prepare a meal using random tools from my basement and objects from my desk drawer.