WEBVTT

00:00.200 --> 00:01.880
And now for my next trick.

00:01.920 --> 00:03.200
And our last trick for today.

00:03.400 --> 00:07.120
I'm going to switch it to store it in SQL instead.

00:07.160 --> 00:09.960
Our memory is going to be in a SQL database.

00:10.120 --> 00:11.920
And again this is impressive stuff.

00:11.920 --> 00:17.000
It's great that it's so simple and easy to switch to using SQL.

00:17.440 --> 00:22.400
We just import uh, this SQL Lite saver instead.

00:22.640 --> 00:26.000
And uh we're going to write to a memory DB.

00:26.040 --> 00:27.760
We connect that way.

00:28.440 --> 00:32.200
Uh, we come in and it's just exactly the same code.

00:32.200 --> 00:36.000
But we're of course putting in the SQL memory instead of the memory before.

00:36.040 --> 00:41.120
I mean, it's just different name of a variable, but it's the exactly the same approach, uh, as we

00:41.120 --> 00:41.880
had before.

00:42.040 --> 00:43.520
Nothing different there at all.

00:44.960 --> 00:45.640
There we go.

00:45.840 --> 00:51.000
I'm going to make the thread ID a different ID because since it's SQL, it's kind of remember from my,

00:51.040 --> 00:52.160
my, my tests.

00:52.440 --> 00:57.960
Uh, but uh, then we can come in and we can say hi there and see.

00:58.000 --> 00:59.280
How can I assist you today?

00:59.400 --> 01:00.750
Uh, what's my name?

01:04.070 --> 01:05.630
And I don't have access.

01:06.390 --> 01:08.190
Uh, my name is Ed.

01:10.990 --> 01:11.950
Nice to meet you, Ed.

01:11.990 --> 01:13.150
How can I assist you today?

01:13.630 --> 01:22.590
All right, so with that, uh, we can now go back here, and this time, we can just recreate the whole

01:22.590 --> 01:23.870
thing from scratch.

01:23.910 --> 01:24.590
It's like I could.

01:24.590 --> 01:26.470
I could restart my kernel.

01:26.510 --> 01:28.070
I should restart my kernel.

01:28.070 --> 01:28.990
Why don't I do that?

01:28.990 --> 01:29.910
You'll have to bear with me.

01:29.950 --> 01:31.110
We will clear.

01:31.110 --> 01:33.790
We will restart kernel, clear all outputs.

01:33.790 --> 01:36.510
We'll go all the way back up to the top, run our imports.

01:38.510 --> 01:40.870
We will load the dot env.

01:41.230 --> 01:41.750
Just check.

01:41.790 --> 01:47.630
I guess I should load in the tools again because we're going to use these do this, do this.

01:48.910 --> 01:52.790
Get the pushover message me.

01:53.230 --> 01:54.350
My phone's on silent.

01:55.230 --> 01:56.430
Bring them together.

01:56.910 --> 01:59.980
Get our state object because we reuse that at various points.

01:59.980 --> 02:05.100
And now from this point onwards, I think now we can now go back here.

02:05.100 --> 02:06.980
So we're completely fresh.

02:07.420 --> 02:11.220
Uh, so now we're going to recreate this.

02:11.700 --> 02:14.020
We are going to rebuild our graph builder.

02:14.020 --> 02:14.940
There it is.

02:15.220 --> 02:16.820
And here we go.

02:17.060 --> 02:18.220
And hi there.

02:20.020 --> 02:21.100
Hello again editor.

02:21.140 --> 02:23.180
Ha there you have it.

02:23.180 --> 02:24.460
Restart the kernel.

02:24.700 --> 02:27.100
Uh, completely bring everything fresh.

02:27.300 --> 02:29.820
And of course, it knows who I am.

02:29.860 --> 02:35.900
And it knows that because you can see right here in this directory, there's a bunch of database objects.

02:35.900 --> 02:39.700
It's storing it in a SQLite database.

02:39.700 --> 02:46.220
And so we have persistent memory with changing like one word uh from, from my code.

02:46.220 --> 02:48.460
And I think that is really impressive.

02:48.500 --> 02:54.980
And I realized just before we, we closed this, I should also show that the tools are working and in

02:54.980 --> 02:55.380
action.

