"Software as a service" approach has become a reality since efforts of both industry and research focused on service integration on the web. It would be possible to see the true potential of such a distributed infrastructure when these services can be combined together as parts of a workflow in order to have a common functionality. The collective composition requires adaptive, dynamic systems such that all parties may be subject to unexpected changes. It also requires intelligent systems that are able to compose services as building blocks to generate a single service that meets user requirements. In this paper we present an agent based system that guides service discovery and service composition by integrating graph theory into the web services domain.