Ambient systems are populated by many heterogeneous devices to provide adequate services to its users. The adaptation of an ambient system to the specific needs of its users is a challenging task. Because human-system interaction has to be as natural as possible, we propose an approach based on Learning from Demonstration (LfD). However, using LfD in ambient systems needs adaptivity of the learning technique. We present ALEX, a multi-agent system able to dynamically learn and reuse contexts from demonstrations performed by a tutor. Results of experiments performed on both a real and a virtual robot show interesting properties of our technology for ambient applications.