WEBVTT

00:00.080 --> 00:03.640
Okay, it's time to connect Nate N to Super Bass.

00:03.640 --> 00:05.400
The big integration for today.

00:05.800 --> 00:10.680
And first up here we are in Super Bass looking at our database table.

00:10.720 --> 00:12.680
Here it is knowledge base on the left.

00:12.680 --> 00:19.320
Here you'll see the database side nav which has a settings field here settings Nav.

00:19.560 --> 00:21.960
That's not the one to use right now.

00:22.080 --> 00:26.200
Go further to the left to the main uh setup here.

00:26.280 --> 00:27.640
Be sure that you are looking.

00:27.760 --> 00:31.800
Go back to Project Overview and then see this list you've got here.

00:31.840 --> 00:34.040
Go to Project Settings.

00:34.040 --> 00:38.680
So it's easy to confuse the settings that you see somewhere with project settings.

00:38.880 --> 00:41.200
And project settings is the one you want to be at right now.

00:41.360 --> 00:48.080
Here you are on Project Settings okay and now and Project Settings on the left.

00:48.120 --> 00:50.280
Go to data API.

00:50.720 --> 00:52.760
Are you with me data API?

00:52.800 --> 00:55.880
And the first thing you'll see here is there is a URL.

00:56.080 --> 00:59.120
And this URL is the URL for this database.

00:59.240 --> 01:03.810
And you need to copy that and put it somewhere safe, because we're going to need it in a second.

01:03.850 --> 01:07.970
Be sure not to put it into a kind of notepad that will rewrite the characters.

01:08.010 --> 01:10.890
I know you're a pro at this now, but I just just have to say it.

01:10.890 --> 01:11.530
Be careful.

01:11.530 --> 01:13.890
This is the URL that we're going to want to use.

01:13.930 --> 01:15.250
It's a pretty crazy URL there.

01:15.410 --> 01:15.850
Okay.

01:15.890 --> 01:16.850
And there's something else.

01:16.850 --> 01:19.170
There's another one here API keys.

01:19.490 --> 01:23.770
Now Super Bass has a new approach for using API keys.

01:23.770 --> 01:25.490
Relatively new in the last few months.

01:25.690 --> 01:30.690
And it's this this setup right here where the publishable and secret API key combo.

01:30.930 --> 01:34.290
But but Nan doesn't use them yet.

01:34.330 --> 01:38.290
Nan uses the legacy keys, which are still actually super popular.

01:38.450 --> 01:41.770
Uh, so a lot of people do this, but you need to flip.

01:41.770 --> 01:50.130
So on the API keys sidebar tab, you then need to come here and switch over to the legacy, uh, keys.

01:50.450 --> 01:53.930
And it's this one here, this one with this orange secret next to it.

01:53.930 --> 01:56.370
This is the key API key.

01:56.410 --> 01:57.170
The key API key.

01:57.210 --> 02:03.810
The main API key that you need to know about, and you can press reveal and copy it, and that also

02:04.050 --> 02:05.490
put it to hand.

02:05.530 --> 02:10.770
Keep it very safe because we're now going to switch over to and and put it in.

02:10.770 --> 02:14.410
And of course what you can also do is keep this tab open and switch between them and copy and paste

02:14.410 --> 02:14.570
it in.

02:14.610 --> 02:18.410
That might be a safer way of doing it, trying not to paste keys into it somewhere else.

02:18.410 --> 02:18.850
Ever.

02:19.290 --> 02:20.570
All right, let's go do it.

02:20.610 --> 02:23.450
Okay, here we are back in.

02:23.490 --> 02:24.010
Nan.

02:24.050 --> 02:26.090
I'm pressing the plus button right here.

02:26.090 --> 02:32.730
And the node that we're going to add in here is called the Super base store.

02:32.770 --> 02:33.770
Not just a super base.

02:33.770 --> 02:35.410
That's just for a normal database.

02:35.410 --> 02:38.050
This is because we're using a vector store.

02:38.250 --> 02:41.930
And these are the different actions the node operations we could use here.

02:41.930 --> 02:45.850
And we are going to want add documents to vector store.

02:46.010 --> 02:46.810
There it is.

02:47.090 --> 02:47.650
Okay.

02:47.770 --> 02:50.570
First up time to connect with credentials.

02:50.570 --> 02:51.650
Our favorite thing to do.

02:51.690 --> 02:52.810
All right here we go.

02:52.850 --> 02:55.850
Create new credential host.

02:55.890 --> 03:02.260
This is where we put that URL, that first thing, this thing that we saw, that is what belongs right

