WEBVTT

1
00:00:00.120 --> 00:00:01.380
<v ->Hey there, Aiden here,</v>

2
00:00:01.380 --> 00:00:04.260
and I want to show you something super useful

3
00:00:04.260 --> 00:00:07.920
when developing agents in the LangChain ecosystem.

4
00:00:07.920 --> 00:00:11.310
With LangChain, or with LangGraph, and using LangSmith.

5
00:00:11.310 --> 00:00:12.960
And if you've been coding recently,

6
00:00:12.960 --> 00:00:17.010
you are probably been using now a AI coding editor,

7
00:00:17.010 --> 00:00:19.800
like Cursor, like Claude Code,

8
00:00:19.800 --> 00:00:21.270
let me open Claude Code.

9
00:00:21.270 --> 00:00:24.600
You've been using those coding editors to write your code.

10
00:00:24.600 --> 00:00:25.830
I've been using them a lot.

11
00:00:25.830 --> 00:00:29.370
Now, with those coding editors, while they're awesome,

12
00:00:29.370 --> 00:00:31.350
they have a very annoying problem

13
00:00:31.350 --> 00:00:34.800
when it comes to ever-changing frameworks like LangChain.

14
00:00:34.800 --> 00:00:36.360
So, LangChain is very dynamic,

15
00:00:36.360 --> 00:00:38.370
it is continuously changing.

16
00:00:38.370 --> 00:00:39.420
And trust me, I know it,

17
00:00:39.420 --> 00:00:41.790
I'm updating the course continuously,

18
00:00:41.790 --> 00:00:45.570
it's very, very hard to keep up with the rate things change.

19
00:00:45.570 --> 00:00:47.190
Sometimes API break,

20
00:00:47.190 --> 00:00:49.320
sometimes objects are deprecated,

21
00:00:49.320 --> 00:00:51.300
and it's really hard to keep up with it.

22
00:00:51.300 --> 00:00:54.060
Now, LLMs, they don't keep up with it,

23
00:00:54.060 --> 00:00:56.940
because LLMs are trained in a given point of time,

24
00:00:56.940 --> 00:01:00.540
and they're trained on the LangChain version which is out

25
00:01:00.540 --> 00:01:03.300
by the time that the training data was collected.

26
00:01:03.300 --> 00:01:05.700
And we can use an LLM

27
00:01:05.700 --> 00:01:07.620
that was trained a couple of months ago,

28
00:01:07.620 --> 00:01:10.230
and the LangChain ecosystem can change dramatically.

29
00:01:10.230 --> 00:01:12.870
Now, this is true not only for LangChain,

30
00:01:12.870 --> 00:01:16.020
but for almost everything in this field,

31
00:01:16.020 --> 00:01:18.570
in this AI field, this is continuously changing.

32
00:01:18.570 --> 00:01:22.500
So if we're going to be using those coding agents

33
00:01:22.500 --> 00:01:25.830
for something very dynamic, like LangChain for example,

34
00:01:25.830 --> 00:01:27.157
if we're going to ask,

35
00:01:27.157 --> 00:01:32.157
"Write me an agent with LangChain that does X...",

36
00:01:35.100 --> 00:01:38.190
depending when we're going to be running this,

37
00:01:38.190 --> 00:01:40.740
we might get some rubbish answer,

38
00:01:40.740 --> 00:01:42.390
which is not going to be helpful,

39
00:01:42.390 --> 00:01:45.960
which is going to be based on old variations of LangChain,

40
00:01:45.960 --> 00:01:47.940
which is not going to be up to date.

41
00:01:47.940 --> 00:01:51.870
And the LangChain team are pretty aware of this.

42
00:01:51.870 --> 00:01:54.150
And if you go to their documentation,

43
00:01:54.150 --> 00:01:55.230
right over here, you can see,

44
00:01:55.230 --> 00:01:56.970
you have here this Copy page.

45
00:01:56.970 --> 00:01:58.470
So, first, with one click,

46
00:01:58.470 --> 00:02:00.900
you can go and copy this entire page,

