1
00:00:00,080 --> 00:00:03,000
I've been looking forward to today for some time.

2
00:00:03,320 --> 00:00:06,240
I have a total treat in store for you today.

3
00:00:06,360 --> 00:00:12,200
I, I feel jealous that you are where you are, having not experienced what I have in store for you

4
00:00:12,200 --> 00:00:14,320
today and it's all about to happen to you.

5
00:00:14,720 --> 00:00:18,200
You you probably think I'm being over the top, but wait and see.

6
00:00:18,480 --> 00:00:18,960
All right.

7
00:00:18,960 --> 00:00:21,120
What is it about today that I'm so excited about?

8
00:00:21,160 --> 00:00:24,520
Well, this is the day of vectors for Rag.

9
00:00:24,560 --> 00:00:26,680
I'm going to introduce Lang chain.

10
00:00:26,720 --> 00:00:27,680
Such a.

11
00:00:27,720 --> 00:00:30,800
I mean, we've been introduced to it before, but we're going to go deeper on Lang Chain.

12
00:00:30,800 --> 00:00:38,160
And I'm going to introduce you to, to looking actually at vectors, putting them in chroma and visualizing

13
00:00:38,160 --> 00:00:39,120
them in chroma.

14
00:00:39,480 --> 00:00:42,560
As a reminder of what you can already do, you can already generate text.

15
00:00:42,560 --> 00:00:47,200
You can generate code with frontier models, with assistance tools, with open source models, you can

16
00:00:47,200 --> 00:00:50,720
confidently choose the right model for your project.

17
00:00:50,720 --> 00:00:57,040
And at this point, you can explain the big idea behind Rag, the fact that you use vectors to do a

18
00:00:57,080 --> 00:00:58,480
sort of semantic search.

19
00:00:58,520 --> 00:01:01,710
A fuzzy search to find relevant content.

20
00:01:01,710 --> 00:01:03,190
That's the big idea.

21
00:01:03,190 --> 00:01:07,110
That's what we're going to use to go from that rather simplistic thing that we did yesterday.

22
00:01:07,310 --> 00:01:09,710
There's something rather more powerful.

23
00:01:09,750 --> 00:01:14,110
And by the end of today, you're going to be able to explain long chain, the good and the bad.

24
00:01:14,190 --> 00:01:19,110
You're going to be able to work with popular encoders, embedding models as they're also known.

25
00:01:19,110 --> 00:01:25,950
And you'll be able to divide documents into chunks, turn chunks into vectors, put vectors in a vector

26
00:01:25,950 --> 00:01:28,910
data, store all of that all in one day.

27
00:01:29,030 --> 00:01:29,990
And it's today.

28
00:01:30,030 --> 00:01:34,230
Okay, before we dig in, let's do a super quick recap of what we went through yesterday.

29
00:01:34,230 --> 00:01:37,070
I know you already get it, but it's important to reinforce.

30
00:01:37,070 --> 00:01:39,270
So the user asks a question.

31
00:01:39,590 --> 00:01:42,550
We did something pretty janky yesterday when we took that question.

32
00:01:42,550 --> 00:01:46,990
We just sort of broke it into words and we saw, do we have anything about these words?

33
00:01:46,990 --> 00:01:51,270
But that's not a great way of doing it because you may miss important information.

34
00:01:51,270 --> 00:01:54,470
You really want to do some kind of a fuzzy search on that text.

35
00:01:54,590 --> 00:01:56,510
Okay, here's a way to do that.

36
00:01:56,510 --> 00:01:58,990
Bring in an encoding LL.M.

37
00:01:59,030 --> 00:02:03,300
An and Lmw that creates a vector that represents the meaning of the question.

38
00:02:03,380 --> 00:02:05,020
Turn the question into a vector.

39
00:02:05,140 --> 00:02:07,140
Look that up in a vector data.

40
00:02:07,180 --> 00:02:12,860
Store a database which is quick at finding similar information to the vector that you just passed in,

41
00:02:13,060 --> 00:02:15,700
and then collect this information that we've got.

42
00:02:15,820 --> 00:02:17,620
Pass that in the prompt to the LM.

43
00:02:17,620 --> 00:02:23,660
And what we'll get back is something which is based on that context, that relevant context that we've

44
00:02:23,660 --> 00:02:24,780
passed in in the prompt.

45
00:02:24,820 --> 00:02:25,260
Okay.

46
00:02:25,260 --> 00:02:27,700
Let's now talk about lang chains.

