Abstract. This paper surveys the state of the art of agent-mediated electronic commerce (ecommerce), especially in business-to-consumer (B2C) e-commerce and business-to-business (B2B) e-commerce. From the consumer buying behaviour perspective, the roles of agents in B2C e-commerce are: product brokering, merchant brokering, and negotiation. The applications of agents in B2B e-commerce are mainly in supply chain management. Mobile agents, evolutionary agents, and data-mining agents are some special techniques which can be applied in agent-mediated e-commerce. In addition, some technologies for implementation are briefly reviewed. Finally, we conclude this paper by discussions on the future directions of agent-mediated e-commerce.