one of the biggest limitations with most AI chatbots is that you can't talk directly with data and get accurate answers back a really powerful use case for chatbots has been building internal systems for businesses to communicate with policies and internal documents however not being able to communicate directly with data has been quite a limiting factor some examples of these internal documents could include annual Financial reports sales data store inventry customer data Etc we can even use this to provide e-commerce product recommendations as well for a customer facing chatbot in this video I'm going to show you how to chat directly with a CSV file and not only get information from a file but automatically analyze that data accurately and get detailed insights back for example we could ask for the total amount of sales for that month we could ask how many units were sold the previous month compared to the current month we could ask how many users had signed up to our newsletter and then see the percentage change from the previous 5 years as well there are a lot of possibilities depending on the data set that the business has access to I'm also going to show you how you can actually generate a data set that's fake using chat GPT so to to do this I'm going to be using a tool called Vector shift and I'm going to connect it to voice flow so Vector shift is an AI automations tool that enables you to build Advanced knowledge based systems that I'm going to go ahead and connect to voice flow which is an advanced AI chatbot Builder platform so this right here is Vector shift so Vector shift is a noode AI automations platform and if you've used stack AI or flow wise or you've seen them before essentially these are just more Advanced knowledge-based Builders so if you are familiar with voice flow voice flow is a chatbot Builder where pretty much the knowledge base within voice flow is simply uploading some files and talking with those files but then people have been using flow wise and stack AI to get a lot more depth into how we actually retrieve information from those files so just by scrolling down a little bit on the website you can see here that they've got an input where you have a file a file loader a vector database loader so if you know anything about the knowledge based stuff this is a platform that will give us the depth in regards to how we retrieve information from the knowledge base once again this is a no code tool so it is quite easy to get an understanding of how it works and you can get set up quite easily scrolling down a bit more we do have a lot of integration and automations built into Vector shift as well so comparing this to something like voice flow they don't have any sort of live Integrations for Google Drve air table notion essentially the data is going to be sent directly from your account directly into Vector shift to be queried and then retrieving data from these platforms so jumping into Vector shift here I've already got a couple of automations set up that I'm going to show you how these work and then I'm going to go ahead and connect these to a voice flow project so if you aren't familiar with how voice flow Works voice flow is a chatbot Builder platform and pretty much the voice flow knowledge based that's built out at the moment is essentially just uploading some files adding some data sources maybe from a website or a PDF file and then quering that using Ai and then just asking some basic questions but what Vector shift allows us to do is to build a much more advanced knowledge base that we're actually going to be able to now talk to a CSV file of data so typically if you went ahead and uploaded a CSV file or a text file with some data and then you wanted that uploaded to the voice flow knowledge base and you asked their question to get some information related to that data the answers would not be as accurate as you'd want them to be and the way that that knowledge base works on voice flow is not going to be as advanced and as purpose-built compared to something like vector shift so this right here is a setup that I have on Vector shift allows us to send a question to essentially a CSV file and then it's going to query that CSV file and find the most relevant answers from the data within that file it's then going to send that data back out and we're then going to retrieve that information so what I went ahead and did is created a fake sales data sheet which you can see here and I actually Ed chat GPT to generate all of this data so if you actually have access to chat GPT 4 you can actually go ahead and ask chat to generate a fake CSV file of data so if I just said generate some fake sales data and put this in a CSV file what's actually happening here is that chat gbt is generating some code uh using python code it's then going to run this code to generate that random file it's then going to send us this file for us to download and then we can take this and put it into Vector shift just for testing but obviously if you are a business and you've already got a set of data you want to use you can just go ahead and use that data instead so just go ahead and download your fake sales data and then I'll show you how to put that in Vector shift in a minute so this is my sales dat essentially it's just got a date when products were purchased it's got a fake generated product name quantity sold for that item and then a sales amount as well sorry just to test if this actually works I'm going to click on start and we're going to see if we can actually query that data so I'm just going to say what was the total sales data in 2023 compared to 2024 so we should get is the sales data for 2023 and the sales data of 2024 and it's going to give us a little bit of comparison between the two years so here is the response that it outputed the total sales out off of 2023 is 7. 3 million compared to 2. 4 million in 2024 so if I now go back to Google Sheets and test if those was actually accurate I go ahead and just sort this I've gone ahead and just sorted this and if I just go drag down all the way to the end of 2023 and I've just hit the sum button and it says there 7379 go back to Vector voice flow we can see 7379 so that was accurate and I can go ahead and just get the 2024 data as well and see if that was accurate you can see there 2.
44 go back to voice flow 2. 44 so was able to accurately analyze the data from not only looking at the total sales data but then getting the right data so knowing that it's 2023 and knowing that this is 2024 was able to pick up on both of those things and then send us the accurate answer back into voice flow if you are a business owner and you're looking to integrate AI into your business you can go ahead and book a call with my agency using the calendar Link in the description we've helped several businesses integrate the solutions that you've seen on this channel and we can go ahead and build the exact same for you so to build this go ahead and sign up for Vector shift and create a new Pipeline and essentially you're going to land on a canvas like platform like this and so to build this we only need four blocks one is an input block where we're accepting the information from the user so just type in question and it's a type text then from here we're connecting this to a CSV query loader so just go to data loaders go ahead and drag in the CSV one so you can drag and drop and just drag that in here and then what you want to do is just type bracket question bracket and that's just because we want to get the input as the question that we're actually sending to the CSV file then what we want to do is add in this file loader so on the same part here just click on file drag it in and then all we need to do is click on the upload file button that they've given us and then simply click on upload file and then you can go ahead and upload a fake data set or a real data set of CSV data it doesn't matter it's going to figure out how to actually communicate with and retrieve the specific data all by itself so you don't need to do any further configuration once you've got these three blocks set up we're just going to Output that information the field name output one type text just like that all these can be dragged so you want to drag from this block to the next block and make sure it's set up in this configuration once you've got that going it is now done so just go to the top right up here and click deploy changes and then click on the button to the right and just click on chatbot once you're on this page just give it a random name so we might want to say sales bot then just click the big purple save button then over to the left click on export and then we're just going to go and click on the API button once you're on this API screen here this is the request that we're going to be making on voice flow which is this block here and we're just going to be talking with Vector shift and pulling back that data so the first block we need to drag in is just a text block at the top here and this is just what we going to be asking the user so what would you like to find and then we want to capture the response from the user so just go to the C Capt block and drag that under and then we need to make the API call to Vector shift so just drag in this API block from this Dev section and drag and drop right next to it then we're going to use this little dot here to drag from the capture directly to the API block so we're capturing their response and then sending that data over to our Now API block go ahead and click on the API request we're just going to be changing this from a get request to a post request because we're going to be sending our question we're going to be posting it off the vector shift and we're going to be getting some data back once that is set up go back to Vector shift and just copy this big URL here and then go ahead and just paste that right here in the request URL box and then we need to create one header so it says header here so just copy API key go back here and click on Plus on the headers and just paste that there we'll go ahead and get the API key in just a minute in this body section just grab each of these values so grabbing input going back to Vector shift and going to the body and just pasting in input now input is going to be our question that we're sending to Vector shift so we're going to go ahead and click on the curly bracket and type in last utterance the reason we're using L utterance is because this is the variable that our answer was saved into in the previous capture block and now that is being sent to Vector shift to get our answer back just below input go over chatbot name copy that and add that as a new body I named this one sales bot so just copy your name that you named it go ahead and grab your username as well so this will be the vector shift username that you signed up with and then for conversation ID we don't have to worry about that one just for now to go ahead and get our API key just click out of this API section where it's going to go back out of our pipeline go and click on your profile picture in the top right and then just click on settings once you're in settings you're going to be in the API key section and all you need to do is hit generate key it's just going to tell you to give it a name it's going to generate a new key and all you need to do is copy that key when it's generated go back to voice flow and just paste that key right beneath the API key section now lastly just make sure that your rooll encoded is the section out here that's selected and then we can go ahead and click Send request I've got a question here what is the total sales amount so this is really just testing if the system actually works and I'll just hit generate so we can see here it has gone ahead and worked we've got a response back that says the total sales amount is 9. 8 million so now that we know that it works just go down to the capture response block click on this and type response.
output and then we're just going to create a new variable to save that response to and I've already created a variable called output what we need to do is type in the name that you want here so I've created output to all you need to do is hit the plus button and then generate that but I'm just going to use output cuz I've already created it once that's all set up all I'm doing is using another text block and then we're going to be displaying the answer in so dragging both of these over to the new text block clicking on the curly bracket and typing in output we can now output the response from the API request now onto our voice flow chat block so super simple to go ahead and get that working I'm now going to demo an e-commerce product recommendation system uh using the exact same Vector shift pipeline so all I'm going to do is take this star block and we're just doing the exact same thing where I've connected the same Vector shift Pipeline and I've just swapped out the data set for a fake product data set so you can see here I've got uh the name of a prodct product the price I've got the rating of the product and what I might go ahead and do is ask this data set give me the products that are rated above 4 1/2 so what's happening is that it is looking at this rating column and it's saying if it is above 4 1/2 which would be the 4. 8 4. 6 4.
9 we want to get these three products only and then send that back to voice flow so I've just asked that what do you have that is red above 4 1/2 and we should get back those three products that is highlighted in the that sheet as to be higher than 4 1/2 so there we have it we've got the three products evening gown leather jacket and silk blouse 4. 9 4. 8 and 4.
6 and so that is pretty accurate 4. 8 4. 6 and 4.