# Programming Agents by Their Social Relationships: A Commitment-Based Approach
## 1 Introduction and Motivation  
Multiagent Systems (MAS) are a preferred choice for building complex systems where the autonomy of each component is a major requirement. Agent-oriented software engineers can choose from a substantial number of agent platforms (see, e.g., [1] for an overview). Tools like JADE [2], TuCSoN [3], DESIRE [4], and JaCaMo [5] all provide coordination mechanisms and communication infrastructures, but in our opinion, they lack abstractions that allow a clear and explicit modeling of interaction. Basically, the way in which agents interact is spread across and \"hard-coded\" into agent implementations. This choice overly ties agent implementations with a negative impact on software reuse. A clear separation of the agents from the specification of their coordination would bring advantages both on the design and on the implementation of MAS by bringing in a greater decoupling. Our claim is that an explicit representation of the _social relationships_ among agents is beneficial since it improves code modularity and flexibility in the interaction. We practically demonstrate these advantages when social relationships are modeled as _social commitments_[6] and _reified_ as resources in the environment. A commitment is a promise, or contract, that an agent (debtor) makes to another one (creditor). Commitments have a normative power since they induce an obligation upon the debtor to bring about a condition, when a specific context holds true. A peculiarity of commitments is that they can only be created by their debtor. Thus, by properly selecting the terms of the contract, an agent can create a commitment so as to entice the cooperation of another agent. This paper significantly extends and is complementary to the work presented in [7]. The main focus, here, is on the definition of a _conceptual architecture_ for modeling multiagent interactions, which encompasses the notion of social relationship as a first-class entity. Social relationships,captured by social commitments, are made available to the agents as artifacts, that the agents can directly manipulate instead of passing through interaction protocols. Despite relying on the 2 COMM infrastructure, which is used here to exemplify the feasibility of the approach, the discussion is abstract and aims at providing a general model that can be used by the systems' designers to program agent interaction. As distinct from previous work, like [8], the attention is placed on the characterization of the key components of the conceptual architecture and on how they can provide a guideline for the development of the individual agents. It is not focused on the programming aspects related to the development of an infrastructure, supporting the picture above (as the previous work was). One of the paper's major contributions lies in the definition of a schema, rooted in the mentioned architecture, for programming the way in which agents create and manage their interactions with others. We show how the modeling of interaction is a good starting point in the development of a distributed system when it comes to programming the agents. To this end, we rely on social commitments [9]. In particular, we show how, by relying on reified commitments, it is possible to devise schemas for programming agents based upon handling the agents' mutual engagements. Notably, such schemas are independent of any specific agent platform because they only depend on the standardized lifecycle of commitments. Two programming schemas are introduced for helping the programmer: _entice_ (used to obtain the cooperation of another agent by creating commitments) and _cooperate_ (used to properly handle commitment state changes). The 2 COMM [8] tool is used to exemplify the implementation of such a platform by building artifacts that incorporate commitments in a way that is not bound to any agent platform. Indeed, for using 2 COMM within a specific agent platform, it is sufficient to realize a dedicated connector. So far, two connectors make 2 COMM available to JADE and JaCaMo agents.