Bayek's role in Assassin's Creed Origins is identified by the title Medjay.
A Medjay was originally associated with a Nubian people, but in ancient Egyptian history the term also became connected with elite guardians and law-enforcement figures serving the pharaoh. Bayek is presented as the last active Medjay of Siwa, responsible for protecting his community and settling disputes.
The title is more specific than simply calling Bayek a soldier or guard. Origins uses his duties to explain his knowledge of Egypt, his contacts and his willingness to intervene when local people are threatened. His investigation into masked enemies eventually leads to the formation of the Hidden Ones, the organization that precedes the later Assassin Brotherhood.