Agent-based approaches in application development seem to meet the requirements of adaptability, scalability, decentralization, and flexibility imposed by complex software systems. In open applications, interactions among agents are one of the most important issues that must be faced carefully. In this paper we propose the BRAIN framework, which aims at supporting the different phases of the development of interactions in agent-based applications, relying on the concept of role to model agent interactions. Roles carry different advantages in modeling interactions and, consequently, in exploiting derived infrastructures to support multiagent systems. Besides the interaction model, the BRAIN framework includes XRole, an XML-based notation to express roles in an interoperable way, and Rolesystem, an interaction infrastructure that implements the proposed model. An application example shows the advantages of our approach in application engineering.