02:55.380 --> 02:58.740
So after saying this, I should let's do the same thing.

02:59.220 --> 02:59.380
Um.

02:59.420 --> 03:11.300
Please send me a push notification with the current USD GBP exchange rates.

03:12.140 --> 03:13.620
Let's let it do its thing.

03:18.060 --> 03:18.900
Off it goes.

03:18.900 --> 03:24.300
And I just got a push notification and it says 0.78.

03:24.380 --> 03:25.100
Ha ha ha!

03:25.580 --> 03:26.300
There we go.

03:27.020 --> 03:27.740
So, uh.

03:27.780 --> 03:28.540
Success.

03:28.780 --> 03:31.940
Uh, I think, um, maybe, uh.

03:34.820 --> 03:35.420
Interesting.

03:35.940 --> 03:37.900
Uh, what what if I say I can?

03:37.940 --> 03:40.140
I'm trying to think about how we can use memory as well.

03:40.180 --> 03:41.260
Can you send that?

03:41.540 --> 03:47.660
Can you send that push notification again, please?

03:48.740 --> 03:49.460
Let's try that.

03:51.260 --> 03:51.820
There we go.

03:51.860 --> 03:54.300
I got another push notification with the same thing.

03:54.300 --> 03:55.020
So there, there.

03:55.060 --> 03:56.340
I had to think for a moment.

03:56.340 --> 04:02.690
There's a demonstration of both memory and tool calling in one shot with the right answer.

04:02.690 --> 04:03.490
Success.

04:03.850 --> 04:07.610
And you can see the various calls happening down there.

04:07.850 --> 04:10.370
So that then is a wrap on this.

04:10.570 --> 04:16.290
Um, and uh, it might be nice for us just to bring that up in Lang Smith just to see those calls.

04:16.290 --> 04:19.890
And so here we are in Lang Smith looking at that most recent request.

04:19.890 --> 04:25.290
And it's good to see that, as I was hoping to see it did use the tool to send the push notification.

04:25.290 --> 04:29.130
It didn't bother doing the search again because it had that in its memory.

04:29.130 --> 04:34.690
And you can see at the bottom here that it sends that push notification, and it then confirms back

04:34.690 --> 04:37.490
there that it did it as just as we saw in the chat.

04:37.490 --> 04:41.050
And you can see all of the history that it's got up above it.

04:41.050 --> 04:45.490
So you can see in Lang Smith that true to its word, everything is working.

04:45.490 --> 04:48.770
The memory is working, the tool call is working.

04:48.970 --> 04:51.610
Uh, and it knew that it already knew the exchange rate.

04:51.810 --> 04:54.010
Uh, so I'd say that that is a success.

04:54.170 --> 05:00.440
And to wrap up, let me show you one more time this great picture, which now I hope is lands nicely

05:00.440 --> 05:01.080
with you.

05:01.120 --> 05:02.040
We define our graph.

05:02.040 --> 05:07.720
We run each super step with each interaction, and these red lines are showing the checkpointing that's

05:07.720 --> 05:10.800
happening so that we can resume at any point.

05:10.800 --> 05:13.320
We can replay the state as it was.

05:13.320 --> 05:20.040
Then we can time travel back, and we can persist this in a database so that it maintains knowledge

05:20.040 --> 05:20.800
of the conversation.

05:20.800 --> 05:22.880
And it's keyed off this thread ID.

05:23.240 --> 05:26.560
And with that that concludes day three.

05:26.600 --> 05:28.040
And it was a meaty day.

05:28.040 --> 05:30.000
We covered a lot of ground.

05:30.160 --> 05:34.520
And I hope that you're building some of the same enthusiasms that I'm that I'm growing.

05:34.560 --> 05:35.880
As we get into this.

05:36.440 --> 05:43.240
For Landgraf, and seeing seeing the strengths, seeing how resilient, how robust it is, uh, and

05:43.240 --> 05:45.880
this, this discipline that it puts around the process.

05:46.280 --> 05:49.840
But that's enough of the, of the, of the learning and the concepts.

05:49.880 --> 05:54.280
Next time we launch into our project, our project called sidekick.

05:54.400 --> 05:55.640
And it's a really great one.

05:55.640 --> 05:56.920
I can't wait to show it to you.

05:56.960 --> 05:57.760
See you then.
