Okay, it's time to connect Nate N to Super Bass.
The big integration for today.
And first up here we are in Super Bass looking at our database table.
Here it is knowledge base on the left.
Here you'll see the database side nav which has a settings field here settings Nav.
That's not the one to use right now.
Go further to the left to the main uh setup here.
Be sure that you are looking.
Go back to Project Overview and then see this list you've got here.
Go to Project Settings.
So it's easy to confuse the settings that you see somewhere with project settings.
And project settings is the one you want to be at right now.
Here you are on Project Settings okay and now and Project Settings on the left.
Go to data API.
Are you with me data API?
And the first thing you'll see here is there is a URL.
And this URL is the URL for this database.
And you need to copy that and put it somewhere safe, because we're going to need it in a second.
Be sure not to put it into a kind of notepad that will rewrite the characters.
I know you're a pro at this now, but I just just have to say it.
Be careful.
This is the URL that we're going to want to use.
It's a pretty crazy URL there.
Okay.
And there's something else.
There's another one here API keys.
Now Super Bass has a new approach for using API keys.
Relatively new in the last few months.
And it's this this setup right here where the publishable and secret API key combo.
But but Nan doesn't use them yet.
Nan uses the legacy keys, which are still actually super popular.
Uh, so a lot of people do this, but you need to flip.
So on the API keys sidebar tab, you then need to come here and switch over to the legacy, uh, keys.
And it's this one here, this one with this orange secret next to it.
This is the key API key.
The key API key.
The main API key that you need to know about, and you can press reveal and copy it, and that also
put it to hand.
Keep it very safe because we're now going to switch over to and and put it in.
And of course what you can also do is keep this tab open and switch between them and copy and paste
it in.
That might be a safer way of doing it, trying not to paste keys into it somewhere else.
Ever.
All right, let's go do it.
Okay, here we are back in.
Nan.
I'm pressing the plus button right here.
And the node that we're going to add in here is called the Super base store.
Not just a super base.
That's just for a normal database.
This is because we're using a vector store.
And these are the different actions the node operations we could use here.
And we are going to want add documents to vector store.
There it is.
Okay.
First up time to connect with credentials.
Our favorite thing to do.
All right here we go.
Create new credential host.
This is where we put that URL, that first thing, this thing that we saw, that is what belongs right
there.
The URL to our Supabase database table.
And now you can see the service role secret.
Well this of course is the other thing.
That long thing that you had to press reveal and then copy to put in your clip chart.
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
it in exactly as is.
And let's give that a whirl.
And I just did exactly the best practice.
I flipped the other tab and copied it so that I know I'm pasting in exactly what was there.
And now I press save.
Drumroll, please.
Green, green.
And you got green too, right?
I hope you got green.
Uh, it can be frustrating when you don't get green and you just have to go back.
Do it again.
Be careful.
Be the pro at these API keys that I know you are.
And there we have a nice ready super base vector store ready for our data ingest pipes.
Okay.
And it needs two things attached to it.
Two bits have to go in here and here so that it can do its job.
What are they?
Well, one of them is probably one.
You're very much expecting the embedding model.
I told you the thing that the smart part, the clever part is not related to super bass.
It's going to be something that will do.
It's going to be the embedding model that we're going to add in here.
That's going to tell it how to turn text into vectors.
And I want to use OpenAI embeddings, embeddings, OpenAI.
But you can see there's a bunch of them.
You can choose to use any of these.
Um, some of them are free.
Uh, and some of them are, uh, I don't know if Gemini is free.
A lot of Gemini products are free.
If you if you don't use them, if you use them within limits.
Um, and so you could do some research if you want to be free.
But if you do decide to go along with me and use embeddings, OpenAI, which is so common, so popular,
then be assured it is very cheap.
Uh, but of course there is a $5 up front that OpenAI needs.
Um, so this is the model we're going to use text embedding three small.
And that has precisely the number of dimensions one five, three, six that we put into, uh, into
the super base, uh, into that SQL script that we ran.
And if you choose a different model, you simply have to go back, update that SQL and run it again
with the right number of dimensions, so that the dimensions of the vector that's created here match
the dimensions that Postgres is expecting.
And I should mention that there are different embedding models provided by OpenAI text embedding through
small as often everyone's default choice.
As I say about 1500 dimensions.
Text embedding three large has 3000 or so dimensions and is a more powerful one at a slightly higher
price point.
Uh, this one is a is a is an older legacy model.
So small is what we pick.
And now it is time for us to go back here.
And we now need to do this, this other, this other bit here.
And what is this about.
Well, this is something that is called the document loader.
This is the thing that does the chunking, the breaking things up and it tells it it's NHS and it's
our way of telling Nan, how are you going to provide this data to Supabase.
And so this we're going to pick the only one that comes with with the default data loader.
And this is where we will describe how we want to load our data into Supabase.
Now in fact you could leave it with the defaults as it is right here.
And it will work.
It will be fine, but it wouldn't be the best way to do it.
And I want to to show you the proper way of doing this fully.
So the default mode is load all input data means take all of this and figure out how to shove it in
supabase.
But we can be a bit smarter about that.
We can say load specific data.
And so we're going to tell it what data from.
Here is the stuff that we care about for going in our knowledge base.
And the answer is we care about this thing here content.
So we can put an expression here.
And we know this so well.
Now, you know, you could drag and drop, but we prefer Being pros.
There it is.
Jason.
And this here.
That's the data that we actually want to put in the knowledge base.
Otherwise, it puts all the rest of this stuff too.
Which is which is a waste.
Okay.
And then we also need to tell it, uh, how to split the text.
And we can just leave it at simple, which is the default out of the box behavior, which says every
thousand characters try and split around there and have some overlap between your chunks.
Now, as it happens, none of our of our data is more than 1000 characters.
So this is basically going to mean we're going to have one chunk per row in our sheet, which is great.
That's all we want.
Uh, but uh, if you had big documents, this would naturally break things up into very sensible sized
chunks.
This is a good default to use, and it tends to work very well.
All right.
And now we're going to go to this options thing.
We're going to add an option.
There only is one option you can add.
And that is metadata.
And metadata is where we can say there's specific stuff here that we think it would be nice to tag each
of the things in the knowledge base with, because maybe it would come in useful to tell the agent about
it whenever we surface things.
And obviously I've left in something there left category in there as a useful thing to add to our metadata.
So we can press Add property.
The name of it will be category the value.
Well this we want to be an expression.
We want to say, hey we'd like you to take the thing called category in the input.
And you know this so well that you're saying, why is he overexplaining to me?
Uh, it's of course, dollar Jason category.
That's the only thing it even prompts us right there.
It knows what we're doing.
There it is.
So the word keyboard in this example would be then added to the metadata.
And of course you could do more.
You could extend this.
You could have more things coming in.
This seems great for now.
Uh, this this is exactly what we want.