Team Pr. Unit 8

Unit 6 - Creating Agent Dialogues

For this task, I created a sample dialogue between two software agents using KQML (Knowledge Query and Manipulation Language) as the communication protocol and KIF (Knowledge Interchange Format) for expressing the knowledge content.

In the scenario, Alice is a procurement agent responsible for sourcing products, and Bob is a warehouse agent who manages stock levels. Alice inquires about the availability of 50-inch televisions and their HDMI specifications.

;;; Alice sends a query to Bob asking about the stock of 50-inch televisions
(kqml
  :performative ask-one
  :sender Alice
  :receiver Bob
  :language KIF
  :ontology warehouse-stock
  :content
    (exists ((?tv television))
      (and
        (has-size ?tv "50 inch")
        (in-stock ?tv ?quantity))))

;;; Bob replies with the quantity available
(kqml
  :performative tell
  :sender Bob
  :receiver Alice
  :language KIF
  :ontology warehouse-stock
  :content
    (and
      (has-size tv-001 "50 inch")
      (in-stock tv-001 24)))

;;; Alice then asks how many HDMI slots the televisions have
(kqml
  :performative ask-one
  :sender Alice
  :receiver Bob
  :language KIF
  :ontology warehouse-specs
  :content
    (has-feature tv-001 (hdmi-slots ?slots)))

;;; Bob responds with the HDMI slot specification
(kqml
  :performative tell
  :sender Bob
  :receiver Alice
  :language KIF
  :ontology warehouse-specs
  :content
    (has-feature tv-001 (hdmi-slots 3)))