47
00:02:00.900 --> 00:02:04.410
and you can put it in an LLM in a chat application

48
00:02:04.410 --> 00:02:05.310
and can use it.

49
00:02:05.310 --> 00:02:07.410
Now, if you go here and click this,

50
00:02:07.410 --> 00:02:12.410
you can see you can also ask to Copy MCP Server.

51
00:02:12.420 --> 00:02:14.730
Now, if I'm going to copy the MCP server,

52
00:02:14.730 --> 00:02:16.110
let's say with Cursor,

53
00:02:16.110 --> 00:02:17.700
let me open up Cursor here,

54
00:02:17.700 --> 00:02:19.200
what this is going to do,

55
00:02:19.200 --> 00:02:23.580
it's going to add the LangChain docs as an MCP server.

56
00:02:23.580 --> 00:02:24.413
You can see here,

57
00:02:24.413 --> 00:02:26.580
this is a streamable HTTP server,

58
00:02:26.580 --> 00:02:30.840
which is going to be pointing to the LangChain Docs MCP.

59
00:02:30.840 --> 00:02:35.840
So, LangChain was kind enough to create a public MCP server,

60
00:02:36.600 --> 00:02:40.620
which we can go and query without any API key,

61
00:02:40.620 --> 00:02:41.640
without anything,

62
00:02:41.640 --> 00:02:45.150
and simply take their latest and greatest documentation.

63
00:02:45.150 --> 00:02:48.000
And to use it, we need to simply install it.

64
00:02:48.000 --> 00:02:49.650
So, now this is installed.

65
00:02:49.650 --> 00:02:52.620
You can see it has one tool in it,

66
00:02:52.620 --> 00:02:54.097
SearchDocsByLangChain,

67
00:02:54.097 --> 00:02:57.180
"Search across the docs of LangChain knowledge base

68
00:02:57.180 --> 00:02:59.610
to find relevant information, code examples,

69
00:02:59.610 --> 00:03:01.530
API references, and guides.

70
00:03:01.530 --> 00:03:04.170
Use this tool when you need to answer questions

71
00:03:04.170 --> 00:03:07.350
about Docs By LangChain, find specific documentation,

72
00:03:07.350 --> 00:03:09.060
understand how features work,

73
00:03:09.060 --> 00:03:10.950
or locate implementation details.

74
00:03:10.950 --> 00:03:14.580
The search returns contextual content with titles

75
00:03:14.580 --> 00:03:17.520
and direct links to the documentation page."

76
00:03:17.520 --> 00:03:18.930
And it receives a query.

77
00:03:18.930 --> 00:03:22.500
So, and now let me go and disable for a minute context7,

78
00:03:22.500 --> 00:03:24.420
because context7 is going to do this

79
00:03:24.420 --> 00:03:26.370
for many, many libraries.

80
00:03:26.370 --> 00:03:29.700
The difference here is that DocsByLangChain

81
00:03:29.700 --> 00:03:32.847
is specifically tailor-made to LangChain

82
00:03:32.847 --> 00:03:34.377
and the LangChain ecosystem,

83
00:03:34.377 --> 00:03:37.500
and context7 is much more general.

84
00:03:37.500 --> 00:03:40.470
So if I'm going to be using a coding editor

85
00:03:40.470 --> 00:03:41.700
to write LangChain code,

86
00:03:41.700 --> 00:03:43.950
I would like to use this MCP server.

87
00:03:43.950 --> 00:03:46.230
So if I'm going to go now to the agent,

88
00:03:46.230 --> 00:03:47.437
and let me ask something like,

89
00:03:47.437 --> 00:03:49.020
"Hey, can you please tell me,

90
00:03:49.020 --> 00:03:51.900
how do I write a LangChain agent

91
00:03:51.900 --> 00:03:53.400
according to the latest docs?"

92
00:03:53.400 --> 00:03:55.470
Let me go and click Enter.

93
00:03:55.470 --> 00:03:57.660
And now the AI agent

94
00:03:57.660 --> 00:04:00.510
is supposed to invoke the LangChain MCP server.

