AI Wiki中文/EN

Agent communication: what does a message commit the sender to?

智能体通信

Separate performatives, content, ontology and conversation control; trace a deadline-bound Contract Net and check which protocol errors a validator can and cannot catch.

On this pageIntuitionMathematics & methodImplementationLimitationsExercisesResearch connections

“40” is not yet a message

A purchasing agent needs five pages translated. Five supplier agents, written by different teams, receive the request. One of them answers with the string “40”. Is that a price quote, a binding offer, a refusal with an error code, or the number of minutes until it will reply? The receiving program cannot act until it knows what kind of act the sender performed, what vocabulary the content uses, and which conversation the reply belongs to.

Agent communication languages answer exactly these questions. They do not make agents intelligent; they make the type of each utterance explicit, so that “I propose to do this for 40” and “I inform you the price is 40” lead to different obligations. The proposal, once accepted, commits the supplier to perform; the information does not.

This article uses two historical designs. KQML, from the early-1990s ARPA Knowledge Sharing Effort, wraps arbitrary content inside a performative such as ask-one or tell. KQML design The FIPA specifications, standardized in 2002, fix a set of message parameters, give each communicative act a formal precondition and intended effect, and define interaction protocols such as Contract Net. Message structure Act library Contract Net We then run an original, fully scripted Contract Net simulation: no network, no language model, and no claim about how any deployed system behaves.

Four layers of one message

KQML separates three things that are easy to blur: the content, expressed in any representation language; the performative, which says whether the content is an assertion, a query or a command and how a reply should be delivered; and optional descriptors such as the content language and ontology. The paper stresses that KQML implementations ignore the content except to find where it begins and ends. Its example asks a stock server for a price with ask-one, while ask-all requests every answer and stream-all asks for answers one message at a time. The paper groups roughly two dozen reserved performatives into seven categories, and adds facilitator agents that can recruit, broker or recommend other agents for a message. Performatives and facilitators

FIPA ACL keeps the same separation but fixes the parameter names. The message structure specification lists thirteen parameters in five categories: the type of communicative act (performative); participants (sender, receiver, reply-to); content; description of content (language, encoding, ontology); and conversation control (protocol, conversation-id, reply-with, in-reply-to, reply-by). Only performative is mandatory. Implementations may add their own parameters, but their names must begin with “X-” and FIPA assigns them no semantics. A receiver that cannot process a parameter can reply with not-understood. Parameter table

Conversation control is where interoperability usually breaks. A message with a non-null protocol belongs to a conversation: the initiator must assign a conversation-id, responses within the protocol should carry the same value, and the reply-by time names the latest moment by which the sender wants the next message, not the end of the whole protocol. Conversation identifiers must be globally unique; the specification suggests concatenating the sender’s unique name with a locally unique counter. reply-with and in-reply-to link an answer to the specific message it answers when several dialogues run at once, and reply-by is expressed on the sender’s own clock. Conversation control

Meaning comes from the communicative act library. Each act has a feasibility precondition, FP, which must hold for the sender to perform it, and a rational effect, RE, which the sender intends but cannot guarantee. For inform, with B for belief, Bif for “believes whether” and Uif for “is uncertain whether”:

⟨i,inform(j,φ)⟩:FP=Biφ∧¬Bi(Bifjφ∨Uifjφ),RE=Bjφ.\langle i,\mathrm{inform}(j,\varphi)\rangle:\quad \mathrm{FP}=B_i\varphi\wedge\neg B_i\left(\mathit{Bif}_j\varphi\vee\mathit{Uif}_j\varphi\right), \qquad \mathrm{RE}=B_j\varphi .

The first conjunct is sincerity: i must believe φ. The second is relevance: i should not inform j of something i already believes j has settled, or about which i believes j is uncertain; the library assigns those cases to other acts. Section 5.4 says that if i believes j believes not-φ, i should disconfirm, and if j is uncertain, i should confirm, whose FP is Biφ ∧ BiUjφ. Receiving an inform entitles j to believe that i believes φ and wants j to believe it; whether j actually adopts φ depends on j’s trust in i. Inform and confirm

The rational effect is therefore an intention, not a postcondition. The library illustrates this with a planning example: asking someone whether it is raining is a sensible way to pursue that information, yet the asker cannot assume the other agent will answer, because the other agent is autonomous. Communication semantics constrain what a sincere, rational sender may do; they do not make the receiver comply. Formal model introduction

