Title: AOSE
1AOSE
- Advanced Software Engineering
- University College Dublin
- December 2007
- Dr Rem Collier
2AOSE
- Introduction to Agent Interaction
3Agents and Interaction
- Interaction forms the basis of an agents
collaborative problem solving capabilities. - Agents are designed to operate in tandem with one
another. - This includes sharing and requesting knowledge,
negotiating services, coordinating activities, - Key to realisation of such activities is the
implementation of an underlying communication
mechanism. - Two broad approaches to communication
- Shared space communication
- Communication by message passing
4Shared Space Communication
- General Principle
- All agents of the MAS have access to a common
area of memory (the shared memory). - This access allows both for reading and writing.
- If an agent writes information to this area
(often also called blackboard) every other agent
can read it. - This realizes a 1m communication and each agent
has to decide on its own what to do with such an
information - ignore it
- use it
- delete it (usually forbidden)
5Shared Space Communication
- General Principle
- It is quite often layered, with each layer
representing a differing degree of abstraction
for the current problem. - Any agent working at some level on the blackboard
has access to that complete level along with all
adjacent levels. - This allows data synthesised a lower levels to be
communicated to higher levels, and for
higher-level goals to be filtered down to lower
level agents.
6Example JavaSpaces
- JavaSpaces is a service specification that
provides a distributed object exchange and
coordination mechanism. - Part of the Jini Project
- Originally developed by Sun.
- Now open-source as Apache River.
- Targeted at distributed systems development.
- Not really an agent solution, although
Coordination Languages are seen as agent
friendly. - Whn connected to a JavaSpaces infrastructure, a
process can - write an object into a JavaSpace
- take an object from a JavaSpace
- make copies of objects from a JavaSpace
7Example JavaSpaces
- Features
- Spaces are persistent.
- When you store an object in a space, it will
remain there indefinitely until it is removed. - You can also request a lease time during which an
object should be stored. - Once stored in the space, an object will remain
there until its lease time (which can be renewed)
is over, or until a process explicitly removes
it. - Spaces are associative.
- Objects in a space are located via associative
lookup, not by memory location or by identifier. - To look up an object, you create a template (an
object with some or all of its fields set to
specific values, and the others left as null to
act as wildcards). - An object in the space matches a template if it
matches the template's specified fields exactly.
8Example JavaSpaces
- Features
- Spaces are transactionally secure.
- JavaSpaces makes use of Jini's transaction
service to ensure that an operation on a space is
atomic (either the operation is applied, or it
isn't). - Spaces let you exchange executable content.
- While in a space, objects are just passive data.
- When you read or take an object from a space, a
local copy of the object is created. - As with any other local object, you can modify
its public fields and invoke its methods, even if
you've never seen an object like it before.
9Shared Space Communication
- Advantages
- Extensibility All agents communicate via the
shared space. - Clearly defined interface.
- Supports visualisation of global agent
interactions. - Supports easy decomposition and distribution of
problems. - Disadvantages
- Information Overload Must consider ALL messages.
- Potential Bottleneck / Single Point of Failure.
- Can be overcome by implementing a virtual shared
space gt network overhead. - Loss of privacy
10Communication byMessage Passing
- General Principle
- Communication takes place through the
transmission of messages directly between two
agents (11 communication). - Both agents have to perform (nearly)
simultaneously communication actions - The sender sends the message composed by it to
some communication channel. - The receiver gets the message from that channel.
- Usually the message is composed in a special
communication language that has to be understood
by both agents. - Interaction normally consist of several messages
where the agents take their turns as sender and
receiver. - This is called a dialog or a protocol.
11Communication byMessage Passing
- Advantages
- Well suited to internet scale applications.
- Communication is directed to relevant agents (no
information overload). - More Robust So long as the communication channel
is decentralised. - Disadvantages
- Agent Discovery new agents must register their
existence. - Choosing an appropriate communication language.
- Defining and enforcing protocols.
12Example Agent Factory
- Agents communicate by passing messages in an
underlying Agent Communication Languages. - Messages have types inform, request,
- Messages have inner content What activity is
being requested / what information is being
given. - Agents send messages by performing an action.
- This action constructs the underlying message and
selects an appropriate communication channel. - Agents receive messages via perception of a
private message queue. - The communication channel routes messages to a
private message queue of the receiver agent. - The agent then perceives the message via a
perceptor.
13AOSE
- Towards Agent Interaction
14Agent Communication Languages
- A core issue underlying the design of
message-passing based communication is the format
of the messages. - Our goal is to support agent interactions that
exhibit the flexibility that is inherent within
human conversation. - As with many agent concepts, we look to
philosophy in for inspiration - Speech Act Theory (Searle, 1969) is a pragmatic
theory of language. - It attempts to account for how language is used
by people every day to achieve their goals and
intentions. - It achieves this by adopting a view of speech as
action.
15Austins Theory
- The origin of speech act theories are usually
traced to the work of the philosopher John
Austin. - Austin noticed that some utterances are like
physical actions that appear to change the
state of the world. e.g. - Declaring war
- I now pronounce you man and wife
- Austin distinguished 3 different aspects of
speech acts - Locutionary act - act of making an utterance
- e.g. saying please make some tea
- Illocutionary act action performed in saying
something - e.g. he requested me to make some tea
- Perlocution effect of the act
- e.g. he got me to make tea
16Searles Theory
- Searle built on Austins work and identified 5
types of illocutionary act (which he called
speech acts)
17Searles Theory
- He then determined that speech acts can be
decomposed in to 2 core components - A performative verb
- e.g. Request, inform
- Propositional content
- e.g. the window is closed
18Modeling Speech Acts
- To understand how speech acts may be applied, we
need to develop a formal (logical) model. - At its core, this model must facilitate the
definition of different speech acts. - In particular, we need to know when a speech act
can be applied, and what the effect of that
speech act will be. - This is known as semantics.
- Because speech acts are seen as phyiscal actions,
their semantics can be specified through the use
of pre- and post- conditions.
19Example Speech Act
- Semantics for request request(s,h,?)
- Pre
- s believes h can do ? (you dont ask someone to
do something unless you think that they can do
it) - s believes h believes h can do ? (you dont ask
someone unless they believe they can do it) - s believes s wants ? (you dont ask someone
unless you want it!) - Post
- h believes s believes s wants ? (the effect is
to make them aware of your desire)
20Agent Communication Languages
- So, we can model inter-agent communication as
speech acts. - In our model, we must specify some model of the
state of an agent. - Then we must define a set of speech acts in terms
of - the pre-conditions that must be satisfied for the
act to be performed and - the expected effects of that speech act
- Finally, we must provide a message format that
can encode the information that is passed between
the speaker and the hearer agents. - The minimum requirement must be the performative
verb and the propositional content. - All of this, when put together is known as an
agent communication language!
21AOSE
22Agent Communication Languages
- An Agent Communication Language combines
- a data format for representing speech acts.
- a (partial) model of the state of the speaker an
hearer. - a set of formally specified set of speech act
types (based on the above model). - As we have seen, at its most primitive, a speech
act is a combination of a performative verb and
some propositional content. - However, humans also use additional contextual
information in communication such as who
performed the speech act, and to whom it was
directed. - So, in its simplest form, an ACL message might
look something like this - request ( rem, bob ) closed(door)
23Agent Communication Languages
- Other contextual information that is often
provided in an ACL message include - The format (knowledge representation language) of
the propositional content. - The ontology associated with the propositional
content. - The protocol and conversation that the message is
part of. - Any encodings (if the content is encrypted)
- However, much of this is optional and is not
always implemented in real world agent systems. - The key value of ACLs is that they define a
clear syntax and semantics for agent
communication.
24KQML
- Knowledge Sharing Effort (KSE), funded by ARPA
- Central concept knowledge sharing requires
communication, which in turn requires a common
language. - KSE focused on defining that common language.
- KQML Knowledge Query and Manipulation Language
- Language for both message formatting and message
handling protocols. - KIF Knowledge Interchange Format
- Language for expressing message content.
25KQML and KIF
- KQML is an outer language, that defines various
acceptable communicative verbs, or
performatives - Example performatives
- ask-if (is it true that. . . )
- perform (please perform the following action. .
. ) - tell (it is true that. . . )
- reply (the answer is . . . )
- KIF is a language for expressing message content
26KQML Message Structure
- KQML is an outer language, that defines various
acceptable communicative verbs, or performatives
e.g. (ask-if sender agenti receiver agentj
language Prolog ontology genealogy content (
spouse adam eve))
27KQML Performative Categories
28KIF Knowledge Interchange Format
- Used to state
- Properties of things in a domain (e.g., Rem is a
Lecturer) - Relationships between things in a domain (e.g.,
Rem likes beer) - General properties of a domain (e.g., All
students are registered for at least one course)
29KIF Knowledge Interchange Format
- The temperature of m1 is 83 Celsius(
(temperature m1) (scalar 83 Celsius)) - An object is a bachelor if the object is a man
and is not married(defrelation bachelor (?x)
(and (man ?x) (not (married ?x)))) - Any individual with the property of being a
person also has the property of being a
mammal(defrelation person (?x) gt (mammal ?x))
30KQML and KIF
- In order to be able to communicate, agents must
have agreed on a common set of terms - A formal specification of a set of terms is known
as an ontology - Projects such as the Knowledge Sharing Effort put
significant effort into defining common
ontologies. - This led to the development of software tools
such as Ontolingua to support this activity. - Example KQML/KIF dialogueA to B (ask-if (gt
(size chip1) (size chip2)))B to A (reply
true)B to A (inform ( (size chip1) 20))B to
A (inform ( (size chip2) 18))
31KQML Example 1
- (evaluate
- sender A receiver B
- language KIF ontology motors
- reply-with q1 content (val (torque m1)))
- (reply
- sender B receiver A
- language KIF ontology motors
- in-reply-to q1
- content ( (torque m1) (scalar 12 kgf)))
32KQML Example 2
- (stream-about
- sender A receiver B
- language KIF ontology motors
- reply-with q1 content (m1))
- (tell
- sender B receiver A
- in-reply-to q1
- content ( (torque m1) (scalar 12 kgf)))
- (tell
- sender B receiver A
- in-reply-to q1
- content ( (status m1) (normal)))
- (eos
- sender B receiver A
- in-reply-to q1)
33KQML Facilitators
- KQML environments (may) contain facilitators that
help make the communication protocol transparent. - Facilitators a special class of agents that
perform useful communication services such as - Maintain registry of service names
- Forward messages to named services
- Routing messages based on content
- Provide matchmaking between information providers
and seekers - Provide mediation and translation services
34KQML Facilitators
Point-to-point protocol A is aware that it is
appropriate to send a query about X to B There
are several ways to achieve this via a
Facilitator.
F
tell(X)
ask(X)
A
B
35KQML Facilitators
Using the subscribe performative Request that
Facilitator F monitor for the truth of X. If B
subsequently informs F that it believes X to be
true, then F can in turn inform A.
tell(X)
subscribe(ask(X))
F
tell(X)
A
B
36KQML Facilitators
advertise(ask(X))
broker(ask(X))
Using the broker performative A Asks Facilitator
to find another agent which can process a given
performative.
tell(X)
F
tell(X)
ask(X)
A
B
37KQML Facilitators
advertise(ask(X))
recruit(tell(X))
Using the recruit performative Asks Facilitator
to find an appropriate agent to which an embedded
performative can be forwarded. A reply is
returned directly to the original agent.
F
ask(X)
tell(X)
A
B
38KQML Facilitators
recommend(ask(X))
advertise(ask(X))
Using the recommend performative Asks
Facilitator to respond with the name of another
agent which is appropriate for sending a
particular performative.
reply(B)
F
ask(X)
A
B
tell(X)
39KQML Criticism
- Weak semantics of performatives
- Different implementations of KQML could not
interoperate. - Transportation mechanisms were not defined.
- Lacked the class of performatives commissives
- Difficult to implement multi-agent scenarios
without commissives. - Set of performatives is large and ad hoc.
40AOSE
41Who is FIPA?
- The Foundation for Intelligent Physical Agents
(FIPA) is a non-profit association. - FIPAs purpose is to promote the success of
emerging agent-based applications, services and
equipment. - FIPA operates through the open international
collaboration of member organisations - companies, universities and government
organisations. - FIPAs Standards Cover
- Agent Communication (FIPA ACL / Interaction
Protocols) - AO-Application Infrastructures (Agent Platform,
Agent Management, Message Transport Systems) - Agent UML
42FIPA ACL 1
- Basic structure is quite similar to KQML
- Performative (communicative act)
- 20 performatives in FIPA ACL
- Housekeeping
- e.g. Sender, Reply to, Reply-with, In-Reply-With
- Content
- the actual content of the message
- Language
- The language in which the content is written
- Ontology
- The ontology in which the message needs to be
interpreted.
43FIPA ACL 2 Example Message
ACL message
inform
(
sender
agent1
Note FIPA uses a content language called
FIPA-SL, which is based on modal logic.
receiver
hpl-auction-server
content
(price (bid good02) 150)
in-reply-to
round-4
reply-with
bid04
language
fipa-sl
ontology
hpl-auction
)
44FIPA ACL 3 - Message Structure
Transport-message HTTP Sender Transport-type
FIPA-HTTP Transport-address http//www.agentfact
ory.com4444/ Transport-properties
none Receiver Transport-type
FIPA-HTTP Transport-address http//www.ibeca.org
4444/ Transport-properties none Additional-attri
butes none
Envelope
- Envelope
- Comprises of a collection of parameters
- Contains at least the mandatory to and sender
parameters - Message Body
- The fully specified message in the chosen ACL
syntax - Can be encoded (e.g. The FIPA Bit Efficient
Encoding Mechanism).
Payload (ACL message)
45FIPA Semantic Language (FIPA-SL)
- FIPA-SL is the formal language used to define the
semantics of FIPA ACL - logical propositions are expressed in a logic of
mental attitudes and actions - the logical framework is a first order modal
language with identity (similar to Cohen
Levesque) - FIPA-SL provides formalizations for three
primitive mental attitudes Belief, Uncertainty
and Choice (or Goal) - FIPA-SL can express propositions, objects and
actions.
46FIPA ACL 4 - Inform and Request
- Inform and Request are the two basic
performatives in FIPA ACL. - All others are macro definitions, defined in
terms of these. - The meaning of inform and request are defined in
2 parts - Precondition
- What must be true in order for the speech act to
succeed. - Rational effect
- What the sender of the message hopes to bring
about. - FPs and REs involve descriptions of the agents
state in FIPA-SL.
47FIPA ACL 5 - Inform and Request
48FIPA ACL Semantics Inform
- i informs j about ? being true.
- lti, inform( j, ? )gt FP Bi? ? ? Bi( Bifj? ?
Uifj?) RE Bj? - The sender
- believes that proposition ? is true
- intends that receiver j also comes to believe
that ? is true - does not already believe receiver has any
knowledge about ? . - Its up to receiver to adopt the belief.
49Performatives in FIPA
50FIPA Transport management
- a platform provides to each agent a channel
- a transfer protocol is used to transfer messages
between channels - the transport service delivers messages within a
platform or between platforms - ACL is the payload of the transport service and
protocol - the envelope contains transport information.
51FIPA Sending Messages
- 3 options
- Via local ACC
- Via remote ACC
- Direct communication mechanism
52FIPA Agent Interaction Protocols
- Ongoing conversations between agents fall into
typical patterns. - In such cases, certain message sequences are
expected, and at any point in the conversation,
other messages are expected to follow. - These typical patterns of message exchange are
called protocols. - (request sender A
- receiver B
- content some-act
- protocol fipa-contract-net
- )
-
53Example Query-Protocol
- The protocol states that
- IF an agent asks another agent if a proposition
holds or not - THEN the participant must reply with answer
informing the initiator, or may refuse to answer,
or fail to answer, or failing to understand the
question.
54Comparing KQML and FIPA ACL
- Similarities
- Separation of the outer language (performative)
and the inner language (content). - Allows for any content language
- Differences
- Communication primitives
- KQML performative
- FIPA ACL communicative act
- Different semantic frameworks impossible to
come up with an exact mapping or transformation
between KQML and FIPA performatives. - KQML provides facilitator services FIPA ACL
originally did not.