Thanks for the article.
Yoanis Gil Delgado
11

Sure thing. So first of all reviewing some things I mentioned in the article. The store is a javascript singleton that has a users hashtable that maps to each user’s store state. The reason why I suggest this approach is because in most situations, more than just one user will be interacting with your interface. Because of this, we need to keep track of each user’s individual state.

In the example of the Spotify music recommendations, we need to keep track of data from the user like genre of music and number of recommendations they want. Knowing that, we model the initial state with a genre and numberOfRecs property. When we get the information we need, we call the update function on the store and update the user’s state data.

Stores are server-side, just like the rest of the system. In the case of conversational interfaces, chat messengers like Telegram and KiK are what I consider the client. The API that handles the webhooks and events fired from the clients is the server.

Note: The commands property inside the store state might be a bit confusing. All it does is keep track of where the system is in terms of the conversation tree.

Like what you read? Give Jonathan Z. White a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.