In recent years, much research has focused its attention on Ambient Intelligence (AmI). Its potential applications to smart homes, hospitals, health monitoring or daily life assistance make this paradigm a very promising field of research that can have a great and positive impact in our lives. The combination of AmI environments and Multi-Agent Systems (MAS) has emerged as a perfect solution for the development of this kind of applications. However, there are many challenges to be addressed before such applications can be put into practice. In this paper, we propose an architecture based on MAS aimed to build rehabilitation systems for people with Acquired Brain Injury (ABI) and explain how this architecture has been applied for the development of Vi-SMARt: a system for defining and planning therapies for people with ABI, and to control and evaluate their rehabilitation process.