Bayek is a Medjay in Assassin's Creed: Origins.
A Medjay was an ancient Egyptian military and law-enforcement role, and Bayek serves as the last active Medjay at the beginning of the game. His duties include protecting communities and resolving threats in Ptolemaic Egypt. Personal tragedy then drives him and his wife, Aya, into a wider conflict involving secretive political forces.
Assassin's Creed: Origins is set in the first century BCE, during the reign of Cleopatra VII and the rivalry between Cleopatra and her brother Ptolemy XIII. The game presents Bayek's work as part of the chain of events that eventually produces the Hidden Ones, the organization that becomes the historical precursor to the Assassins.
Medjay is not the name of a pharaoh or a Roman military rank. The term originally referred to a Nubian people and later became associated with elite protectors in Egyptian history. Bayek's title therefore connects the protagonist to both local tradition and the game's origin story for the Assassin Brotherhood.