## 3 Proposed System and Architecture  
This section presents the proposed system. First, we present the proposed architecture based on the PANGEA multi-agent architecture, describing each agent that is part of the system and its functionality. The main objective of this proposal is to create a system that can be accessible to everyone. Moreover, since the development of the system is modular, it can be used through different devices, either in its entirety or only with some of them. In this case, we integrate these device connections with the system in an abstract way so that they can be replaced by other models of devices suitable to the users' possibilities. The main characteristic of the architecture that is proposed is the capacity and inclusion of new functions and the ability to adapt to new environments in the future in a simple way. To solve the problem, the architecture must contain a series of well-defined characteristics to achieve correct operation. As the objective of this research work, the creation of a platform has been proposed to allow the rehabilitation of people who need to do some physical exercise independently and who, in turn, can be accompanied by a specialist who indicates the exercises to be done. To do this, the user or patient of the application can use various devices, such as a motion capture suit or a heart rate monitor, that allow them to monitor their progress, or they can use various terminal environments that allow them to guide and see the results of their progress. The architecture for the system must have the capacity to adapt to the incorporation of new functionalities so that it is adaptive, scalable, distributed, and with different communication protocols that allow the integration of the different parts of the system. To this end, we propose the use of a multi-agent architecture that offers the functionalities described above. In a multi-agent based architecture, each of the agents must have a well-defined functionality and task so that it can coordinate and interact with the other agents. For the construction of multi-agent systems, there are currently several solutions developed to speed up the process. The systems currently available can be from simple libraries such as SPADE and Python's library or complete complex systems such as JADE, PANGEA, and osBrain. Figure 1 shows the proposed architecture using MAS PANGEA with its virtual organizations and the main agents that are part of the designed architecture. The architecture proposed for this research work is used as a starting point for PANGEA. This is because PANGEA is based on the theory of organizations, which allows it to be applied to most systems, and allows for the modelling of human iteration with the system. The main advantage of PANGEA over other multi-agent systems is its internal rule engine that allows for the distribution of computational load among the different agents. The designed architecture is divided into different parts. There are two well-defined parts: The upper part of the image shows the minimum agents required for the operation of the PANGEA multi-agent system. The lower part shows the virtual organizations of agents belonging to the case study. _Capture System Organization_: This organization interacts as a bridge between the system and the elements of the sensorization system to monitor the execution of the exercises. There are two main agents in this organization. The first agent we meet is the Node Position, which connects to the monitoring suits, in this specific case via Bluetooth BLE. It has the ability to detect changes in movement and publish them so that they can be used by the system. The second agent is the Pulsometer, which, similar to the agent described above, connects via Bluetooth BLE with the heart rate monitors to capture the heart rate at each instant it is using the system. This agent allows for recommendations to increase or decrease the rate of exercise performance.