The library defines twenty-two acts, from accept-proposal to subscribe. An agent that implements an act must follow its definition, but FIPA compliance requires implementing only not-understood. We also note a discrepancy in the version we read: the request act’s summary table gives the third FP conjunct as ¬BiIjDone(a), while section 5.4.2 writes Bi¬PGjDone(a). We do not resolve it; anyone implementing request semantics should check the intended version. Request act

Interaction protocols turn acts into a conversation. In FIPA Contract Net, an initiator sends a call for proposals, cfp, to m participants. Each participant may propose or refuse. After a deadline, carried in reply-by, the initiator evaluates the proposals that arrived, sends accept-proposal to the chosen ones and reject-proposal to the rest; proposals that arrive late are rejected with the reason that they were late. Proposals are binding: acceptance gives the participant a commitment to perform the task, after which it reports inform-done, inform-result or failure. Protocol flow

The deadline exists because without it the initiator cannot know when all replies have arrived and “may potentially be left waiting indefinitely”. Not-understood can occur at any point; in a one-to-many protocol it should be evaluated per participant rather than automatically terminating every sub-conversation. The initiator can also cancel through a separate meta-protocol, reusing the conversation-id. The figure and the prose use the same bookkeeping: of n responses, j are proposals and i=n−j are refusals; of the j proposals, k are rejected and l=j−k accepted. Exceptions and cancel

Counting messages makes the cost of a protocol concrete. Let m be the number of cfp messages, r the replies actually received (propose, refuse or not-understood), q the proposals answered with accept or reject (including late ones), and w the completion reports from accepted participants:

Nmsg=m+r+q+w,0≤r≤m,q≤r,w≤q.N_{\mathrm{msg}}=m+r+q+w,\qquad 0\le r\le m,\quad q\le r,\quad w\le q .

The selection rule used by our initiator considers only proposals that arrive by the deadline T:

a⋆=arg⁡min⁡k: tk≤T pricek,every proposal with tk>T receives reject-proposal.a^{\star}=\arg\min_{k:\ t_k\le T}\ \mathrm{price}_k,\qquad \text{every proposal with } t_k>T \text{ receives reject-proposal}.

The minimum-price criterion is our scripted choice; the specification allows the initiator to optimise price, completion time or fair task distribution, and to select one, several or no participants. Selection criterion

Trace one Contract Net and test a validator

The program represents every message as a dictionary with FIPA-style fields. A buyer sends five cfp messages with reply-by 10. Participant p1 proposes 40 at time 3; p2 refuses at time 2; p3 proposes 35 but arrives at time 12; p4 answers not-understood at time 4, standing in for an ontology it does not support; p5 never replies. The validator checks only rules we can observe in a trace: a performative is present, the sender’s role may send that act, the conversation-id matches, in-reply-to names a message actually sent to this agent, and the act is a permitted reply to the act it answers.

"""Original deterministic Contract Net simulation with FIPA-style message fields.
No network, no language model: every participant is a scripted rule."""
import json

PROTOCOL = 'fipa-contract-net'
ROLE_SENDS = {
    'initiator': {'cfp', 'accept-proposal', 'reject-proposal', 'cancel', 'not-understood'},
    'participant': {'propose', 'refuse', 'inform', 'failure', 'not-understood'},
}
ALLOWED_REPLIES = {
    'cfp': {'propose', 'refuse', 'not-understood'},
    'propose': {'accept-proposal', 'reject-proposal', 'not-understood'},
    'accept-proposal': {'inform', 'failure', 'not-understood'},
    'reject-proposal': set(),
}


def message(performative, sender, receiver, time, conversation_id='cn-1', **extra):
    msg = dict(performative=performative, sender=sender, receiver=receiver, time=time,
               protocol=PROTOCOL, conversation_id=conversation_id)
    msg.update(extra)
    return msg


