added update_knowledge_base function.