In recent years the use of computer technique and information technology in the domain of Ambient Intelligence (AmI) has been increasing significantly. For successful and efficient development of ambient intelligence systems and their components a new approach is needed. The Model Driven Development (MDD) is an innovative approach for development of different software applications using models at different levels of abstraction and applying model transformation to code generation. In order to satisfy the basic requirements to the developed AmI, in the proposed approach, the MDD, based on Model Driven Architecture (MDA), is directed to combine the use of agents as basic elements of the system and to model the internal and external communications in the system, based on the concept of Service Oriented Architecture (SOA). Such a way, the paper proposes a layered modeling framework for model driven development of agent based AmI systems with service oriented architecture. The deployment of the software on hardware resources is also part of the software process model. Finally some conclusions are made.