Roles and groups are fundamental components of agent systems, shaping both individual agent behavior and interactions among agents. Agent system mining enables the analysis of autonomous agents and their interaction patterns using event data generated by agent systems. However, existing agent system mining techniques primarily focus on agent-level information and often overlook role and group context of agents, potentially limiting their ability to capture agent behavioral patterns accurately. This limitation stems from the fact that explicit role and group information are usually absent from event data. To address this issue, we first formalize the concepts of roles, groups, and their relationships within agent systems. Building on this foundation, we propose Role Miner, a technique that infers roles and groups associated with agents for the events they perform. We further validate Role Miner using a novel Role Simulator that incorporates inferred role and group information as additional inputs. Experimental results show that our technique produces more accurate simulations, often outperforming state-of-the-art process simulation techniques.