03:02.260 --> 03:02.700
there.

03:02.820 --> 03:06.580
The URL to our Supabase database table.

03:06.900 --> 03:10.580
And now you can see the service role secret.

03:10.620 --> 03:13.180
Well this of course is the other thing.

03:13.220 --> 03:16.740
That long thing that you had to press reveal and then copy to put in your clip chart.

03:16.780 --> 03:20.820
And if you've got it over on the other tab, you can go and copy it right now and come in here and paste

03:20.820 --> 03:22.260
it in exactly as is.

03:22.500 --> 03:23.660
And let's give that a whirl.

03:23.660 --> 03:25.260
And I just did exactly the best practice.

03:25.260 --> 03:30.260
I flipped the other tab and copied it so that I know I'm pasting in exactly what was there.

03:30.420 --> 03:31.580
And now I press save.

03:31.620 --> 03:32.660
Drumroll, please.

03:32.700 --> 03:34.300
Green, green.

03:34.300 --> 03:35.780
And you got green too, right?

03:35.820 --> 03:36.860
I hope you got green.

03:36.940 --> 03:40.820
Uh, it can be frustrating when you don't get green and you just have to go back.

03:40.860 --> 03:41.620
Do it again.

03:41.660 --> 03:42.620
Be careful.

03:42.740 --> 03:47.140
Be the pro at these API keys that I know you are.

03:47.420 --> 03:54.860
And there we have a nice ready super base vector store ready for our data ingest pipes.

03:55.140 --> 03:55.660
Okay.

03:55.700 --> 03:58.620
And it needs two things attached to it.

03:58.660 --> 04:03.100
Two bits have to go in here and here so that it can do its job.

04:03.300 --> 04:03.740
What are they?

04:03.780 --> 04:05.220
Well, one of them is probably one.

04:05.220 --> 04:07.700
You're very much expecting the embedding model.

04:07.700 --> 04:12.300
I told you the thing that the smart part, the clever part is not related to super bass.

04:12.340 --> 04:14.460
It's going to be something that will do.

04:14.500 --> 04:17.460
It's going to be the embedding model that we're going to add in here.

04:17.460 --> 04:20.780
That's going to tell it how to turn text into vectors.

04:20.900 --> 04:24.580
And I want to use OpenAI embeddings, embeddings, OpenAI.

04:24.820 --> 04:26.980
But you can see there's a bunch of them.

04:26.980 --> 04:28.940
You can choose to use any of these.

04:29.060 --> 04:30.500
Um, some of them are free.

04:30.660 --> 04:34.580
Uh, and some of them are, uh, I don't know if Gemini is free.

04:34.740 --> 04:36.140
A lot of Gemini products are free.

04:36.180 --> 04:39.020
If you if you don't use them, if you use them within limits.

04:39.100 --> 04:41.340
Um, and so you could do some research if you want to be free.

04:41.340 --> 04:47.220
But if you do decide to go along with me and use embeddings, OpenAI, which is so common, so popular,

04:47.260 --> 04:49.660
then be assured it is very cheap.

04:49.780 --> 04:53.060
Uh, but of course there is a $5 up front that OpenAI needs.

04:53.220 --> 04:57.190
Um, so this is the model we're going to use text embedding three small.

04:57.190 --> 05:02.670
And that has precisely the number of dimensions one five, three, six that we put into, uh, into

05:02.670 --> 05:06.110
the super base, uh, into that SQL script that we ran.

05:06.150 --> 05:11.230
And if you choose a different model, you simply have to go back, update that SQL and run it again

05:11.230 --> 05:16.710
with the right number of dimensions, so that the dimensions of the vector that's created here match

05:16.710 --> 05:19.390
the dimensions that Postgres is expecting.

05:19.390 --> 05:24.150
And I should mention that there are different embedding models provided by OpenAI text embedding through

05:24.150 --> 05:25.910
small as often everyone's default choice.

05:25.910 --> 05:28.430
As I say about 1500 dimensions.

05:28.470 --> 05:33.950
Text embedding three large has 3000 or so dimensions and is a more powerful one at a slightly higher

05:33.950 --> 05:34.670
price point.

05:34.830 --> 05:38.510
Uh, this one is a is a is an older legacy model.

05:38.510 --> 05:39.830
So small is what we pick.

05:40.030 --> 05:43.590
And now it is time for us to go back here.

05:43.950 --> 05:48.270
And we now need to do this, this other, this other bit here.

05:48.390 --> 05:49.750
And what is this about.