def violations(trace, roles, conversation_id='cn-1'):
    """Return (index, reason) pairs for messages breaking the protocol rules used here."""
    found, sent = [], {}
    for index, msg in enumerate(trace):
        act = msg.get('performative')
        if not act:
            found.append((index, 'missing performative'))
            continue
        role = roles.get(msg.get('sender'))
        if act not in ROLE_SENDS.get(role, set()):
            found.append((index, f'{role} may not send {act}'))
        if msg.get('protocol') == PROTOCOL and msg.get('conversation_id') != conversation_id:
            found.append((index, 'wrong or missing conversation-id'))
        target = msg.get('in_reply_to')
        if target is not None:
            earlier = sent.get(target)
            if earlier is None or earlier['receiver'] != msg['sender']:
                found.append((index, 'in-reply-to names no message sent to this agent'))
            elif act not in ALLOWED_REPLIES.get(earlier['performative'], set()):
                found.append((index, f'{act} is not a reply to {earlier["performative"]}'))
        if 'reply_with' in msg:
            sent[msg['reply_with']] = msg
    return found


def contract_net(bids, deadline=10, horizon=1000):
    """bids: name -> (kind, arrival_time, price). kind is propose/refuse/confused/silent."""
    trace = [message('cfp', 'buyer', name, 0, reply_with=f'cfp-{name}', reply_by=deadline,
                     ontology='translation', content='translate 5 pages') for name in bids]
    replies = []
    for name, (kind, arrival, price) in bids.items():
        if kind == 'silent':
            continue
        act = {'propose': 'propose', 'refuse': 'refuse', 'confused': 'not-understood'}[kind]
        extra = {'content': price} if kind == 'propose' else {}
        replies.append(message(act, name, 'buyer', arrival, in_reply_to=f'cfp-{name}',
                               reply_with=f'{act}-{name}', **extra))
    replies.sort(key=lambda m: (m['time'], m['sender']))
    trace.extend(replies)
    close = deadline if deadline is not None else max([m['time'] for m in replies] + [horizon])
    if deadline is None and any(kind == 'silent' for kind, _, _ in bids.values()):
        return dict(trace=trace, winner=None, blocked=True, close_time=horizon)
    on_time = [m for m in replies if m['performative'] == 'propose' and m['time'] <= close]
    late = [m for m in replies if m['performative'] == 'propose' and m['time'] > close]
    winner = min(on_time, key=lambda m: (m['content'], m['sender'])) if on_time else None
    for m in on_time:
        act = 'accept-proposal' if m is winner else 'reject-proposal'
        trace.append(message(act, 'buyer', m['sender'], close, in_reply_to=m['reply_with'],
                             reply_with=f'{act}-{m["sender"]}', content=m['content']))
    for m in late:
        trace.append(message('reject-proposal', 'buyer', m['sender'], max(close, m['time']),
                             in_reply_to=m['reply_with'], reply_with=f'late-{m["sender"]}',
                             content='late'))
    if winner:
        trace.append(message('inform', winner['sender'], 'buyer', close + 5,
                             in_reply_to=f'accept-proposal-{winner["sender"]}', content='done'))
    return dict(trace=trace, winner=winner['sender'] if winner else None,
                price=winner['content'] if winner else None, blocked=False, close_time=close)


def inform_feasible(sender_believes_phi, view_of_receiver):
    """Operational inform precondition: B_i phi and not B_i(Bif_j phi or Uif_j phi)."""
    return sender_believes_phi and view_of_receiver == 'unknown'


def suggested_act(sender_believes_phi, view_of_receiver):
    if not sender_believes_phi:
        return 'none'
    return {'unknown': 'inform', 'uncertain': 'confirm', 'believes_not': 'disconfirm',
            'believes': 'none'}[view_of_receiver]


BIDS = {'p1': ('propose', 3, 40), 'p2': ('refuse', 2, None), 'p3': ('propose', 12, 35),
        'p4': ('confused', 4, None), 'p5': ('silent', None, None)}
ROLES = {'buyer': 'initiator', **{name: 'participant' for name in BIDS}}

