While I have not used your exact scenario - I have built an knowledge base that gets updated from an external source which recreates/updates the existing knowledge base file with most recent information about a client services. I used the files API to achieve this task. Check the documentation on files API, maybe you will get some hints