The 5e demilich is quite different from the demiliches of previous editions.
From the 5e Monster Manual:
Few liches seek to become demiliches, for it means an end to the existence they hoped to preserve by becoming undead. However, time can erode the lich’s reason and memory, causing it to retreat into its ancient tomb and forget to feed on souls. The spells it once knew fade from its mind, and it no longer channels the arcane energy it wielded as a lich.
This describes a weaker entity than a Lich. The idea here is that they forget to eat souls and their life force decays, and they begin to forget even how to use their magic. This is also reflected in the differences in abilities between a Lich and Demilich, as well as their challenge ratings (21 vs. 18).
In contrast, here is the entry for demilich from 2e:
The demilich is not, as the name implies, a weaker form of the lich. Rather, it is the stage into which a lich will eventually evolve as the power which has sustained its physical form gradually begins to fail. In most cases, all that remains of a demilich's body are a skull, some bones, and a pile of dust.
When it has learned all that it feels it can in its undead life, the lich will continue its quest for power in strange planes unknown to even the wisest of sages. Since it has no use for its physical body at this point, the lich leaves it to decay as it should have done centuries ago.
Here we see Demilichdom as the next step in gaining power for a Lich.
So if you’re using 5e lore, then a demilich very well could be an empty shell of its former self. But using lore from 2e, a demilich is an even more formidable enemy retaining all of their memories.
See this answer for a more complete history of Demiliches in D&D.