CS5940 Model Map ⌂ Modules
Deliberative agentWeek 25 techniques

Agent0 (agent-oriented programming)

Program an agent directly in terms of what it believes, what it can do and what it has promised. Agent0's whole behaviour comes from commitment rules: "if I get this message and believe this, commit to that action".

Kind: deliberative agent (agent-oriented programming).
Week: 2 (slides 16 to 27, appendix on PLACA).
Book: Wooldridge 3.2 Agent-oriented programming (pp. 55 to 56).
Techniques on this page: reading Agent0 notation, applying a commitment rule, message types, the Agent0 cycle, Agent0’s implicit goals and PLACA.

The problem it solves

In week 1 we described agents using everyday mental words: it believes the door is shut, it promised to open it. Shoham (1993) asked: why not program agents in exactly those words? That’s agent-oriented programming (AOP), and Agent0 is its first language.

It’s also the first architecture built for many agents talking to each other: agents send each other REQUESTs and INFORMs, and an agent decides for itself whether to accept a request. “Objects do it for free; agents do it because they want to” becomes actual code.

Words you’ll hear

Word or symbol Plain meaning
AOP agent-oriented programming: programs written in beliefs, capabilities and commitments
intentional stance explaining a system as if it had beliefs and desires (book 2.4)
\(B^t_a\ \varphi^{t'}\) at time \(t\), agent \(a\) believes \(\varphi\) holds at time \(t'\)
\(CAN^t_a\ \varphi^{t'}\) at time \(t\), \(a\) can make \(\varphi\) true at time \(t'\)
\(CMT^t_{a,b}\ DO^{t'}\ \alpha\) at time \(t\), \(a\) is committed to \(b\) to do \(\alpha\) at time \(t'\)
commitment rule if a message condition and a mental condition match, commit to an action
REQUEST / UNREQUEST ask another agent to do (or stop) an action: changes commitments
INFORM tell another agent a fact: changes beliefs
REFRAIN block commitments to an action

Technique 1: reading the notation

Problem it solves: the symbols look scary but follow one pattern.

The first time is when the attitude is held; the inner time is when the fact is true or the action happens.

Agent0 has four components:

  1. Capabilities: \(CAN^5_{robot}\ open(door)^8\): at time 5 the robot can make sure the door is open at time 8.
  2. Initial beliefs: \(B^3_a\ closed(door)^7\): at time 3, \(a\) believes the door will be closed at 7. They can nest: \(B^0_a B^{10}_b\ like(a,b)^7\).
  3. Initial commitments: \(CMT^0_{a,b}\ DO^{12}\ raise(alarm)\): at time 0, \(a\) is committed to \(b\) to raise the alarm at 12. A commitment is always to someone.
  4. Commitment rules, which drive everything else.

Worked example: translate.

  • \(B^2_a\ open(door)^5\): “at time 2, \(a\) believes the door will be open at time 5.”
  • \(CMT^1_{a,b}\ DO^4\ close(door)\): “at time 1, \(a\) is committed to \(b\) to close the door at time 4.”

Technique 2: applying a commitment rule

Problem it solves: decides whether the agent takes on a new commitment.

\[COMMIT(\textit{msgcond},\ \textit{mntlcond},\ \textit{agent},\ \textit{action})\]

  • msgcond is matched against the messages received;
  • mntlcond is matched against the agent’s beliefs and commitments;
  • if both match, the agent becomes committed to the action.

The slides’ rule, in words: if I get a REQUEST from an agent to do an action at some time, and I believe that agent is a friend, and I can do the action, and I’m not committed to anything else at that time, then commit to it.

Worked example. At cycle 5, agent \(a\) receives (b, REQUEST, DO(10, open(door))). It believes \(Friend(b)\), has the capability \(open(door)\), and already has \(CMT_{a,c}\,DO^{10}\,water(plants)\).

  • Message condition: a REQUEST from \(b\) ✓.
  • \(Friend(b)\) ✓; \(CAN(a, open(door))\) ✓; not committed to anything at 10: ✗.

The rule does not fire. If the plant-watering were at time 11 instead, it would fire and add \(CMT_{a,b}\,DO^{10}\,open(door)\).

Technique 3: actions and messages

Problem it solves: knowing which message changes what.

  • Private actions (DO time action): run internally.
  • Communicative actions: (REQUEST time agent action) and (UNREQUEST time agent action) change the receiver’s commitments; (INFORM time agent fact) changes its beliefs; (REFRAIN action) blocks commitments to an action.
  • Conditional actions (IF mntlcond action): e.g. if I believe Smith works at IBM at \(t\), inform \(a\) at \(t + 1\).

The airline example (slide 18) shows the style: the passenger requests, the clerk informs, refuses a double booking because of a constraint, and requests permission from a supervisor.

Technique 4: the Agent0 cycle

Problem it solves: how the agent actually runs. All agents run in step; time = cycle number.

  1. Read the messages that arrived last cycle; update beliefs and commitments using the commitment rules.
  2. Reconsider each commitment in the light of the new beliefs.
  3. Execute the actions of commitments whose time is now (if the capability still holds).
  4. Repeat.

Technique 5: implicit goals, and PLACA

Problem it solves: explains what Agent0 can’t do, and what fixes it.

Agent0 has no explicit goals. Each agent’s implicit goal is to (a) honour each commitment while it still believes it’s capable, and (b) tell the requester as soon as it believes it no longer is. It can’t ask for help with a request it accepted (it only accepts requests it can do itself).

PLACA (Thomas 1993) adds planning and requests via high-level goals: its rules can ADOPT (INTEND ...) and inform the requester (“if someone asks me to print something, and I can, and they’re not a manager, and I’m not busy, adopt the intention to print it by 5pm and tell them”).

Discussion (slide 27): rigid commitment or delegation? For LLM agent teams, an overloaded agent that quietly hands work to another breaks accountability (the requester trusted this agent) and can cascade. Going back to the requester keeps control but adds delay. A middle ground is delegation with notification, the PLACA style.

What to read in the book

Section Read? Why
3.2 Agent-oriented programming, pp. 55 to 56 Read Agent0 in two pages. The slides go further (notation, conditional actions, goals)
2.4 Agents as intentional systems Skim The intentional stance AOP is built on
PLACA Not in the book Slides’ appendix only. Optional

Page numbers are the book’s; in the scanned PDF add 21.

Practice prompt

I'm studying CS5940 Intelligent Agents (Wooldridge, An Introduction to MultiAgent Systems, 2nd ed., 3.2; Shoham's Agent0). I want practice on AGENT0 and AGENT-ORIENTED PROGRAMMING:
- the idea of AOP and the intentional stance
- reading and writing Agent0 notation: B^t_a phi^t', CAN^t_a phi^t', CMT^t_{a,b} DO^t' action (which time means what)
- applying a commitment rule COMMIT(msgcond, mntlcond, agent, action) to a given message, beliefs, capabilities and existing commitments: does it fire?
- REQUEST, UNREQUEST, INFORM, REFRAIN and conditional actions: which change beliefs and which change commitments
- the Agent0 execution cycle
- Agent0's implicit goals, why it can't ask for help, and what PLACA adds
- the rigid-commitment vs delegation discussion for LLM agent teams

Please:
1. Use plain, everyday language and explain any notation in one short sentence.
2. Give me ONE question at a time, easy first, then harder.
3. Wait for my answer, then mark it and show a model answer, checking each condition of a rule one by one.
4. If I get it wrong, explain the mistake and give me a similar question.
5. Every 5 questions, summarise my strengths and what to practise.