95
00:04:00.510 --> 00:04:04.500
So now we can see it's running the SearchDocsByLangChain,

96
00:04:04.500 --> 00:04:06.330
it's refactored my question,

97
00:04:06.330 --> 00:04:08.760
latest LangChain Python agent creation.

98
00:04:08.760 --> 00:04:12.810
And now LangChain officially returned the relevant context,

99
00:04:12.810 --> 00:04:14.340
and we get the answer,

100
00:04:14.340 --> 00:04:16.740
which is to use the create_agent function.

101
00:04:16.740 --> 00:04:19.710
And let me go now and disable tavily MCP,

102
00:04:19.710 --> 00:04:22.860
which has search tool, extract, crawl tool,

103
00:04:22.860 --> 00:04:25.620
I want to disable it for this example.

104
00:04:25.620 --> 00:04:30.360
And let me now create now a new chat here.

105
00:04:30.360 --> 00:04:32.280
Let me copy the same prompt,

106
00:04:32.280 --> 00:04:33.240
and let me paste it.

107
00:04:33.240 --> 00:04:36.660
So now I don't have any MCPs connected,

108
00:04:36.660 --> 00:04:39.540
and let's see what's the answer of the LLM going to be now.

109
00:04:39.540 --> 00:04:41.520
So now we can see it's invoking

110
00:04:41.520 --> 00:04:44.820
a default search tool by Cursor.

111
00:04:44.820 --> 00:04:48.030
So it's going to be using Cursor's different search tool.

112
00:04:48.030 --> 00:04:48.900
And here we can see,

113
00:04:48.900 --> 00:04:51.270
initialized agent was actually found.

114
00:04:51.270 --> 00:04:54.270
And this is the first agent that was created,

115
00:04:54.270 --> 00:04:57.870
it's been deprecated for a very long time ago.

116
00:04:57.870 --> 00:05:01.860
Trust me, I refilled this video about it a bunch of times,

117
00:05:01.860 --> 00:05:03.480
and we can see it's still going,

118
00:05:03.480 --> 00:05:05.520
it's still searching things,

119
00:05:05.520 --> 00:05:07.020
it's still acting,

120
00:05:07.020 --> 00:05:10.410
and we can see it taking a lot of time.

121
00:05:10.410 --> 00:05:12.300
And this is because we are not using

122
00:05:12.300 --> 00:05:14.400
the LangChain MCP server.

123
00:05:14.400 --> 00:05:15.813
And let's see what result we have here.

124
00:05:15.813 --> 00:05:16.740
Here we can see,

125
00:05:16.740 --> 00:05:21.270
we have create_react_agent, which was actually deprecated.

126
00:05:21.270 --> 00:05:24.690
And we got here deprecated code.

127
00:05:24.690 --> 00:05:28.530
So if we didn't have the LangChain MCP server,

128
00:05:28.530 --> 00:05:30.540
let me go and enable it,

129
00:05:30.540 --> 00:05:33.870
so if we didn't have the LangChain MCP server,

130
00:05:33.870 --> 00:05:36.630
then the code we got Cursor to write

131
00:05:36.630 --> 00:05:39.690
is going to be the wrong code, and the deprecated code.

132
00:05:39.690 --> 00:05:42.660
So the fact that LangChain went

133
00:05:42.660 --> 00:05:46.230
and implemented a remote MCP server,

134
00:05:46.230 --> 00:05:48.510
which is going to make our lives way easier

135
00:05:48.510 --> 00:05:50.370
when using coding agents,

136
00:05:50.370 --> 00:05:53.100
is something very impressive, I have to say.

137
00:05:53.100 --> 00:05:56.130
Now, LangChain were actually one of the first companies

138
00:05:56.130 --> 00:05:59.130
to also make their entire documentation websites

139
00:05:59.130 --> 00:06:03.930
with llms.txt, which we covered in the course.

140
00:06:03.930 --> 00:06:05.520
And we can see we have other integrations,

141
00:06:05.520 --> 00:06:07.560
we can use VS Code MCP,