47
00:02:27,700 --> 00:02:31,380
So you met Lang Chain briefly uh, earlier on.

48
00:02:31,380 --> 00:02:33,780
But now we're going to go deeper on lang chain.

49
00:02:33,780 --> 00:02:36,180
So Lang chains are an open source framework.

50
00:02:36,220 --> 00:02:42,420
It was launched October 2022 by someone called Harrison Chase who who started this and then later formed

51
00:02:42,420 --> 00:02:44,020
a company around it.

52
00:02:44,340 --> 00:02:46,500
It is a common framework.

53
00:02:46,500 --> 00:02:51,940
We sometimes call these abstraction layers that allows you to interface with many different models and

54
00:02:51,940 --> 00:02:56,180
also stitch them together, building things like rag pipelines that we'll be doing.

55
00:02:56,500 --> 00:03:04,660
And there was a new version of Lang Chain, released very recently, October 2025, which is quite significant

56
00:03:04,660 --> 00:03:08,460
overhaul including repackaging much of Lang chain.

57
00:03:08,460 --> 00:03:15,260
So there really is a kind of a pre 1.0 and a post 1.0, and we will work with 1.0 with the new version

58
00:03:15,260 --> 00:03:22,420
of Lang Chain today as we dig in to this, this, this framework, um, this abstraction layer that

59
00:03:22,420 --> 00:03:28,860
lets you glue together, chain together different llms to accomplish a business task and to introduce

60
00:03:28,900 --> 00:03:32,380
the like the pros and cons of Lang chain, the good and the bad.

61
00:03:32,580 --> 00:03:34,180
So a few a few pros.

62
00:03:34,180 --> 00:03:40,220
First of all, Lang chain is something that makes it much quicker to glue together llms to accomplish

63
00:03:40,220 --> 00:03:40,700
something.

64
00:03:40,700 --> 00:03:47,220
So for things like assistants or for rag that will do or for summarization tasks, it means you can

65
00:03:47,220 --> 00:03:48,700
get to market much quicker.

66
00:03:48,980 --> 00:03:50,300
Things like using tools.

67
00:03:50,340 --> 00:03:54,020
There's a there's a very robust set of tools that comes with it.

68
00:03:54,180 --> 00:03:57,340
This sort of stuff very quick to do out of the box.

69
00:03:57,530 --> 00:03:59,050
That's what Langshan gives you.

70
00:03:59,450 --> 00:04:02,850
There's also a lot of adoption in the enterprise.

71
00:04:02,850 --> 00:04:08,850
Langshan was extremely popular when it first came out, and during 2023, it really, really took off

72
00:04:08,850 --> 00:04:09,730
in a big way.

73
00:04:09,730 --> 00:04:11,890
So it's very common in enterprise.

74
00:04:12,050 --> 00:04:17,170
A lot of projects use Langshan, so it's often it's a good, good resume material.

75
00:04:17,170 --> 00:04:18,210
It's good to have it there.

76
00:04:18,210 --> 00:04:19,570
It's something that you know how to do.

77
00:04:19,610 --> 00:04:21,530
You will frequently come across it.

78
00:04:21,530 --> 00:04:26,810
So in terms of some of the downsides of Langshan, probably the first thing I'll mention is that when

79
00:04:26,810 --> 00:04:35,490
Langshan first came along in like 2223, it was quite different to make calls to to OpenAI and to anthropic

80
00:04:35,490 --> 00:04:37,410
and to Gemini if you did it yourself.

81
00:04:37,650 --> 00:04:42,930
And so there was a huge need for something like Langshan that unified and brought this together and

82
00:04:42,930 --> 00:04:44,890
made it so you could switch around different models.

83
00:04:45,090 --> 00:04:46,930
But since then, times have changed.

84
00:04:46,930 --> 00:04:53,690
And now, as you've experienced yourself, because all the providers have OpenAI compatible endpoints,

85
00:04:53,690 --> 00:04:59,280
it's incredibly simple to switch between different models just using the OpenAI Python client library,

86
00:04:59,280 --> 00:05:03,720
and you can just switch out the base URL, which can just be configuration and move between different

87
00:05:03,720 --> 00:05:04,600
providers.

88
00:05:04,600 --> 00:05:09,400
So there's less need for this kind of abstraction layer built on top.

89
00:05:09,640 --> 00:05:16,040
And also some of the other things that that this was, that was set out to, to simplify, like using

90
00:05:16,080 --> 00:05:20,960
tools and using prompt templates, they've all sort of converged over time.

91
00:05:20,960 --> 00:05:24,240
There are now very common patterns for doing all of these things.

