Add knowledge base retrieval functionality