Add KB selection support in the pipeline