An Ambient Intelligence Based Multi-Agent Architecture Dante I. Tapia 1 , Javier Bajo 1 , Juan M. Sánchez 1 , Juan M. Corchado 1 1Departamento Informática y Automática, Universidad de Salamanca Plaza de la Merced s/n, 37008, Salamanca, Spain {dantetapia, jbajope, elwiwo, corchado}@usal.es Abstract. This paper presents an Ambient Intelligence based distributed architecture that uses intelligent agents with reasoning and planning mechanisms. The agents have the ability to obtain automatic and real-time information about the context using a set of technologies, such as radio frequency identification, wireless networks and wireless control devices. The architecture presented can be implemented on a wide diversity of dynamic environments to manage tasks and services. 1. Introduction Agents and multi-agent systems (MAS) have become increasingly relevant for developing distributed and dynamic open systems, as well as the use of context aware technologies that supply those systems information about the environment. This paper is focused on describing the main characteristics of an Ambient Intelligence based distributed architecture that integrates Case-Based Reasoning (CBR) and Case-Based Planning (CBP) as reasoning mechanisms into deliberative BDI (Believe, Desire, Intention) agents, as a way to implement adaptive systems on dynamic environments. A CBR-BDI agent [4] uses Case-Based Reasoning as a reasoning mechanism, which allows it to learn from initial knowledge, interact autonomously with the environment, users and other agents, and have a large capacity for adaptation to the needs of its surroundings. CBP-BDI agents are CBR-BDI agents specialized in generating plans. BDI agents can be implemented by using different tools, such as Jadex [14]. Jadex agents deal with the concepts of beliefs, goals and plans, which are java objects that can be created and handled within the agent at execution time. The architecture presented is founded on Ambient Intelligence (AmI) environments, characterized by their ubiquity, transparency and intelligence. Ambient Intelligence proposes a new way to interact between people and technology. This last one is adapted to individuals and their context, showing a vision where people are surrounded by intelligent interfaces merged in daily life objects [8]. AmI creates computing-capable environments with intelligent communication and processing, serving people by means of a simple, natural, and effortless human-system interaction [16]. AmI also arouse the development of intelligent and intuitive systems and interfaces, capable to recognize and respond to users’ necessities in a ubiquous way [7], considering people in the centre of the development [17], and creating technologically complex environments in medical, domestic, academic, etc. fields [20]. Agents on this perspective must be able to respond to events, take the initiative according to their goals, communicate with other agents, interact with users, and make use of past experiences to find the best plans to achieve goals. The agents in this work employ radio frequency identification (RFID), wireless networks, and automation devices to supply automatic and real-time information about the environment, allowing users to interact with their surroundings and controlling physical services (i.e. heating, lights, switches, etc.). Next, the main characteristics of the architecture are explained, describing the technologies, agents and reasoning and planning mechanisms that integrate it. 2. Technologies for Context Awareness This architecture is founded on Ambient Intelligence (AmI) to develop multi-agent systems over dynamic scenarios, thus the importance to use technologies that allow the agents to have information about the environment and react upon it. AmI provides an effective way to create self-adaptive systems to context and users necessities. The vision of AmI assumes seamless, unobtrusive, and often invisible but controllable interactions between humans and technology. AmI provides new possibilities for solving a wide scope of problems. It also proposes a new way to interact between people and technology, where this last one is adapted to individuals and their context, showing a vision where people are surrounded by intelligent interfaces merged in daily life objects [8], creating computing-capable environments with intelligent communication and processing, serving people by means of a simple, natural and effortless human-system interaction [16]. With the appearance of AmI-based systems, one of the most benefited segments of population will be the elderly and people with disabilities, improving important aspects of their life, especially health care [8]. Radio Frequency Identification (RFID) is a wireless communication technology used to identify and receive information about humans, animals and objects on the move. An RFID system contains basically four components: tags, readers, antennas and software. Tags with no power system integrated (i.e. batteries) are called passive tags or “transponders”, these are much smaller and cheaper than active tags (power system included), but have shorter read range. The transponder is placed on the object itself (i.e. bracelet). As this object moves into the reader’s capture area, the reader is activated and begins signalling via electromagnetic waves (radio frequency). The transponder subsequently transmits its unique ID information number to the reader, which transmit it to an end device or central computer where information is processed and delivered. Information is not restricted to the object identification, thus it can include detailed information concerning the object itself or its location. Mainly used in industrial/manufacturing, transportation and distribution, there are other growing sectors, including health care [18]. Configuration presented in this paper comprise of transponders mounted on bracelets worn on people’s wrist or ankle, readers installed over protected zones, with an adjustable capture range up to 2 meters, and a workstation where all the information is processed and stored. Wireless LAN’s (Local Area Network), also known as Wi-Fi (Wireless Fidelity) networks, increase the mobility, flexibility and efficiency of the users, allowing programs, data and resources to be available no matter the physical location [19]. These networks can be used to replace or as an extension of wired LANs. Wi-Fi networks reduce infrastructure and installation costs. Also provide more mobility and flexibility, allowing people to stay connected as they roam among covered areas, increasing resources efficiency [11]. New handheld devices make easy to use new interaction techniques; for instance, guidance or location systems [6, 15]. The architecture presented in this paper incorporates “lightweight” agents that can reside in mobile devices, such as cellular phones, PDA’s, etc. [2], and therefore support wireless communication. Automation devices are successfully applied on schools, hospitals, homes, etc. [13]. There is a broad diversity of automation technologies, one of them is ZigBee, a low cost, low power consumption, two-way, wireless communication standard, developed by the ZigBee Alliance [21]. It is based on IEEE 802.15.4 protocol, and operates at 868/915MHz & 2.4GHz frequency spectrum. ZigBee is designed to be embedded in consumer electronics, home and building automation, industrial controls, PC peripherals, medical sensor applications, toys and games, and is intended for home, building and industrial automation purposes, addressing the needs of monitoring, control and sensory network applications [21]. ZigBee allows star, tree or mesh topologies. As shown on Figure 1, devices can be configured to act as: network coordinator (control all devices); router/repeater (send/receive/resend data to/from coordinator or end devices); or end device (send/receive data to/from coordinator). Fig. 1. ZigBee devices’ configuration Information, collected through the set of technologies described before, is processed by deliberative BDI agents with reasoning and planning mechanisms, providing the intelligence and flexibility to develop Ambient Intelligence based systems with self-adaptive capabilities to changes in the environment and user necessities. Next, the integration of reasoning and planning mechanisms into deliberative BDI agents is described. 3. Agents with Reasoning and Planning Capabilities Agents in this development are based on the BDI (Belief, Desire, Intention) deliberative architecture model [3], where the agents’ internal structure and capabilities are based on mental aptitudes, using beliefs, desires and intentions. Implementation of CBR (Case-Based Reasoning) systems [1] as a deliberative mechanism within deliberative BDI agents, facilitates learning and adaptation, and provides a greater degree of autonomy than pure BDI architecture. CBR use past experiences to solve new problems [12], adapting solutions that have been used to solve similar problems in the past, and learn from each new experience. To merge a CBR motor into a deliberative BDI agent, as seen on Figure 2, it is necessary to represent the cases used in CBR by means of beliefs, desires and intentions, and then implement a CBR cycle to process them, resulting in a deliberative CBR-BDI agent. The primary notion when working with CBR is the concept of “case”, which is described as a past experience composed of three elements: an initial state or problem description that is represented as a belief; a solution, that provides the sequence of actions carried out in order to solve the problem; and a final state, represented as a set of goals. CBR manages cases (past experiences) to solve new problems. The way cases are managed is known as the CBR cycle, and consists of four sequential phases: retrieve, reuse, revise and retain. The retrieve phase starts when a new problem description is received. Similarity algorithms are applied in order to retrieve, from a cases memory, the cases with a problem description more similar to the current one. Once the most similar cases have been retrieved, the reuse phase begins, adapting the past solutions to obtain a best one for the current case. The revise phase consists of an expert revision of the solution proposed. Finally, the retain phase allows the system to learn from the experiences obtained in the three previous phases, updating continuously the cases memory. Fig. 2. Basic deliberative BDI agent and CBR mechanisms architectures On Figure 3, the basic structure of a CBP-BDI agent can be seen. The reasoning mechanism generates plans using past experiences and planning strategies, so the concept of Case-Based Planning (CBP) is obtained [9]. CBP consists of four sequential stages: retrieve stage to recover the most similar past experiences to the current one; reuse stage to combine the retrieved solutions in order to obtain a new optimal solution; revise stage to evaluate the obtained solution; and retain stage to learn from the new experience. CBP is the idea of planning as remembering [10]. CBP is a specialization of CBR which is a problem solving methodology based on using a library of solutions for similar problems [10]. In CBP, the solution proposed to solve a given problem is a plan, taking into account the plans applied to solve similar problems in the past. The problems and their corresponding plans are stored in a plans memory. Problem description (initial state) and solution (situation when final state is achieved) are represented as beliefs, the final state as a goal (or set of goals), and the sequences of actions as plans. The CBP cycle is implemented through goals and plans. When the goal corresponding to one of the stages is triggered, different plans (algorithms) can be executed concurrently to achieve the goal or objective. Each plan can trigger new sub-goals and, consequently, cause the execution of new plans. Next, an Ambient Intelligence based architecture model is described, with context aware technology and agents with reasoning and planning mechanisms working collectively. Fig. 3. Deliberative CBP-BDI agent basic structure 4. Architecture Model Figure 4 illustrate how the reasoning and planning mechanism, and context aware technology are integrated into a generic multi-agent system prototype that can be implemented on diverse dynamic scenarios, for example in geriatric residences [4] with some changes according the users and project necessities. Fig. 4. Architecture applied on an automated environment Figure 5 shows the technology, the five different deliberative agents in the architecture, and the interaction between all them and users. Each agent has specific roles and capabilities: - User Agent is a BDI agent that runs on a Workstation. It manages the users’ personal data and behaviour (monitoring, location, daily tasks, and anomalies). Beliefs and goals used for each user depend on the plan or plans defined by the super-users. User Agent maintains continuous communication with the rest of the system agents, especially with SuperUser Agent and ScheduleUser Agents, through which the scheduled-users can communicate the result of their assigned tasks. User Agent must ensure that all actions indicated by SuperUser Agents are taken out, sending a copy of its base memory (goals and plans) to Manager Agent in order to maintain backups. - SuperUser Agent is a BDI agent that runs on mobile devices (PDA’s). It inserts new tasks into the Manager Agent to be processed by the CBR mechanism. It also communicates with User Agents to impose new tasks and receive periodic reports, and with ScheduleUser Agents to ascertain plans evolution. - ScheduleUser Agent is a CBP-BDI planner agent that runs on mobile devices (PDA’s). It programmes the scheduled-users daily activities, obtaining dynamic plans depending on tasks needed for each user. It manages scheduled-users profiles (preferences, habits, holidays, etc.), tasks, available time and resources. Each ScheduleUser agent generates personalized plans depending on the scheduled-user profile. - Manager Agent is a CBR-BDI Agent that runs on a Workstation. It plays two roles: Security role monitors the users’ location and physical building status (temperature, lights, alarms, etc.) trough a continuous communication with the Devices Agent; and Manager role which handle databases and tasks assignation. It must provide security for users and ensure tasks assignments efficiency. Tasks assignation is carried out through a CBR mechanism, incorporated within Manager Agent. When a new task assignation needs to be carried out, past experiences, current situation needs and available resources are recalled. - Devices Agent is a BDI agent that that runs on a Workstation. This agent controls all hardware devices. It monitors users’ location (continuously obtaining/updating data from the RFID readers), interact with ZigBee devices to receive information and control physical services (lights, door locks, etc.), and also check the status of the wireless devices connected to the system (PDA’s). The information obtained is sent to the Manager Agent to be processed. Fig. 5. Agents and technology in the architecture The essential hardware used is: Sokymat’s Q5 125KHz chip RFID wrist bands and computer interface readers for people monitoring and identification; Silicon Laboratories’ C8051 chip-based 2.4GHz development boards for physical services automation (heating, lights, door locks, alarms, etc.); mobile devices (PDA’s) for interfaces and users interaction; a Workstation where all the high demanding CPU tasks (planning and reasoning) are processed; and a basic Wi-Fi network for wireless communication between agents (in PDA’s and Workstation). All hardware is some way integrated to agents, providing them automatic and real-time information about the environment. The information obtained is processed by the reasoning and planning mechanisms to automate tasks and manage services. The planning mechanism in ScheduleUser Agents is a complex and innovative procedure that is briefly described next. 4.1. Tasks planning ScheduleUser Agents are autonomous agents that can survive in dynamic environments, with communication capabilities that allow them to be easily integrated into a multi-agent system. They can cooperate with other agents to solve problems in execution time and distributed way. The CBP mechanism on each ScheduleUser Agent constructs plans in such a way that a plan is a sequence of tasks that need to be carried out by a user. A task is a java object that contains a set of parameters, as can be seen in Table 1. Table 1. Tasks description Task Data TaskId 36 TaskType 32 TaskDescript Description TaskPriority 3 TaskObjective 0 TaskIncidents 0 UserId 7 UserNecessities 2 MinTime 10 min MaxTime 60 min TaskResources 2,4,8 For each task, one or more goals are established, so the whole task is eventually achieved. A problem description is created by the tasks that the scheduled-users must execute, the resources available, and the time assigned. In the retrieve stage, problem descriptions found, within similarity range close to the original problem description, are recovered from the beliefs base. In this case, a tolerance of 20% has been permitted. In order to do this, the agent applies different similarity algorithms (cosine, clustering etc.). Once the most similar problem descriptions have been selected, the solutions associated with them are recovered. A solution contains all the plans (sequences of tasks) carried out in order to achieve the objectives of the ScheduleUser Agent for a problem description (assuming that re-planning is possible) in the past, as well as the efficiency of the solution supplied. Solutions are combined in the reuse stage to construct a new plan [4, 9]. The new plan must ensure that the objectives can be accomplished with the resources available in order to carry out the global plan. The user objectives are defined within the planning mechanism. Task resources are defined by an administrator (person) using a Manager Agent GUI. ScheduleUser Agents watch out incidents and interruptions that may occur during re-planning [4]. Furthermore, these agents trust people because revision of plans is made by users. Finally, ScheduleUser agents learn about this new experience. If the plan is at least 90% similar, it is stored in the cases memory. 5. Conclusions and Future Work Deliberative BDI agents with reasoning and planning mechanisms, and the use of technology to perceive the context, create a robust, intelligent and flexible AmI-based architecture that can be implemented in wide variety scenarios, such as hospitals, geriatric residences, schools, homes or any dynamic environment where is a need to manage tasks and automate services. Although the architecture is currently on development, it is mature enough to demonstrate its capabilities on real scenarios. In fact, a prototype system, based on this architecture, has been successfully applied into a geriatric residence [4], improving security and health care efficiency through monitoring and automating medical staff’s work and patients’ activities, facilitating the assignation of working shifts and reducing time spent on routine tasks, as seen on Figure 6. Fig. 6. Real-time monitoring of nurses and patients, and dynamic assignation of tasks The main characteristic of the architecture presented is the use of CBR and CBP mechanisms merged into deliberative BDI agents that help them to solve problems, adapt to changes in context, and identify new possible solutions, supplying better learning and adaptation than pure BDI model. In addition, RFID, Wi-Fi and ZigBee devices supply the agents with valuable information about the environment, contributing to a ubiquous, non-invasive, high level interaction among users, system and environment. However, it is necessary to continue developing and improving the architecture presented, adding new capabilities and integrating more technologies to build more efficient and robust systems to automate services and daily tasks. Acknowledgements. This work has been partially supported by the MCYT TIC2003- 07369-C02-02 and the JCYL-2002-05 project SA104A05. Special thanks to Sokymat by the RFID technology provided and to Telefónica Móviles (Movistar) for the wireless devices donated. References 1. Allen, J.F.: Towards a general theory of action and time. Artificial Intelligence Vol. 23 pp. 123-154. (1984) 2. Bohnenberger, T., Jacobs, O., Jameson, A.: DTP meets user requirements: Enhancements and studies of an intelligent shopping guide. Proceedings of the Third International Conference on Pervasive Computing (PERVASIVE-05), Munich, Germany. (2005) 3. Bratman, M.E.: Intentions, Plans and Practical Reason. Harvard University Press, Cambridge, M.A. (1987) 4. Corchado, J. M.; Bajo, J.; De Paz, Y.; Tapia, D. I. (2007). Intelligent Environment for Monitoring Alzheimer Patients, Agent Technology for Health Care. Decision Support Systems, Eslevier. Amsterdam, Netherlands. 5. Corchado, J.M., Laza, R.: Constructing Deliberative Agents with Case-based Reasoning Technology. International Journal of Intelligent Systems. Vol. 18 No.12 1227-1241 (2003) 6. Corchado, J.M., Pavón, J., Corchado, E., Castillo, L.F.: Development of CBR-BDI Agents: A Tourist Guide Application. 7th European Conference on Case-based Reasoning 2004. LNAI 3155, Springer Verlag. pp. 547-559. (2005) 7. Ducatel, K., Bogdanowicz, M., Scapolo, F., Leijten, J., Burgelman, J.C.: That’s what friends are for. Ambient Intelligence (AmI) and the IS in 2010. Innovations for an e- Society. Congress Pre-prints, "Innovations for an e-Society. Challenges for Technology Assessment". Berlin, Germany. (2001) 8. Emiliani P.L., Stephanidis, C.: Universal access to ambient intelligence environments: opportunities and challenges for people with disabilities. IBM Systems Journal. (2005) 9. Glez-Bedia, M., Corchado, J.M.: A planning strategy based on variational calculus for deliberative agents. Computing and Information Systems Journal. Vol.10(1) 2-14. (2002) 10. Hammond, K.: Case-Base Planning: Viewing Planning as a Memory Task. Academic Press, New York. (1989) 11. Hewlett-Packard.: Understanding Wi-Fi. http://www.hp.com/rnd/library/pdf/. (2002) 12. Kolodner J.: Case-based reasoning. Morgan Kaufmann (1993). 13. Mainardi, E., Banzi, S., Bonfè, M. & Beghelli, S. (2005). A low-cost Home Automation System based on Power-Line Communication Links. 22nd International Symposium on Automation and Robotics in Construction ISARC 2005. September 2005. Ferrara, Italy. 14. Pokahr, A., Braubach L., Lamersdorf, W.: Jadex: Implementing a BDI-Infrastructure for JADE Agents, in: EXP - In Search of Innovation (Special Issue on JADE), Vol. 3, 76-85. Telecom Italia Lab, Turin, Italy, September (2003) 15. Poslad, S., Laamanen, H., Malaka, R., Nick, A., Buckle, P., Zipf, A.: Crumpet: Creation of user- friendly mobile services personalised for tourism. In Proceedings of 3G. (2001) 16. Richter, K., Hellenschmidt, M.: Interacting with the Ambience: Multimodal Interaction and Ambient Intelligence. Position Paper to the W3C Workshop on Multimodal Interaction, 19-20 July. (2004) 17. Schmidt, A.: Interactive Context-Aware Systems Interacting with Ambient Intelligence. In G. Riva, F. Vatalaro, F. Davide & M. Alcañiz, Ambient Intelligence, IOS Press pp. 159- 178. (2005) 18. Sokymat.: Sokymat. http://www.sokymat.com. (2006) 19. Sun Microsystems. (2000). Applications for Mobile Information Devices. Helpful Hints for Application Developers and User Interface Designers using the Mobile Information Device Profile. Sun Microsystems, Inc. 20. Susperregi, L., Maurtua, I., Tubío, C., Pérez M.A., Segovia, I., Sierra, B.: Una arquitectura multiagente para un Laboratorio de Inteligencia Ambiental en Fabricación. 1er. Taller de Desarrollo de Sistemas Multiagente (DESMA). Málaga, España. (2004) 21. ZigBee Standards Organization.: ZigBee Specification Document 053474r13. ZigBee Alliance. (2006)