Abstract. This paper presents an "intelligent" environment that can be occupied by an elderly or handicapped person. It is characterized by its online learning and continuous adaptation based on a new algorithm called "Planning Q-learning Algorithm (PQLA)". The user can make feedback promptly which simulates an algorithm that reconfigures the existing plans. The software adaptation is run under middleware "WCOMP" based on the aspect of assembly concept to adapt to the environmental changes.