 Thank you, Min. Hi, everyone. Our first talk is about interfacing an OLAP cube with a chatbot written with React. So let me first introduce myself. I'm Nida. I've been working with Active VM company for the past 12 years. I'm coding mostly in Java and JavaScript. Used to be coding in Perl, C, C++ a few years ago. In Singapore for the past eight years. And I will be co-presenting with Lisa. Thank you. I don't know if this is going to work. Hi, guys. I'm Lisa Martini. I'm also a software engineer in Active VM. I joined Singapore one year ago, and I love it. It's really nice. I just graduated last year from a French engineering school. And mostly I'm full stack, but I really like front-end technologies. So yeah, mostly done for me. Nida is going to explain you the rest. OK. So before Lisa introduces the amazing chatbots, so let me give you a bit of context. So what you're going to see is a prototype that Lisa built that has been integrated in our product suite. Our product suite is made with a back end. Named Active Pivot, which is an OLAP in memory database. I will introduce OLAP later on. This is written in Java. The front end is named Active UI. This is the one you will see in action. This one is written in JavaScript with React. So some of you who are as old as me, when they hear OLAP, they will tell like, oh, what the hell, like OLAP sounds like 1990s. And the company age is almost 13 years old. So when we started building our product, we tried to build the next generation multi-dimensional database. Active Pivot, the back end, the server is not only in OLAP, but it is also an OLTP, which means you can query this multi-dimensional database. And you can at the same time add transaction, which is almost impossible in all the old OLAP technologies and even the current ones, where you need to destroy this database and to rebuild it again when you have new data. In our case, we are incremental, and you can keep adding data into the engine. So it's an aggregation engine that allows you to browse your data. You feed this multi-dimensional database with a lot of data, and then you can build your own reports. You can start browsing the data. This runs in memory, in the memory in the RAM of the server. I won't give more detail on the topic. If you want to know more, just catch me. Let's give you an idea of what OLAP is. Usually, when we mention OLAP, we usually say OLAPQ. So to introduce the concept, usually we use something like this Rubik's Cube, where we tell you, OK, there are three dimensions, three analysis dimension here. One is called product. One is called time. And one, special one, that holds the measures. The measures are those metrics, those values that you will see, look at, and make decisions while looking at them based on your business and your use case. And usually, when you are in the OLAP world, we always speak about slicing and dicing. So in this case, if I want to check what the profit made with alcoholic beverages for February, I will definitely look for that light blue dice. So OLAP is no more than in this multidimensional structure looking for the dices I need to build my report. And the query language for the OLAP structure is called MDX, multidimensional expressions. You will see some of it later on. It looks like SQL because you have select where from. But this is the only thing they have in common. It's really misleading. So do not, if you want to learn this language, which is kind of standard implemented by many players, started by Microsoft. Documentation is on their MSDN. But do not try to compare it with SQL. So Excel, Tableau, and many other tools support this language. Are able to query our back end. And we, of course, implemented our own front end. That queries this back end implementing MDX. The data model we're going to use today is quite simple. So I have employees. Those are my salesmen. They're doing some orders for some customers. And every order is related to a product. It's as simple as that. The database has been already fed with the data. So you will see only the results. You will fire queries, and you will see the results. So it will be in this context. Just for you to see how it looks like. Oh, wait a minute. You have to show it under. Sorry, yep. Sorry. Oh, yes, sorry. Would be better. Oh, come on. Slide it again. Sorry. Come on. Yeah, thank you. We're good. OK, so I'll pick up something that we call pivot table. Similar to the pivot table you see in Excel. This one runs within a browser. So here you have the data model that I was mentioning earlier. So all the data is loaded in the back end. There is no canned reports here. There are no canned reports. So say I want to check my margin, my revenues per product. So you keep doing like a drag and drop. And of course, those are the dices you're looking at. If you want to do a breakdown, you can see by product. You can see directly this. Every time you try, every time you press, like you expand, you collapse, you will see here on the right, you will see the MDX changing. So most of the time, the MDX is generated by the front end that are interacting with the back end solutions. Even among our clients, most of the, there are some proficient business analysts who are writing MDX. But most of the clients, they build their report by browsing the data. OK, I want to see my products, my revenues by products. I want to add this by this way. I want to add salespersons here. So now I have products and salespersons that are stacked together. I want to stack it the other way. So as you can see, you are free to build. It's a self-service reporting. However, for the aim of the prototype that Lisa did, what we wanted to do, we said, OK, even some, maybe one day we'll have the issue where some end users, they don't even want to play with the pivot table. Let's find another nice way, a funny way, that will bridge the gap and that will take some normal sentences and send them to the back end. So of course, Lisa will introduce you to the architecture and will give you a demo. Thank you. I think it's fine. So now I'm going to present you the chatbot. So just before that, I'm going to explain you a little bit the flow. Oh, sorry, yeah. Yep. OK, yes. Yeah, good. OK, so the first thing is the user is going to ask a question to the active UI, so to the browser, to the chatbot, who's going to send a, sorry, it's quite loud, who's going to send the request to an external NLP service, so natural language processing. And I'm going to introduce you just later on. And then I'm going to receive an entity's object. And from that, I'm going to build MDX queries to send it to the active pivot to our server, get the response, and display something. So either a simple sentence or pivot table has neither showed or even chart or whatever. So let's go for this. OK, so we get up here. Going to load. Yep, I hope I will have this sound. And let's start to interact with the chatbot. How are you? OK, yes, I think that's fine. I'm going to turn off the sound at the end. It's going to be annoying. Thank you anyway. Oh, sorry. So it works for real. Yeah, so let's say something else. No. What were the revenues yesterday? OK, let's try that way. All right. It's really good. What were the revenues yesterday? OK, great. Again? Yeah, what were the revenues yesterday? We get. Nice, worked. That was nice. So for that, I just ask a simple question about the revenue yesterday. I can also ask something like maybe I don't know what to ask. So I'm just going to say, I can do it. Help, help, help, and we're good. OK, so I'm just going to shut down the sound. It's going to be kind of annoying at some point. And I can go here on a simple request. And maybe I can ask, like, are there purchases for Betrayage on the first of Jan of this year? And that's something. And it works also. So something pretty simple also has a question, but that works. So I think you understand the concept, understand that I can say something. I'm going to write it down now because it's going to be complex. So now, let's say I want to ask something just a little bit. More complex. So with more measures, more dimensions, you're going to see. So let's try what are the revenues, margin, and purchases for Cheng, the beer, which is a product, condiments, condiments, and confections, which are products category four days ago. Oh, sorry. And here you have the same pivot table. I'm just going to resize this part. And here you have the product, Cheng, which is in the category beverage, the two categories, condiments, and confection. And you have the revenues, the margin, and the purchase. So just to remind you, these kind of data are not pre-computed. It's like it's aggregated data that it's computed on demand. So just a few reminder of what's happening here. Come back here. So earlier on, you were demonstrating that you could build this multi-dimensional thing. So when you send it the commands, are you just executing a predefined multi-dimension thing, or are you actually telling it to construct a model on the fly? I'm constricting the model on the fly. Yeah. It depends what you mean exactly by model, constructing the model on the fly. The structure of the cube will not change. However, when you fire a query, you pick up the dices that are related to your query. Sometimes you want to get all the dices related to a certain category of product, or a product name. This is what you do. See that way, you have a multi-dimensional structure sitting somewhere, and you fire the query you want. You fire the query. So in a sense, you're- You drag and drop the things like that's happening on the fly with a chatbot. Oh, yeah, definitely. So instead of, yeah, exactly. Instead of dragging and dropping and then expanding to look at Chang beer, what I do is directly having that done through the chatbot. The chatbot is basically doing my job. Yeah, exactly. So just a reminder. So I send the normal request, the sentence to the NLP service is going to tag and give me all the words I want. I build the queries on the fly from the sentence, send it to my server, and it's sending me the result, and I can display the pivot table. So coming back, so the same way as NIDA works with it, I can, for example, drill in. So I want to have more insight on the products from each categories here. And here, we have all the categories who expend it with all the products in it. And from there, I can do, like I can remove a measure. So now I only have revenue or margin. I can select a new product, maybe in beverages. No, maybe not everything. So Cheng with it, and maybe hyper-coffee. And here it is. So I can basically do the same thing that NIDA was doing and much more that he hasn't presented. I can do it directly from the chatbot. And the chatbot is also going to help me do this kind of thing. So for now, I can do a drill out for all. So it's like it's going to shrink all the categories to just show me up here, to show me the result. So let's say now I've finished the analysis on this pivot table. Good. Now I'm going to go back and help, because I don't know exactly what question I want to ask. And here, I can select from multiple measures. I have few different weights. So mainly, the differences are about the date, how I can ask for the date. So four days ago, in between, et cetera. So I'm going to try this one. So the margin on mozzarella, Italian cheese, for between two days. So here we have three dates here. And from here, you can see a master. So what I'm going to do right now is I'm going to do a simulation about the purchasing price of the mozzarella. And I'm going to say, OK, let's see what's happening on my margin. What are the impacts? If I'm changing the price on the fly of the purchasing price of the mozzarella. So up here, I can do create a new what-if. Do we call that a what-if? Or a branch, OK? So I'm going to say, mozzarella, good. And let's say, so I know the current price, because I know it's my data. I know the current price is $18.77. So I'm going to say, maybe the purchasing price, it's going to increase until $19. And let's check the impact on my margin. And here we are. Sorry about it. Just showing more. And here we have further margin and the purchasing up here. So we can see that the purchasing price has slightly increased and my margin has decreased for these days for mozzarella. I can also do another what-if. Just one remark related to this what-if. This is possible only because of the back end allows you to add extra data. Everything is held in the memory. You can add, you can remove the data the way you want. Here with this what-if, what we did is we defined the scenario where I can see side by side if tomorrow the purchase price increase or decrease of one of the product, what will be the impact immediately on my current data, and I can make a decision right now. So the chatbot is no more than a way to reach that functionality in a simple way. But the functionality is available thanks also to the back end. Thank you, Anita. So now I'm going to try another simulation maybe with a lower price of $16. Same way. You're going to see so we have now three different branch master sorry about it. Cannot show you up here. So you have two different branches. I can show you the name of it. So one for 19 price and one for 16. And you can definitely see the difference. So what I can do now, it's also delete the last created branch. The branch for us is like this simulation, this what-if simulation. And I can also delete one branch with the name. When I copy it, it's going to be easier up here. Bam, bam. And here we are back again. Good. So now I'm finishing the analysis on this pivot table. Obviously, I did the what-if directly from the pivot table. I can also do it directly asking a new price of something to the chatbot. So I'm going to say, hey, what-if the price of Cheng, again, the purchasing price of Cheng is half $3. And here the same thing. I'm going to have half the Cheng, the master branch, the new branch, the other simulation, and the impact on the purchases in margin. So I think you understand the discumcept very clearly. And finally, what I'm going to do is another kind of request that we can do through our chatbot. Let's try again some voice. Maybe it's going to work. Give me the top five product with highest margin. Yeah. Give me the top five product with highest margin. And here we are with a good chart showing the top five product, Cote de Blay, which is a wine, and everything, and the margin. So I can also ask something different, like give me all employee or salesperson contributing to 60% of my revenues, let's say, the past two days. Let's try that. Just to show you the difference. And here you can see all the employees, quite small because of the layout of the pages. So you can see for two different dates, actually you cannot here. So you can see for two different dates, the breakdown of employees contributing to 60% of my revenues. Now just a last question, just for the fun. Maybe an enhancement. So just for the fun to see that it exists, I can also go there and ask for, for example, this one. So give me the two best region in terms of revenue for each country. And bam, you'll have a good chart with the colors and everything. So this kind of chart are from our core, but the chatbot is just here to display it. So I'm done with the demo of the chatbot. And now I'm going to talk a little bit about the stack and what I used. So I used simply React Simple Chatbot, which is a React, open source React component made by Lucavacity. It's pretty straightforward as you can see on the GIF. It's something I can show you also later on on this web page. So basically it's the conversational flow is done through a step object, a GS object, which I show you on the right side, where you define the step you want to do, what you're going to do. So it can be a message. It can be a user input, or it can be a custom step, what I mainly used for my purpose. And then you explain what you're going to trigger the step afterward. You can customize the chatbot pretty easily for the icons, the colors, and everything. And as you can see, there is a speech recognition and speech synthesis that already embedded it. It's not perfect, but it works as you saw. So I also use natural language processing. So NLP is a branch of artificial intelligence that deals with the computers and the humans. And the goal is to read, understand, and make sense of the human language. So what I use is weed.ai, which is help you to extract relevant information. So you can categorize the user intent. You can tag words. You can use building entities, such as the date, the age of people, or whatever, a lot of building entities. You can define some roles. And you have different lookup strategy. I can also answer a few questions about that later on. In terms of integration, it's quite straightforward. So you have a Node.js integration, Python, Ruby, HTTP API, or even Facebook Messenger. So you can check on this link if you want to see. So what it's going to look like. So weed.ai web app looks like this. So as you can see, the scroll is all the entities tagged. And how it works, you launch a sentence. And you are going to basically tag all the words you want. And then if it's a keyword strategy, what I use, you can define all the keywords that are going to be in these entities. So it's quite nice. You have logs also. So it can help you to see what went wrong or not. What went good. So yeah, basically this. And what is a little bit of code for those who like it. Just the way we integrate this weed.ai connection, I use the HTTP API. So it's just a simple HTML HTTP request. And once I receive the full answer, I can actually process the entities object I received. So for me, it's like check and run MDX. So a bit of feedback on what I did for this project. So weed.ai, it's pretty simple. Easy to use, fast integration, fast training. I had a good result super fast. There are many built-ins entities supported by Duckling. So weed.ai is a Facebook company. So good support. The only downside are if you have specific use case, it's going to be quite long to tag everything from the web app. And there is less reliability on your own customer entities, which is quite of normal. For the React component, same thing, fast integration, good results, super fast customization, speech recognition. I already mentioned that. The only downside was it's really hard to keep a state between the steps, unless you have Redux or something above the component. And finally, who we are at TVM. We've been here for more than 13 years. We are more than 120 worldwide. We have Five Center, New York, London, Paris, Hong Kong, and Singapore. And if you have any question about a company, if you're facing any, I don't know, aggregation challenge use cases, feel free to contact us. Our office are in a moist street. So we are super close. So yeah, we'll be here. And thank you for your attention. And I'm here for your question. We are here for your question. Thanks. Thank you. So questions today, so who do you want to answer? Yeah. Or we were super clear, crystal clear, and you understood everything. Oh, no. Yeah, go ahead, Charles. So when you're actually getting all these keywords you tagged, are you also looking at some connectors, like the what if, or words between, to understand what the query is? So do I have to say a specific words with the names of the columns? No, no. So when you are training with .ai, you're going to send them like a message, a sentence, and you are only tagging the word you really need. You could actually say what is a question, a word, and I needed to have the intent. But first, when you start a question, so like top five products for revenues. So this here, revenues. So here, when I started to train the wheat.ai, I created the old sentence, and then I'm going to say, I'm going to create an intent. So the intent is what the user wants to achieve. So for me, it was a top count multiple whatever, like it can be whatever you want. It was a top question. It was really something I was using for the processing of the result. And then, I train because I use several sentences and say, you know what? After the top, there is a number. So I tagged in. I say that it's a wheat number. It's a wheat. If it starts with wheat, it's a built-in entity. So he found it really quickly. And then I say product is something that I use for, has a dimension. Revenues is something that I use as a measure. And because I'm going to do it several times, it's going to understand that the five after the top is something that I want. And then with Wittea, you can define some roles. So if you have, let's say, two, top five, top 10, you can actually give them a role. Or for example, if you want to have, like say, three bathrooms and two bedrooms, something like that, you want the two and three because you're going to do a processing on this. And you're going to explain and create some roles and say, this one with bathroom is going to be related to bathroom number, and this one with bedroom is going to be related to bedroom numbers. So you don't have to tag everything. It's with all the sentences that you're going to create what you want. Did I answer your question? And just so you know, in term of time, this was pretty straightforward. So overall, if I removed all the understanding of the product or on product and all the processing and the difficulties I could have faced, trying to integrate it to our products, I think you can use Wittea and React Simple Chatbot really quickly. And it can be between three to four weeks. You can have a good chatbot that works easily, super fast. So that's a good thing. You can also, in Wittea, so I use the web app. But what you can do also, if you have use cases, there is an API for the Wittea. So you can actually use an API and fit it with a file. Like, you define in a file like a CSV. You can define this word is going to be this kind of entity. So entity one. And this word is going to be entity two. And you're going to send it to the Wittea through the API. And it's going to be just done the same way. Just a different way to train the app there. Hello? Yeah. So instead of asking what products has the highest revenue, if I ask what item earns the most, is the chat box, is the library that you're using the Wittea simple React chat box, are they going to answer this kind of question? All the processing on the question, you want the chatbot to answer, you are going to build it. So if I didn't, I could. I mean, if I had this question, Wittea, because I trained it, might actually understand all the word I want. But if I didn't do any processing on my part, you're not going to see anything. But it's going to work. Like, if you train the app correctly, and if you do the processing of your entities, of your object, and of your answer, everything is going to work. OK. And also, in terms of the OL app, OL app, the three-dimensional stuff, how does it work? Like, there are time, there are products, and the other dimension was called that. But yeah, can you just talk more about the OL app? So you want me to talk more about OL app, right? Oh, yes. For instance, the demo we were playing with, if you can come back to the chat box, try to solve the slide, if you can drag the data explorer. And also, the local house, the first page you showed us, is that the database, how it looks like on this one? Is it really the? I don't know. Which one? Which one are you talking about? Let me ask you your first question first. So what you see here, OK, all this, if you can expand some of them, all those are called dimensions. In the example I was showing in the PowerPoint, just for human brain, if you show more than three dimensions, I don't even know how to write it down, because it's impossible. However, here, we are in a world with several dimensions. Every time you process a record from your data, that record should, I'm talking here about generic of OL app, every record should contribute to all what we call levels. So every record should have a product category, product name, date, salesperson, et cetera, et cetera. If you remember what you did in school, you have XYZ, three axes. If you have a point in that space, you need to contribute to every axis. This is how OL app works. You need to have a coordinate on every axis. Here, you're not even seeing the data we played with. Maybe you can do a drill through in the active. It's your fault, you're bringing me there, OK? The lady showed us, she added, what do you call them, right? What are your item? So when she add that item, how does the three dimensions were defined for that? There are more than three dimensions. So what I showed on the PowerPoint, that was just to introduce the concept. Here, we moved far from there. We have something that looks more the realities. When you add a what-if scenario, you do exactly the same thing. You need to bring the same type of data. I don't want to dive there. You take the original data, and you move a pointer only with the changing data. So we change only the price. We don't duplicate the data. We know that we changed only the price. So you still have the same universe of data. You still have the same attributes that contribute to each of axes. Sorry, it looks a bit strange. But usually, when I train people on OLAP, I spend four or five days to train the whole thing. So I have a short window to introduce that. But see it that way. And anything, if you want to understand the OLAP in a quick way, if I give you a table and I tell you, give me all the aggregates, give me the sum of an amount by product, what will you do? You will do a group buy. So OLAP does a group buy by everything. Every level you see here, every level, every axis, does a group buy. This is what the database is doing behind the scene. So it's not a relational database. It's a multidimensional database. Every group buy is already materialized. This is why, when you come and you query, you're super fast. And especially, if you are in memory, you are faster than others. Hope that makes sense. Yeah, any other question? And the first page. You mentioned local host there? Yes, this page. Because everything is running on the laptop there? That's it? What do you want me to show? I don't know. What's the question, actually? OK, if you come back to the slides, there is a front end, the presentation layer, which is, or maybe you show the Dev console, the Chrome Dev tools. Yeah, it's very mental as in production. The product is there for the past 10 years, most of big financial institutions are using it. So the product is there. The database is there for the past 10 years plus. The UI is there as well. Only this chatbot work is our prototype. This is experimental. But the product is, if you want to buy it, please say hi and let's discuss. If you have any issue related to aggregation, we'll be happy to sell you that. I'm not the salesman, but I will send you our MD. However, if you see here local host, because we're running everything locally, the back end, press the front end. So this is the only reason why you see a local host. We have time for one more good question. I imagine you would take this product to your customers. Would you sit down with them and train the NLP with them? Or would you teach them how to train the WIT AI themselves? Or would you listen to their queries and then you train WIT AI for them? With this product? I mean, what is your real purpose? Do you want to integrate a chatbot for you, for your own project? Or if I have the chatbot in our solutions? What is exactly your question? I'm just wondering how I work with new customers who want to make new questions for the bot. Would you arrange the training of WIT AI? Would you do it yourself, or would they do it? Would they talk to WIT AI? Since it's a prototype, right now we can do anything. But I think the easiest part would be for us to, we have a kind of a system to know what the user wants. Ticket system. So with this, they could say, hey, you know what? They're missing some question. I have this question I would like to ask to the chatbot. And we can take care of it. But since, as I mentioned, you can train WIT AI remotely by submitting, maybe you have like a big CSV file. So then potentially you might build kind of interface so that they can drop the new questions and then send it to the backend to keep training. Or you train on daily basis. Or maybe you have all the errors. You get your logs and you see what's wrong and you keep training till you reach a decent level. Yeah, you can get the logs and say, these people ask this kind of question and that hasn't been answered yet. So we can use it to build a new question, train the model. But actually, it's not actually the most difficult part. It's not training the WIT AI. It's more the processing of creating the MDX for more side using our library, creating the MDX from the sentence. Because actually, from WIT AI, I'm just receiving some words. I'm receiving a design object I can show you here. So for this one, I don't know if you see here, this object is what I receive from WIT AI. And I'm going to receive just a normal object with dimension. There are two object in it. So this one is a region. This one is a country. I also receive a measure. But you see, I just receive words. So even with this, I need to extract these words and create my whole MDX, which is going to look like this at the end. Quite not funny to see like this. Oh, maybe I can. Yeah, here. So yeah, so at the end, from this object, where I received only words, I'm going to create this whole thing. Thank you. OK, is it a quick one? Because I don't want to take too much time for the next one. Hello. You mentioned that the server runs on Java. And what's the role of the Java here? It looks like it can push everything to the data. So the database itself is running in Java. I didn't hear the question. I don't know if you're OK. So yeah, the server is running and written in Java and is doing all the heavy lifting for you. The UI remains only the presentation layer. Even in this case, the case of the chatbot, the UI is the one talking to VTI, getting the words, and then doing some logic to bridge the sentence you're writing, the result coming from VTI, with MDX. However, the heavy lifting is coming from the server side. I didn't want to spend too much time talking about that. But the server side runs in memory. We run on servers of like 4 terabytes of RAM. This is something that you can easily get even on AWS or equivalent. So you can have a huge server that is leveraging all your cores to provide the query as fast as possible. We are, we try to remain being in memory. We try to remain in the world of second seconds. So you send your query, you receive the result. There is no heavy lifting done on the UI. So yeah, the Java side is doing most of the job and is interpreting the MDX, getting the dices, answering you. So this is what we literally do. So every query goes to the server. Here's the server comes back. Of course, in this use case, the server is why you see the local host. The server is running locally. The UI is deployed locally. But the VTI is deployed somewhere, I don't know where. Yeah, in the cloud. So this is how this prototype is made, if you're wondering where things are. But things that could have been done differently. Like I could just get the sentence, send it to the server, and then the server could have asked for VTI and do some more check than what I'm doing. And then, I mean, it's just a choice. And it was easier to do it on the front end part. And the goal, again, the goal of this prototype is we wanted to see how complex is to do a chatbot. We're not coming from that world. We're more from the analytics world, kind of, let's say, big data slash BI. We wanted to see how can we do our own. Because like chatbot and AI and all that stuff is part of the high port. You listen a lot, but we wanted to do something ourselves to see how can we make it work end to end. And by what Lisa showed, you can do the same with SQL database if you want. You can bridge. You can take VTI, you have the component, and then you can do the same thing by translating everything in SQL if you want to. Thank you very much for the talk today. Thank you. Thank you.