5DV248 · Trustworthy Human-AI Interaction · Interactive laboratory

Lab 12 — Inside a Knowledge-Based Agent

Explore how an agent receives percepts, updates its knowledge base with TELL, asks questions with ASK, and selects an action. You will operate a simple assistant for a synthetic district-heating plant.

Knowledge-based agentsFacts and rulesTELL and ASKInteractive experiment

What you will investigate

Not receivedLatest percept
3Stored facts
—Last ASK result

This is a synthetic teaching scenario. It does not represent Umeå Energi's actual equipment, operating thresholds or safety procedures.

1 · The agent architecture

Follow the same flow as the architecture in the lecture slides. Work from the environment towards the agent's decision and action.

1Environment and sensors

The plant has a boiler, pressure sensor and temperature sensor. Change the conditions to simulate what the sensors detect.

No new percept has been generated. Change the environment and press the button.

2What the world is like now

This is the percept received from the sensors. The agent does not automatically know every detail of the plant.

Waiting for sensor input.

3What action should I do now?

The agent can only use the information stored in its knowledge base. First TELL it about the percept; then ASK it for a recommendation.

Generate a percept to begin.

2 · The agent's knowledge base

The knowledge base contains general facts about the plant and rules that connect conditions to possible actions. The representation is deliberately shown in ordinary language.

Stored facts
Boiler B1 is part of Plant P1.
Sensor S1 monitors the pressure of Boiler B1.
Sensor S2 monitors the temperature of Boiler B1.
Rules available to the agent
Rule 1
IF pressure is high AND the sensor is unreliable, THEN verify the pressure reading.
Rule 2
IF pressure is high AND an independent sensor confirms it, THEN escalate for operator assessment.
Rule 3
IF pressure is high AND the sensor is reliable AND there is no independent confirmation, THEN inspect the pressure condition.
Rule 4
IF pressure is normal, THEN continue monitoring.
Rule 5
IF temperature is high, THEN inspect the temperature condition.

3 · Agent decision and explanation

After ASK, the agent displays the action selected by its rules and the facts supporting that action.

No decision yet Waiting for ASK

Generate a percept, TELL the agent, and then ask what it should do.

Decision trace

The agent's reasoning steps will appear here.

4 · Try these experiments

Change the environmental conditions, generate a percept, press TELL, and then ASK. Compare the resulting actions.

Experiment A — Unreliable sensor

High pressure · Sensor unreliable · No confirmation

Expected behaviour: verify the pressure reading.

Experiment B — Independent confirmation

High pressure · Independent confirmation available

Expected behaviour: escalate for operator assessment.

Experiment C — Reliable sensor

High pressure · Sensor reliable · No confirmation

Expected behaviour: inspect the pressure condition.

Experiment D — Normal operation

Normal pressure · Normal temperature

Expected behaviour: continue monitoring.

Try changing one thing at a time. For example, keep pressure high but change sensor reliability. Does the agent's recommendation change? Which stored rule explains the change?

5 · Does the agent need to know everything?

Imagine that the plant contains hundreds of components, but the agent's current task is only to decide what to do about a high-pressure observation from Boiler B1.

Does it need a complete representation of the entire plant before it can make this decision?

Choose an answer to reveal the explanation.

Connecting to the next topic: Ontologies

Our agent knows that Sensor S1 monitors Boiler B1. But what exactly is a sensor? What makes a pressure sensor different from a temperature sensor? Can we define that a PressureSensor is a type of Sensor?

Next lecture: Ontologies provide an explicit model of concepts, classes, relationships and their meaning. We will learn how to represent this knowledge more formally.