To form agent cooperation in an open environment, such as the Internet, is extremely difficult, despite agent service is one of the main forces to drive the Web into a growing marketplace of services. In this paper, a method to combine agent services matchmaking and cooperation is proposed. For flexible and semantic matchmaking, multiple strategies are provided; and based on the results of matchmaking, a Naive Bayesian model is given for agents to form cooperation. This approach, which considers matchmaking and cooperation formation as one process, brings a new angle for us to solve the connection problem for agents to work collaboratively in a dynamic and open environment, such as the World Wide Web.