if __name__ == '__main__':
    run = contract_net(BIDS)
    counts = {}
    for m in run['trace']:
        counts[m['performative']] = counts.get(m['performative'], 0) + 1
    ignore_deadline = min((p, n) for n, (k, _, p) in BIDS.items() if k == 'propose')
    bad = [
        {k: v for k, v in run['trace'][5].items() if k != 'performative'},
        message('accept-proposal', 'p1', 'buyer', 3),
        message('propose', 'p1', 'buyer', 3, conversation_id='cn-9', in_reply_to='cfp-p1'),
        message('propose', 'p2', 'buyer', 3, in_reply_to='cfp-p9'),
        message('inform', 'p1', 'buyer', 3, in_reply_to='cfp-p1'),
    ]
    detected = [violations(run['trace'][:5] + [b], ROLES)[-1:] for b in bad]
    views = ['unknown', 'uncertain', 'believes_not', 'believes']
    print(json.dumps(dict(
        messages=len(run['trace']), by_performative=dict(sorted(counts.items())),
        winner=run['winner'], price=run['price'], close_time=run['close_time'],
        lowest_price_ignoring_deadline=dict(price=ignore_deadline[0], agent=ignore_deadline[1]),
        clean_trace_violations=len(violations(run['trace'], ROLES)),
        injected_errors_detected=sum(bool(d) for d in detected),
        injected_error_reasons=[d[0][1] if d else None for d in detected],
        no_deadline=dict((k, v) for k, v in contract_net(BIDS, deadline=None).items() if k != 'trace'),
        inform_feasible={v: inform_feasible(True, v) for v in views},
        suggested_act={v: suggested_act(True, v) for v in views},
        sender_without_belief=suggested_act(False, 'unknown'),
    ), indent=2))
Recorded output
{
  "messages": 12,
  "by_performative": {
    "accept-proposal": 1,
    "cfp": 5,
    "inform": 1,
    "not-understood": 1,
    "propose": 2,
    "refuse": 1,
    "reject-proposal": 1
  },
  "winner": "p1",
  "price": 40,
  "close_time": 10,
  "lowest_price_ignoring_deadline": {
    "price": 35,
    "agent": "p3"
  },
  "clean_trace_violations": 0,
  "injected_errors_detected": 5,
  "injected_error_reasons": [
    "missing performative",
    "participant may not send accept-proposal",
    "wrong or missing conversation-id",
    "in-reply-to names no message sent to this agent",
    "inform is not a reply to cfp"
  ],
  "no_deadline": {
    "winner": null,
    "blocked": true,
    "close_time": 1000
  },
  "inform_feasible": {
    "unknown": true,
    "uncertain": false,
    "believes_not": false,
    "believes": false
  },
  "suggested_act": {
    "unknown": "inform",
    "uncertain": "confirm",
    "believes_not": "disconfirm",
    "believes": "none"
  },
  "sender_without_belief": "none"
}

The trace has twelve messages: five cfp, four replies received (two propose, one refuse, one not-understood), two accept-or-reject answers and one inform. This matches the count formula with m=5, r=4, q=2, w=1. The buyer accepts p1 at 40. The cheaper proposal of 35 from p3 arrived at time 12, after the deadline of 10, so it receives reject-proposal with content “late”. A buyer that ignored the deadline would have picked p3; the protocol trades a lower price for a predictable closing time.

Removing the deadline changes the outcome qualitatively. Because p5 is silent, the initiator that waits for every reply has no rule for closing and is still blocked at the simulation horizon of 1000 time units. This is the failure the Contract Net specification guards against with reply-by.

The validator reports zero violations on the generated trace and detects all five injected errors: a missing performative, a participant sending accept-proposal, a wrong conversation-id, an in-reply-to that names a message never sent to that agent, and an inform sent as a reply to cfp. The precondition table reproduces the operational inform rule: with a sincere sender, inform is feasible only when the sender has no belief about the receiver’s state; an uncertain receiver calls for confirm, a receiver believed to hold not-φ calls for disconfirm, and a sender that does not believe φ has no sincere assertive act available.

The program processes each message once, so validation is linear in trace length, and the auction step sorts at most m replies. These costs say nothing about real network latency, retries or message loss, none of which is modelled.

A validator checks form, not sincerity

Every check in the program is syntactic or structural. It can tell that p1 sent a propose in reply to a cfp; it cannot tell whether p1 believed it could deliver for 40. The inform precondition refers to the sender’s beliefs, which an external observer of a black-box agent cannot inspect. Our inform_feasible function only works because we hand it the beliefs directly. A deployed system has to replace mental-state semantics with something observable: signed commitments, logged obligations, penalties for failure, or reputation.

