How much knowledge would have someone during let's say Cleopatra's period have of the earlier period? Was it all myth and legend, or was there historical documents?
What about other civilizations? Were they all like "fuck, Egypt still going strong?"
I couldn't tell you how much the average person would have been aware of their history, but it is clear that even in later periods a lot was known about the past.
For example monuments were maintained by kings a long time after their constructors had died. The Sphinx stela of Thuthmosis IV. (~1400 BC) for example speaks of him finding the sphinx covered in sand and he removes it. Sure, there is a lot of mythological stuff mixed up in these texts but it does indicate an awareness of the past. This specific monument and the reigns would be around 1100 years apart. And in the case of monuments there was a lot about maintaining them to honour their forefathers and ensure their continued existence in the afterlife.
Otherwise a lot of things from past periods were often incorporated into contemporary times. The late period, for example the 26th dynasty (664-525BC) , used a lot of archaic language, art etc in their own creations. And this is common throughout all of Egyptian history, just that the late period does quite a lot of it. There was always information on the past and it was thanks to the temples, specifically the pr-ankh- the house of life- that preserved papyri etc. that it was preserved. And so it is safe to assume that Egyptians were aware of their history, specifically the priests who would have had the access to this knowledge. Sabine Neureiter said that the carriers of late period archaism were the priests since they were the ones who had access to all the knowledge of the past. But as I said before, I don't know what the average person knew and I also don't know how much other cultures knew.
I hope I could help!
Edit: I also remembered the king lists, like the Abydos list which list the names of kings, some get omitted in order to erase them from history, but otherwise here is an example of people in the New Kingdom listing the names of kings from Old KIngdom etc. So a clear awareness of 1000-2000 years of history