142
00:06:07.560 --> 00:06:09.750
we can use Claude for that,

143
00:06:09.750 --> 00:06:11.880
and this is very, very useful.

144
00:06:11.880 --> 00:06:14.850
So, if you're going to be running some LangChain code,

145
00:06:14.850 --> 00:06:18.330
I highly recommend you using this MCP server.

146
00:06:18.330 --> 00:06:20.580
And I want to show you something even cooler.

147
00:06:20.580 --> 00:06:24.960
If you go to chat.langchain.com,

148
00:06:24.960 --> 00:06:29.850
you can ask and talk to LangChain's documentation helper,

149
00:06:29.850 --> 00:06:31.110
which they created.

150
00:06:31.110 --> 00:06:33.247
And let's paste the prompt from before.

151
00:06:33.247 --> 00:06:35.550
"Hi, can you please tell me how do I write LangChain agent

152
00:06:35.550 --> 00:06:36.840
according to latest docs?"

153
00:06:36.840 --> 00:06:39.570
And what's actually going to happen,

154
00:06:39.570 --> 00:06:41.520
the tool that is going to be invoked

155
00:06:41.520 --> 00:06:43.200
to search the documents,

156
00:06:43.200 --> 00:06:45.210
searching the documentation for agents,

157
00:06:45.210 --> 00:06:48.210
I think it's actually going to be using the same MCP server

158
00:06:48.210 --> 00:06:49.230
we are using.

159
00:06:49.230 --> 00:06:51.060
I'm not sure, I need to find it out,

160
00:06:51.060 --> 00:06:52.890
but this is probably the case.

161
00:06:52.890 --> 00:06:54.780
And here we can see, we got the correct answer,

162
00:06:54.780 --> 00:06:56.940
with the create_agent text.

163
00:06:56.940 --> 00:06:58.920
And you know what, let me verify it,

164
00:06:58.920 --> 00:07:01.200
let's go to view trace here,

165
00:07:01.200 --> 00:07:03.040
they've done everything so it'll be super easy

166
00:07:03.040 --> 00:07:05.460
and super transparent to see what's happening.

167
00:07:05.460 --> 00:07:07.290
This is very, very crazy.

168
00:07:07.290 --> 00:07:08.520
Yeah, you can see here,

169
00:07:08.520 --> 00:07:11.130
we are using the SearchDocsByLangChain.

170
00:07:11.130 --> 00:07:13.710
So this is going to be the same MCP server

171
00:07:13.710 --> 00:07:16.590
which is going to power the Chat LangChain,

172
00:07:16.590 --> 00:07:17.790
official Chat LangChain.

173
00:07:17.790 --> 00:07:19.440
So this is very, very cool.

174
00:07:19.440 --> 00:07:20.370
And here you can see, by the way,

175
00:07:20.370 --> 00:07:24.720
the entire trace for the Chat LangChain run we had.

176
00:07:24.720 --> 00:07:28.620
And we can see we invoked the tool here twice.

177
00:07:28.620 --> 00:07:31.650
And, first time, it looked for agents.

178
00:07:31.650 --> 00:07:32.670
The second time,

179
00:07:32.670 --> 00:07:34.980
it went for OSS troubleshooting.

180
00:07:34.980 --> 00:07:37.290
And here we can see, it searched for create_agent.

181
00:07:37.290 --> 00:07:39.480
So, there were a bunch of tool calls here.

182
00:07:39.480 --> 00:07:41.730
So this is something which is

183
00:07:41.730 --> 00:07:43.770
really, really wonderful to see,

184
00:07:43.770 --> 00:07:45.930
how everything connects together,

185
00:07:45.930 --> 00:07:49.440
MCP, LangChain, coding agents,

186
00:07:49.440 --> 00:07:51.540
and this is really cool in my opinion.

187
00:07:51.540 --> 00:07:53.940
So, just to finish, the gist of it,

188
00:07:53.940 --> 00:07:56.550
please, I urge you, if you're going to use coding agents,

189
00:07:56.550 --> 00:08:00.860
please go here and use the LangChain MCP server.

