Interactive Visualization of the KB-AGENT Algorithm
Key Operations: TELL Adds a sentence to the KB | ASK Queries the KB to infer information
TELL→Add a new fact to the Knowledge Base
ASK→Query the KB to infer information
Location(Agent, [x, y], t)→Agent is at position [x,y] at time t
Percept([...], t)→What the agent senses at time t
Action(type, t)→Action taken at time t
Convert percept into logical sentence and TELL to KB
Use ASK to query KB and infer best action
Add chosen action to KB and execute in environment
Increment time counter and repeat cycle
TELL (add facts) and ASK (query)TELLASK to reason about the worldHere are examples of what you'll learn when you click on KB entries during the demo:
Means: At time 4, the agent sensed Stench and Breeze. This information is being added to the KB. The agent will use this to infer that there might be danger nearby.
Means: At time 3, the agent is asking: "Given everything I know in my KB, what's the safest/best action to take now?" The inference engine processes all the facts to answer this.
Means: After reasoning about the percepts and current knowledge, the agent concluded that "Turn" is the best action. This wasn't told to the agent - it figured it out through logical reasoning!
Means: At time 3, the agent is at position [2, 3] in the grid. This is stored so the agent always knows where it is and can reason about its location.
Means: The agent is recording that it detected stench at location [2, 3] at time 4. This helps build a map of the environment and warns of the Wumpus nearby.
Means: The agent is recording that it performed the "Turn" action at time 3. This creates a history of what the agent has done, which can be useful for future reasoning.