05:49.790 --> 05:53.670
Well, this is something that is called the document loader.

05:53.710 --> 05:59.470
This is the thing that does the chunking, the breaking things up and it tells it it's NHS and it's

05:59.510 --> 06:03.710
our way of telling Nan, how are you going to provide this data to Supabase.

06:03.710 --> 06:07.990
And so this we're going to pick the only one that comes with with the default data loader.

06:07.990 --> 06:13.230
And this is where we will describe how we want to load our data into Supabase.

06:13.270 --> 06:17.030
Now in fact you could leave it with the defaults as it is right here.

06:17.190 --> 06:18.190
And it will work.

06:18.190 --> 06:20.430
It will be fine, but it wouldn't be the best way to do it.

06:20.430 --> 06:24.070
And I want to to show you the proper way of doing this fully.

06:24.590 --> 06:30.710
So the default mode is load all input data means take all of this and figure out how to shove it in

06:30.710 --> 06:31.470
supabase.

06:31.470 --> 06:33.310
But we can be a bit smarter about that.

06:33.350 --> 06:35.870
We can say load specific data.

06:36.030 --> 06:38.990
And so we're going to tell it what data from.

06:38.990 --> 06:43.470
Here is the stuff that we care about for going in our knowledge base.

06:43.470 --> 06:46.190
And the answer is we care about this thing here content.

06:46.350 --> 06:48.070
So we can put an expression here.

06:48.310 --> 06:49.510
And we know this so well.

06:49.510 --> 06:53.720
Now, you know, you could drag and drop, but we prefer Being pros.

06:54.520 --> 06:55.320
There it is.

06:55.360 --> 06:55.880
Jason.

06:56.720 --> 06:57.960
And this here.

06:57.960 --> 07:01.760
That's the data that we actually want to put in the knowledge base.

07:01.800 --> 07:03.400
Otherwise, it puts all the rest of this stuff too.

07:03.440 --> 07:04.600
Which is which is a waste.

07:04.840 --> 07:05.440
Okay.

07:05.800 --> 07:11.240
And then we also need to tell it, uh, how to split the text.

07:11.240 --> 07:17.360
And we can just leave it at simple, which is the default out of the box behavior, which says every

07:17.400 --> 07:22.440
thousand characters try and split around there and have some overlap between your chunks.

07:22.560 --> 07:27.800
Now, as it happens, none of our of our data is more than 1000 characters.

07:27.800 --> 07:32.640
So this is basically going to mean we're going to have one chunk per row in our sheet, which is great.

07:32.680 --> 07:33.760
That's all we want.

07:33.920 --> 07:39.920
Uh, but uh, if you had big documents, this would naturally break things up into very sensible sized

07:39.920 --> 07:40.440
chunks.

07:40.480 --> 07:44.200
This is a good default to use, and it tends to work very well.

07:44.240 --> 07:44.960
All right.

07:45.120 --> 07:47.600
And now we're going to go to this options thing.

07:47.600 --> 07:49.240
We're going to add an option.

07:49.240 --> 07:50.640
There only is one option you can add.

07:50.640 --> 07:52.040
And that is metadata.

07:52.280 --> 07:59.000
And metadata is where we can say there's specific stuff here that we think it would be nice to tag each

07:59.000 --> 08:04.360
of the things in the knowledge base with, because maybe it would come in useful to tell the agent about

08:04.360 --> 08:05.840
it whenever we surface things.

08:06.080 --> 08:12.360
And obviously I've left in something there left category in there as a useful thing to add to our metadata.

08:12.360 --> 08:14.240
So we can press Add property.

08:14.240 --> 08:18.160
The name of it will be category the value.

08:18.280 --> 08:20.000
Well this we want to be an expression.

08:20.000 --> 08:24.520
We want to say, hey we'd like you to take the thing called category in the input.

08:24.520 --> 08:27.880
And you know this so well that you're saying, why is he overexplaining to me?

08:28.040 --> 08:32.280
Uh, it's of course, dollar Jason category.

08:32.640 --> 08:35.440
That's the only thing it even prompts us right there.

08:35.520 --> 08:36.360
It knows what we're doing.

08:36.360 --> 08:36.760
There it is.

08:36.760 --> 08:41.840
So the word keyboard in this example would be then added to the metadata.

08:41.840 --> 08:44.040
And of course you could do more.

08:44.040 --> 08:44.800
You could extend this.

08:44.800 --> 08:46.360
You could have more things coming in.

08:46.640 --> 08:48.520
This seems great for now.

08:48.760 --> 08:51.320
Uh, this this is exactly what we want.
