add retract from knowledgebase and change logic in saveArtifact