A routing algorithm with multiple constraints is proposed based on mobile agents. It uses mobile agents to collect information of all mobile nodes. Our algorithm has stronger routing stability and lower probability of link failure because it selects links with large link expiration time. Multi-path strategy reduces the time consumption of rerouting. Also, the source node can utilize the best path to perform the data transmission to meet two QoS requirements (remaining battery and bandwidth) in order to extend the survival time of network. We conduct experiments with network simulators to evaluate the performance of the algorithm. The experimental results show that this algorithm is more effective and robust than AODV.