Custom retriever for knowlege

I’m migrating my project to CrewAI. I already have a retriever for RAG implemented with LangChain that works well for me. The default functionality of CrewAI Knowledge does not seem sufficient for my use case (using EnsembleRetriever, ParentDocumentRetriever, etc.), so I plan to bring my existing retriever code.

What is the recommended way to do this? Should I create a new class that inherits from BaseKnowledgeSource? Implement my retriever as a tool? Or is there another recommended approach?

Extending BaseKnowledgeSource is the way to go. You can see the docs here Knowledge - CrewAI