In using Wonderchat as the AI chatbot for the Knowledge Base that I run for my company, I wanted an easy way to:

* Understand the Chat API
* Understand the Add Pages and Delete Pages API
* Have a way to add or remove a list of URLs easily

So I made which is a Python script you can run and pop in your API key and Bot ID and in an easy way see how the API works and be able to make bulk changes. I wrote it using ChatGPT 4 Code Interpreter for the most part because I wanted to see how it would do, but also because then I could just keep feeding it my ideas and then I could take the code and do Pair Programming ( ) to have a partner in development. It came out pretty good, I think. It does everything I want it to, and maybe in sharing it, someone will have improvements to contribute. I'm really hoping they document a List Pages API endpoint and probably a Reindex Pages API because then I could do even more things and I wouldn't have to Remove then Re-add pages to cause a Reindex.

For the moment I took what I learned and over in Zapier I made 3 actions.

1) Page Added - Use add-pages API
2) Page Deleted - Use add-pages API
3) Page Updated - Use remove-pages API, Sleep 1 min, Use add-pages API

My KB ( ) has 3 Webhooks it uses with Zapier for those 3 possibilities and then uses the API to tell wonderchat to add/remove/update a page in its index. In this way, I won't have to do a full re-index of my KB except maybe every couple of months to catch a couple of edge cases that aren't caught by my workflow like if a page is renamed the new page is indexed but the old one stays in the index. That's because the Webhook from BookStackApp doesn't include the old URL when it says a page was updated.

If you are looking for a solid Knowledge Base system, then BookStackApp ( ) is worth looking at. It's solid. I made a script for that as well to search it for text across the whole KB for the purpose of fixing things like Azure AD is now Microsoft Entra ID. I will probably publish that too when I clean it up a little to help others. Did I mention that FileWave also has great APIs ( ) ? Great open APIs make the world a better place.

If you go down the path of having an AI Chatbot maybe check out my other post about the prompt I use for my Chatbot:

Wonderchat API Helper