The time model is also idealised. reply-by is stated on the sender’s clock, so clock skew between platforms can make an “on-time” message late from the receiver’s perspective. Real transports duplicate, reorder or drop messages; at-least-once delivery requires idempotent handling keyed by conversation-id and reply-with. Our simulation delivers every non-silent message exactly once and in timestamp order.

Shared ontology is the hardest layer. The not-understood reply from p4 only signals failure; it does not repair it. KQML and FIPA both leave the content language and ontology to separate agreements, which is why two systems that “speak FIPA ACL” can still fail to understand each other’s content.

Finally, we read the 2002 FIPA standards and a 1994 KQML paper. They show how these languages were designed, not how widely they were later adopted, and we make no claim about current platform support.

Count, classify and choose

  1. Only the performative is mandatory in a FIPA ACL message. What goes wrong if an agent routinely omits conversation-id while taking part in a protocol?

    Answer: The specification requires a non-null conversation-id for any message whose protocol parameter is set, and the initiator must assign one. Without it, an agent running several Contract Nets at once cannot reliably tell which proposal answers which call. Omitting parameters that can be “deduced from context” is permitted only without an interoperability guarantee.

  2. An initiator sends cfp to six participants. Two refuse, one stays silent, three propose, but one of the three proposals arrives after reply-by. The single accepted participant later reports failure. How many messages are exchanged?

    Answer: m=6 cfp, r=5 replies received (two refuse, three propose), q=3 accept-or-reject answers (one accept, one on-time reject, one late reject), and w=1 failure. N=6+5+3+1=15. The silent participant contributes only its cfp.

  3. Agent i believes φ and believes that j is uncertain about φ. Should i send inform? What if i does not believe φ but is asked about it?

    Answer: Inform’s FP fails because i believes j is uncertain whether φ, so the relevance condition is violated; the library assigns this case to confirm, with FP Biφ ∧ BiUjφ. If i does not believe φ, the sincerity conjunct fails for inform and confirm alike. If i instead believes ¬φ, inform-if lets it inform j that ¬φ; an agent with no knowledge of φ would send refuse.

  4. You connect two tool-using software agents built by different teams. One proposes a free-text chat channel; the other proposes typed performatives with conversation-id and reply-by, but free-form content. Which do you choose for a procurement workflow, and what remains unsolved?

    Answer: Use typed performatives and conversation control: they make obligations (propose versus inform), timeouts and reply matching machine-checkable, as the validator shows. Content meaning is still unsolved: you also need an agreed schema or ontology for prices and tasks, plus enforcement for commitments, because the protocol cannot verify sincerity.

Read the specification, then the trace

KQML is useful for seeing why a performative layer was separated from content and transport, and why facilitators were introduced to locate agents. KQML paper The FIPA message structure fixes parameter names and conversation rules; parameters the act library supplies formal semantics and also shows its own internal inconsistencies; act library Contract Net is a compact example of deadlines, binding proposals and exception handling. Contract Net

When evaluating a modern agent protocol, ask the same questions in the same order: which act is being performed, what does it commit the sender to, how are replies matched to requests, when does a conversation close, and who can verify a commitment. A protocol that answers the first four but not the fifth is a message format, not yet a contract.

Make a prediction, then check

In Contract Net, a participant submits a lower price after the reply-by deadline. What should the initiator do under the FIPA specification?

Choose one answer

Learning objectives

  • Separate performatives, content, content language/ontology and conversation-control parameters, and explain feasibility preconditions and rational effects of FIPA acts.
  • Trace a deadline-bound Contract Net, count its messages, and state what a protocol validator can and cannot check.

Prerequisites & connections

Explore related knowledge →

References

  1. KQML as an Agent Communication Language — scoped author preprint
    Tim Finin; Richard Fritzson; Don McKay; Robin McEntire · 1994
  2. FIPA ACL Message Structure Specification SC00061G — scoped archived standard
    Foundation for Intelligent Physical Agents (FIPA TC Communication) · 2002
  3. FIPA Communicative Act Library Specification SC00037J — scoped archived standard
    Foundation for Intelligent Physical Agents (FIPA TC Communication) · 2002
  4. FIPA Contract Net Interaction Protocol Specification SC00029H — scoped archived standard
    Foundation for Intelligent Physical Agents (FIPA TC Communication) · 2002

Version1 · Editorial status: Recorded technical checks completed

