Mobile agents in wireless sensor networks provide many advantages in comparison of conventional client/server architecture. Mobile Agents follow code to data approach and thus perform the task of data aggregation at the nodes rather than at the processing element. This approach reduces in-network data transmission, thus improving bandwidth usage and prolonging network lifetime. Use of multiple mobile agents instead of single mobile agent allows the task to get completed in a cooperative manner. In this paper, we present a multi agent solution for data aggregation using source grouping along with tree based ordering. Extensive simulations have proved better results in terms of energy consumed and latency in comparison of other approaches. © 2014 IEEE.