Devices in a pervasive system must be context-aware in order to provide services adapted to the global context. Architectures of context-aware systems should take into account many settings of a pervasive environment to be useful. Several context-aware architectures were proposed however most of them are specific to a particular application and have some limitation which reduces their usability by developers. In this paper and based on our previous work on defining context and context-awareness, we will propose a multi-agent service oriented architecture for context-aware systems. The architecture is based on the concept of service which plays an important part in the operation of a pervasive system. Our architecture is a hybrid form between client/server and peer-to-peer models. In addition of the advantages of those models, the proposed architecture enhances the extensibility, reusability, security of context-aware systems and takes into account the dynamic aspect of a pervasive environment. We will discuss in deep the contribution of the proposed architecture and its relation with other ones.