View technical check record (AI)

Claude · 2026-12-02 · Independent AI check (Claude subagent, not the author); this is an automated AI technical check, not a human or expert review. Ran example.py with python3 and diffed it against example.stdout.txt (identical); confirmed the python block in en.mdx and zh.mdx is byte-identical to example.py; checked that display equations, source IDs, reference links and section anchors match across languages; recounted the trace (5 cfp + 4 replies + 2 accept/reject + 1 inform = 12) and exercise 2 (6+5+3+1=15). Re-read, via pdftotext, the UMBC KQML preprint (pp.1 and 4-5, performatives, ask-one/ask-all/stream-all, Figure 8, ARPA Knowledge Sharing Effort) and the three FIPA standards through the same Wayback snapshots the article links (fipa.org itself was not used): SC00061G sections 2-2.5.5, SC00037J sections 2.1, 3.5, 3.8, 3.9, 3.19, 5.1 and 5.4.1-5.4.4, and SC00029H sections 1-1.2 with the Figure 1 text labels. Not checked: KQML section 4 onward or the typeset CIKM version, other FIPA acts, the SL sections, and the Contract Net figure as an image.

  • Re-read the FIPA act library: the request FP really differs (¬B_i I_j Done(a) in 3.19 versus B_i ¬PG_j Done(a) in 5.4.2); the inform and confirm FPs and the 5.4.1 rule that a believed ¬φ calls for disconfirm match the text; compliance requiring only not-understood (sec 2.1) is confirmed.
  • Re-read Contract Net section 1.1: Figure 1 labels j=n−i, k≤j, l=j−k and prose i=n−j express the same counts, so the reported inconsistency does not exist and was corrected; deadline, late rejection, binding proposals, per-participant not-understood and the cancel meta-protocol are supported.
  • Checked the ACL message structure spec: 13 parameters in five categories, only performative mandatory, X- prefix, conversation-id rules under a non-null protocol, reply-by on the sender's clock and no interoperability guarantee for omitted parameters all match; all three FIPA URLs and notes state they are Wayback snapshots.
  • Compared zh and en section by section: claims, numbers, exercises and answers match; scope stays on message semantics and conversation control, with Contract Net used only as a protocol example rather than a task-allocation treatment.

Source locations checked:

  • KQML as an Agent Communication Language — scoped author preprint · pdftotext of 8-page UMBC preprint: page 1 abstract/intro; section 3 pp.4–5 (extraction lines 225–330) read in full: content opaque to KQML, performative role, ask-one/ask-all/stream-all, Figure 8 two dozen performatives in seven categories, advertise/recruit. Facilitator figures 3–6 (recruit, broker, recommend) seen only via keyword lines. Not read: section 4 onward, published CIKM typeset version.
  • FIPA ACL Message Structure Specification SC00061G — scoped archived standard · Wayback 20250104010524 PDF, pages 1–6 (doc lines 64–224) read in full: Table 1 thirteen parameters, mandatory performative, X- prefix, not-understood, protocol rules, conversation-id uniqueness, reply-with/in-reply-to, reply-by on sender clock. Not read: references (p.7) and change-log annex detail.
  • FIPA Communicative Act Library Specification SC00037J — scoped archived standard · Wayback 20241005070724 PDF (45 pages): contents list of 22 acts; sec 2 (p.2) compliance only requires not-understood; 3.1 (p.3); 3.8 inform and 3.9 inform-if (pp.10–11); 3.19 request FP with ¬Bi Ij Done(a) (p.25); 5.1 (pp.30–31, Harry/Sally example paraphrased only); 5.4.1–5.4.3 (pp.35–36) inform/request with Bi¬PGj Done(a)/confirm FP. Not read: other acts, SL 5.2–5.3, 5.5–5.6.
  • FIPA Contract Net Interaction Protocol Specification SC00029H — scoped archived standard · Wayback 20241205154809 PDF (9 pages): pages 1–3 lines 47–112 read in full; Figure 1 only as extracted text labels; start of Figure 2 cancel meta-protocol. Quote 'may potentially be left waiting indefinitely' (8 words) from 1.1. Not read: references, annex.

Related topics

No matches. Try a synonym or acronym.

0 results shown

Wrap the whole query in double quotes for a phrase match.