Bayek was a Medjay before founding the Hidden Ones in Assassin's Creed Origins.
A Medjay was an Egyptian official whose duties could include protection, policing, and service to the state. In the game, Bayek is specifically the Medjay of Siwa, responsible for safeguarding the oasis and its people. This role gives him authority, local knowledge, and a strong sense of duty before the main conflict begins.
Bayek's personal investigation starts after a violent encounter involving his son, Khemu. As he pursues members of a masked group, he becomes involved in Egypt's struggle among local rulers, Cleopatra's faction, and Roman forces. His wife, Aya, is equally important to the creation of the new order.
The Hidden Ones are not yet called Assassins in Origins. The game presents their formation as an earlier stage in the organization's history. Bayek is therefore a Medjay by profession and the first major leader of the Hidden Ones, rather than a pharaoh, senator, or Greek soldier.