changes to KnowledgeAgent to support scanning