Make doc retriever work in main app