92
00:05:24,240 --> 00:05:28,160
So there's there's less of a need for long chain at this point.

93
00:05:28,160 --> 00:05:29,680
So that's obviously a downside.

94
00:05:29,720 --> 00:05:34,640
And the other downside is perhaps more debatable and is perhaps a matter of personal taste.

95
00:05:34,800 --> 00:05:40,600
But Langston originally was considered to be a fairly lightweight abstraction layer.

96
00:05:40,600 --> 00:05:45,440
But over time it has grown and grown, and it's now reasonably heavyweight.

97
00:05:45,440 --> 00:05:48,480
It's pretty substantive in terms of everything it offers.

98
00:05:48,480 --> 00:05:48,960
It has.

99
00:05:48,960 --> 00:05:52,240
It has a lot of terminology, some concepts, some things to learn.

100
00:05:52,440 --> 00:05:57,750
It even has its own language, LCL, that hasn't really taken off, but that's also part of it too.

101
00:05:57,790 --> 00:05:59,550
And and some people do use that.

102
00:05:59,550 --> 00:06:03,310
And so it's actually become quite a heavyweight abstraction layer.

103
00:06:03,350 --> 00:06:04,230
There's a lot of learning.

104
00:06:04,230 --> 00:06:08,190
There's quite a learning curve to go into the Lang chain ecosystem.

105
00:06:08,470 --> 00:06:15,550
And nowadays there are other abstraction layers like light LM that we met that are really very lightweight

106
00:06:15,550 --> 00:06:16,310
indeed.

107
00:06:16,310 --> 00:06:22,750
And that can you can use things like light LM very easily with a tiny learning curve and switch between

108
00:06:22,750 --> 00:06:26,190
different models, where lang chain is a lot more to sign up for.

109
00:06:26,470 --> 00:06:31,830
And so as a result, lang chain has started to feel a bit more like it's like a legacy product with

110
00:06:31,830 --> 00:06:37,510
with a big learning curve and with stuff that's kind of hung over from, from a prior age, like the

111
00:06:37,550 --> 00:06:39,150
human message and AI message stuff.

112
00:06:39,150 --> 00:06:45,510
If you know that which has been replaced really in people's minds with a very simple list of dicts that

113
00:06:45,510 --> 00:06:47,390
we're so familiar with from OpenAI.

114
00:06:47,830 --> 00:06:52,390
So from that point of view, Lang Chain can feel a bit heavy, quite a big learning curve.

115
00:06:52,430 --> 00:06:58,030
There are lighter things available like light, little lamb and and some of it is perhaps less needed.

116
00:06:58,030 --> 00:07:00,310
So I wanted to give you that kind of candid pros and cons.

117
00:07:00,310 --> 00:07:04,350
You're going to get a personal first hand assessment of it yourself in the next few days.

118
00:07:04,350 --> 00:07:08,630
As we work with it, it's as I say, you're going to see the best of Long Chain, and maybe you're also

119
00:07:08,630 --> 00:07:10,310
going to see some some of the rough edges.

120
00:07:10,310 --> 00:07:13,830
It's going to be so easy to build a rag pipeline.

121
00:07:13,830 --> 00:07:16,070
We're going to have it all together, a couple of lines of code.

122
00:07:16,070 --> 00:07:18,030
We're going to have ourselves a rag pipeline.

123
00:07:18,030 --> 00:07:19,950
It's going to be fantastic.

124
00:07:19,950 --> 00:07:25,350
But you may also see some of the bit of the learning curve terminology, extra stuff that comes with

125
00:07:25,350 --> 00:07:25,990
the mix.

126
00:07:26,190 --> 00:07:29,670
And of course, Lang chain itself is now it's part of the Lang Chain Company.

127
00:07:29,670 --> 00:07:31,190
They have other offerings too.

128
00:07:31,230 --> 00:07:34,430
They have Lang graph, which is something very different.

129
00:07:34,590 --> 00:07:41,630
Uh, used to, to, to connect together agents in a dependency graph that we cover in my agent course,

130
00:07:41,830 --> 00:07:44,990
they have Lang Smith, which is an observability platform.

131
00:07:45,110 --> 00:07:47,030
Um, and they have some other things as well.

132
00:07:47,030 --> 00:07:51,990
So, so there's, there's a big ecosystem built around Lang chain, and there's a lot to like about

133
00:07:51,990 --> 00:07:52,150
it.

134
00:07:52,150 --> 00:07:54,790
And a couple of things to watch out for as we will see.