Modern software development environment is based on developers’ ability to work in parallel on the same codebase and perform concurrent changes, which potentially need to be merged back together. However, state-of-the-art merging systems follow text-based algorithms that focus only on modifications to text but completely ignore the semantic of the code written. This limitation significantly restricts developers’ ability to perform and merge concurrent changes. In this paper, we propose a merging technique that fully understands the programming language structure of typical BDI agent systems. In addition, our approach effectively captures the semantic of an agent system using the notion of semantic effects of goals, plans and actions constituting the agent system.