updating agent behaviour

updating version of the KBAgent. Almost working perfectly.