superscriptjs / superscript

A dialogue engine for creating chat bots
http://superscriptjs.com
MIT License
1.65k stars 209 forks source link

Add new topics and plugins with zero down time #372

Open alexraj opened 7 years ago

alexraj commented 7 years ago

What is the best way to dynamically add a new topic and plugin, with out disturbing chatbot service.

Topic or Gambit: Add a file or edit a file under chat directory, and run "parse -f & clean". This has two problems;

  1. It requires parsing and adding all topics, even though there is just one gambit added.
  2. The DB could be in a stale state while loading

Plugins: It is a must to restart the service, after changing a file under "plugins" directory. If I write a hook to listen "plugins" directory, can a new or changed file be passed on to superscript to rehash the plugins? Again, the plugins from unchanged files should be left alone.