Ad hoc mobile devices heavily depend on the performance of batteries. Optimizing the power consumption is a very crucial issue. To maximize the lifetime of mobile ad hoc network, the power consumption rate of each node must be reduced. In this paper we present a novel energy efficient routing algorithm based on mobile agents to deal with the routing mechanism in the energy-critical environments. A few mobile agents move in the network and communicate with each node. They collect the network information to build the global information matrix of nodes. The routing algorithm chooses a shortest path of all nodes in all possible routes. Additionally, we compare the performance of power-relation routing protocol DSR (Dynamic Source Routing)in simulation environment. The results show that the survivability of Ad Hoc network has been better because of less energy consumption when usingour improved DSR as compare to standard DSR protocol.