The practical limitations of RiveScript mostly come down to how much RAM you have available (as the whole brain has to exist in memory to be used), and when you start getting a large amount of triggers, the speed of the processor and/or programming language runtime.
I have this GitHub repo where I was using the Alice brain to benchmark the performance of RiveScript across all the various implementations: https://github.com/aichaos/alice-benchmarks
Each of the implementations have varying performance for how quickly they can parse the .rive files and then how quickly they can scan their memory for a response. JavaScript performs the best overall.
A note about Alice, though: because of the way AIML works as opposed to RiveScript, Alice isn’t the most optimized brain for RiveScript. For example, in AIML you need one pattern for every permutation of a message (“hi”, “hello”, “hey”, etc.), whereas in RiveScript all the permutations can be represented in a single trigger; and Alice’s brain is full of triggers for all kinds of facts (“what is the capitol of Texas?”), and these could be greatly trimmed down by using an object macro that looks up facts in a database rather than needing so many hundreds of triggers. A bot personality designed for RiveScript could perform a lot better and with less triggers than the AIML-converted Alice brain.
Am I correct in that the same amount and name of inserted brain files must reside in both the brain folder AND in the chat.html file?
If you’re using rivescript-js embedded within a web page, then yes, you’ll have to manage the list of .rive files in your JavaScript (HTML) source. That’s because there isn’t a consistent way for JavaScript embedded in a web browser to enumerate the files in a directory on the server (for example, Apache and nginx both have different formatting for listing directories, and it would be an uphill battle to make RiveScript aware of how to handle these). If you’re using RiveScript from a server side program (in Node.js or otherwise), you can use the `loadDirectory()` function and just give it the path to the folder and it will automatically find the .rive files inside.
Also, to go back to the limitations on RAM and CPU speed, when you’re embedding RiveScript in a web page, the limitations are applied to the end user’s computer and not the server. This can result in varying performance depending on the end user’s device; if they’re on an older or weaker computer, or viewing your bot on their mobile device (which tend to be less powerful than desktop computers), the performance may drop for an especially large bot. If your RiveScript sources add up to about 2MB, you can roughly expect that ~2MB of RAM will be needed on the end user’s device to contain the bot in memory, and if the bot has to scan through 50,000 triggers on average to find a match to the user’s message, this can take longer on weaker devices than on more powerful ones.
If you’re running an Alice-sized bot, it would probably be better to run the bot on the server side and have the web front-end talk to it via ajax or websockets. This way you can fully control the RAM and CPU behind the bot with your server’s configuration and provide a consistent experience to the end user, regardless of their own device.