Complex networks are used in a variety of applications. Revealing the structure of a community is one of the essential features of a network, during which remote communities are discovered in a complex network. In the real world, dynamic networks are evolving, and the problem of tracking and detecting communities at different time intervals is raised. We can use dynamic graphs to model these types of networks. This paper proposes a multiagent optimization memetic algorithm in complex networks to detect dynamic communities and calls it DYNMAMA (dynamic multiagent memetic algorithm). The temporal asymptotic surprise is used as an evaluation function of the algorithm. In the proposed algorithm, work is done on dynamic data. This algorithm does not need to specify the number of communities in advance and meets the time smoothing limit, and this applies to dynamic real-world and synthetic networks. The results of the performance of the evaluation function show that this proposed algorithm can find an optimal and more convergent solution compared to modern approaches.