1
00:00:00,000 --> 00:00:01,000
Hello guys!

2
00:00:01,000 --> 00:00:07,000
In this video we are going to create an amazing end to end multi AI agent application using land graph

3
00:00:07,000 --> 00:00:08,000
and astrolabe.

4
00:00:08,000 --> 00:00:13,000
Now if you don't know about land graph, Landgraaf actually helps you to create AI agents in such a

5
00:00:13,000 --> 00:00:15,000
way that you'll be able to manage their state.

6
00:00:15,000 --> 00:00:17,000
The communication between the agents.

7
00:00:17,000 --> 00:00:22,000
It provides you the entire workflow to probably create this amazing AI applications.

8
00:00:22,000 --> 00:00:27,000
So in this video also, we are going to probably discuss about an end to end project.

9
00:00:27,000 --> 00:00:31,000
First of all, we will go ahead and discuss about the architecture, what we are actually trying to

10
00:00:31,000 --> 00:00:32,000
implement.

11
00:00:32,000 --> 00:00:36,000
And then step by step, we'll go ahead and implement this with the help of land graph.

12
00:00:36,000 --> 00:00:40,000
So here the architecture of the project looks like this.

13
00:00:40,000 --> 00:00:46,000
Let's say that I'm trying to create a chatbot application which has this multi AI agent feature which

14
00:00:46,000 --> 00:00:49,000
will be able to communicate with each other and it will be able to do multiple task.

15
00:00:50,000 --> 00:00:54,000
So whenever a user query comes, there will be a start node in land graph.

16
00:00:54,000 --> 00:00:57,000
And this start node will further send it to router.

17
00:00:57,000 --> 00:01:01,000
Router basically means whenever I'm probably putting up a user query.

18
00:01:01,000 --> 00:01:08,000
We need to route it whether this user query can be fulfilled after requesting from a vector database,

19
00:01:08,000 --> 00:01:13,000
or whether it can be fulfilled from an external tool like wiki search.

20
00:01:13,000 --> 00:01:16,000
Now here, just for an example, I'm considering wiki search.

21
00:01:16,000 --> 00:01:22,000
But uh, in real world application you can even implement different different external tools you like,

22
00:01:22,000 --> 00:01:23,000
right?

23
00:01:23,000 --> 00:01:24,000
So wiki search is one.

24
00:01:24,000 --> 00:01:29,000
You can also use serp API, you know, to probably do Google search itself.

25
00:01:29,000 --> 00:01:29,000
Right.

26
00:01:29,000 --> 00:01:33,000
So in this example I'm just going to consider one.

27
00:01:33,000 --> 00:01:38,000
Uh, and similarly you can implement with respect to other third party external tools.

28
00:01:38,000 --> 00:01:44,000
Then uh, if I probably consider this side, you will be able to see that it will do a vector DB search.

29
00:01:44,000 --> 00:01:47,000
Now this vector db is basically getting created by Astra db.

30
00:01:47,000 --> 00:01:51,000
We will try to create this entire vector database in the cloud.

31
00:01:51,000 --> 00:01:51,000
Okay.

32
00:01:52,000 --> 00:01:53,000
In the cloud.

33
00:01:53,000 --> 00:01:58,000
And initially inside this vector database we will be putting some information.

34
00:01:58,000 --> 00:02:04,000
The information will be a website page from which we can specifically query right.

35
00:02:04,000 --> 00:02:08,000
We will take some URLs and we will read the entire data inside that particular website.

36
00:02:08,000 --> 00:02:13,000
And we will store that all in in the form of vectors in the vector database.

37
00:02:13,000 --> 00:02:14,000
That is Astra DB.

38
00:02:14,000 --> 00:02:15,000
Right.

39
00:02:15,000 --> 00:02:17,000
And this will be in the cloud platform.

40
00:02:17,000 --> 00:02:19,000
Um, basically it is deployed in the cloud.

41
00:02:19,000 --> 00:02:25,000
And I will try to show you the entire configuration and how powerful and amazing Astra DB is.

42
00:02:25,000 --> 00:02:30,000
Okay, after we do this specific thing, then the next step will be that we will get the response from

43
00:02:30,000 --> 00:02:38,000
this, and then we can integrate along with LLM along with some prompt engineering like what we really

44
00:02:38,000 --> 00:02:40,000
want to do with this particular response.

45
00:02:40,000 --> 00:02:42,000
And finally we should be able to get our response.

46
00:02:42,000 --> 00:02:44,000
And the final node is basically n.

47
00:02:44,000 --> 00:02:48,000
So this is the entire architecture of this project.

48
00:02:48,000 --> 00:02:49,000
In terms of line graph.

49
00:02:49,000 --> 00:02:53,000
We are going to be we are we are going to use the line graph where we are going to implement this entire

50
00:02:53,000 --> 00:02:54,000
thing.

51
00:02:54,000 --> 00:02:54,000
Right.

52
00:02:55,000 --> 00:02:59,000
So without wasting any time, let's go ahead and implement this entire thing.

53
00:02:59,000 --> 00:03:00,000
Okay.

54
00:03:00,000 --> 00:03:04,000
So first of all you really need to know about data stacks.

55
00:03:04,000 --> 00:03:07,000
So data stacks actually provides you the access of Astra DB.

56
00:03:07,000 --> 00:03:13,000
So in order to access them, uh, you know, you can actually do vector search for real world journey

57
00:03:13,000 --> 00:03:14,000
applications.

58
00:03:14,000 --> 00:03:16,000
And it is really, really powerful.

59
00:03:16,000 --> 00:03:17,000
Okay.

60
00:03:17,000 --> 00:03:22,000
And already I have made some videos related to Astra in my previous tutorials also.

61
00:03:22,000 --> 00:03:24,000
So first of all, just go ahead and sign in.

62
00:03:24,000 --> 00:03:30,000
So once you probably sign in then you will be able to see this specific page okay.

63
00:03:30,000 --> 00:03:32,000
Um if you have not signed in.

64
00:03:32,000 --> 00:03:34,000
So first of all you need to sign up over there.

65
00:03:34,000 --> 00:03:38,000
Here you will be able to probably create databases.

66
00:03:38,000 --> 00:03:38,000
Okay.

67
00:03:38,000 --> 00:03:43,000
So in order to create the databases you can actually see over here I will just go ahead and click on

68
00:03:43,000 --> 00:03:45,000
Create Serverless database.

69
00:03:45,000 --> 00:03:46,000
Okay.

70
00:03:47,000 --> 00:03:48,000
Now there are two options over here.

71
00:03:48,000 --> 00:03:50,000
Serverless vector database.

72
00:03:50,000 --> 00:03:51,000
Serverless non vector database.

73
00:03:52,000 --> 00:03:57,000
But as you all know we are planning to probably create serverless vector database.

74
00:03:57,000 --> 00:03:57,000
Okay.

75
00:03:57,000 --> 00:03:59,000
And the reason is very simple.

76
00:03:59,000 --> 00:04:05,000
Whatever data we have or whatever, uh, whatever data in the form of text we have, we are going to

77
00:04:05,000 --> 00:04:06,000
convert that into vector.

78
00:04:06,000 --> 00:04:10,000
And we are going to save in this particular vector database itself.

79
00:04:10,000 --> 00:04:12,000
So first of all I'll click this.

80
00:04:12,000 --> 00:04:14,000
I will give my vector database name.

81
00:04:14,000 --> 00:04:18,000
Let's say this will be test database right.

82
00:04:19,000 --> 00:04:22,000
And here I will go ahead and select any of the region.

83
00:04:22,000 --> 00:04:25,000
And let me just go ahead and click on Create Database.

84
00:04:25,000 --> 00:04:30,000
So as soon as I probably create it it will take some amount of time.

85
00:04:30,000 --> 00:04:32,000
So let this get created.

86
00:04:32,000 --> 00:04:37,000
Till then I will just wait probably to create this entire database and then we will proceed with the

87
00:04:37,000 --> 00:04:38,000
next step.

88
00:04:38,000 --> 00:04:41,000
So yes, let me just go ahead and click this and let me start it.

89
00:04:41,000 --> 00:04:42,000
Okay.

90
00:04:42,000 --> 00:04:43,000
So this is getting created.

91
00:04:43,000 --> 00:04:45,000
It is going to take some amount of time.

92
00:04:45,000 --> 00:04:49,000
So once it is getting created I will probably go with the next step.

93
00:04:49,000 --> 00:04:53,000
So finally guys here you can see that my database has got created.

94
00:04:53,000 --> 00:04:55,000
That is text database a test database.

95
00:04:55,000 --> 00:04:57,000
It is a vector database.

96
00:04:57,000 --> 00:05:02,000
And please make sure that you keep a note of this database ID, because we will be requiring in order

97
00:05:02,000 --> 00:05:03,000
to access this database.

98
00:05:03,000 --> 00:05:07,000
Then the next step will be that we will go ahead and create our tokens.

99
00:05:07,000 --> 00:05:13,000
Now in order to create a token, first of all, you need to probably select the role that you are probably

100
00:05:13,000 --> 00:05:14,000
going ahead with.

101
00:05:14,000 --> 00:05:16,000
So I need administrator user.

102
00:05:16,000 --> 00:05:18,000
I will just go ahead and click on Generate Token.

103
00:05:18,000 --> 00:05:23,000
Now this token will be important because with the help of this particular token I will go ahead and

104
00:05:23,000 --> 00:05:25,000
access my database.

105
00:05:25,000 --> 00:05:25,000
Right.

106
00:05:25,000 --> 00:05:29,000
So if you also want to know you can also download this JSON file.

107
00:05:29,000 --> 00:05:32,000
So let me just go ahead and click and download the JSON file.

108
00:05:32,000 --> 00:05:32,000
Okay.

109
00:05:33,000 --> 00:05:35,000
So now I have my access token.

110
00:05:35,000 --> 00:05:36,000
Now my database is ready.

111
00:05:36,000 --> 00:05:40,000
Now it's time that we go ahead and start our execution of the code.

112
00:05:40,000 --> 00:05:40,000
Okay.

113
00:05:40,000 --> 00:05:45,000
So, uh, before we go ahead, step by step, I will try to show it to you.

114
00:05:45,000 --> 00:05:49,000
Till then, just let me hide my face so that you'll be able to clearly see the code itself.

115
00:05:50,000 --> 00:05:50,000
Okay.

116
00:05:50,000 --> 00:05:53,000
So here I'm going to use Google Colab.

117
00:05:53,000 --> 00:05:54,000
So I will change the runtime.

118
00:05:54,000 --> 00:05:57,000
Let me just use any GPU that I want.

119
00:05:57,000 --> 00:05:59,000
So I'll just go ahead and click on save.

120
00:06:00,000 --> 00:06:03,000
Um, so once I save it, my runtime will be on.

121
00:06:03,000 --> 00:06:04,000
Okay.

122
00:06:04,000 --> 00:06:05,000
Now what I'm actually going to do.

123
00:06:05,000 --> 00:06:09,000
First of all, we will go ahead and install some libraries.

124
00:06:09,000 --> 00:06:15,000
So first of all I require library like lang chain install lang chain.

125
00:06:16,000 --> 00:06:19,000
Then we are going to install lang graph.

126
00:06:19,000 --> 00:06:23,000
Then along with this we are also going to install cashier okay.

127
00:06:23,000 --> 00:06:30,000
So this cashier will be important because I am going to this will be helpful for me to initialize the

128
00:06:30,000 --> 00:06:31,000
Astra DB database itself.

129
00:06:31,000 --> 00:06:32,000
Right.

130
00:06:32,000 --> 00:06:37,000
So I will show you uh, because for initializing Cassandra DB we require this library.

131
00:06:37,000 --> 00:06:38,000
I'll show you as we go ahead.

132
00:06:38,000 --> 00:06:40,000
How why are we using this?

133
00:06:40,000 --> 00:06:44,000
Okay, so here you can see the installation has already taken it.

134
00:06:44,000 --> 00:06:45,000
It has already started.

135
00:06:45,000 --> 00:06:46,000
Okay.

136
00:06:46,000 --> 00:06:48,000
Then the next step after this.

137
00:06:48,000 --> 00:06:57,000
So what we are basically going to do is that we are going to import cashier And then we will provide

138
00:06:57,000 --> 00:07:03,000
the connection of the of the Astra DB.

139
00:07:03,000 --> 00:07:04,000
Okay.

140
00:07:06,000 --> 00:07:09,000
So in order to connect to the Astra DB, we will be using this.

141
00:07:09,000 --> 00:07:15,000
First of all, the important parameter that I actually require is my Astra DB application underscore

142
00:07:15,000 --> 00:07:16,000
token.

143
00:07:16,000 --> 00:07:16,000
Okay.

144
00:07:16,000 --> 00:07:21,000
Now this particular token we can get it from over here.

145
00:07:21,000 --> 00:07:24,000
So here you can see this token information is basically present.

146
00:07:24,000 --> 00:07:28,000
So I'm just going to copy this and I'm going to paste it over here.

147
00:07:28,000 --> 00:07:29,000
Okay.

148
00:07:29,000 --> 00:07:31,000
So here I'm just going to go ahead and paste it.

149
00:07:31,000 --> 00:07:36,000
And with the help of this particular token we will be able to connect to our Astra DB right.

150
00:07:36,000 --> 00:07:41,000
Then we are going to probably use our Astra db id.

151
00:07:41,000 --> 00:07:41,000
Okay.

152
00:07:42,000 --> 00:07:44,000
That is our database ID okay.

153
00:07:44,000 --> 00:07:46,000
So we will be using this.

154
00:07:46,000 --> 00:07:48,000
We have created this particular variable.

155
00:07:48,000 --> 00:07:54,000
Um let's let me go and see this So here is my test database.

156
00:07:54,000 --> 00:07:57,000
And here is my database ID.

157
00:07:57,000 --> 00:07:58,000
Okay.

158
00:07:58,000 --> 00:08:01,000
So this basically becomes my database ID itself right.

159
00:08:02,000 --> 00:08:05,000
Now in order to initialize this I require this two information.

160
00:08:05,000 --> 00:08:13,000
So I will go ahead and write Cachio dot init which is nothing but sorry dot init and will initialize

161
00:08:13,000 --> 00:08:14,000
this particular database.

162
00:08:14,000 --> 00:08:21,000
So token is equal to astra db app store db application token.

163
00:08:21,000 --> 00:08:31,000
And the second parameter will basically be my database database id which will be equal to Astra Astra

164
00:08:31,000 --> 00:08:33,000
db id okay.

165
00:08:33,000 --> 00:08:37,000
So here you can see once I execute this this will get initialized.

166
00:08:37,000 --> 00:08:40,000
And here I have got some warnings but it's okay.

167
00:08:40,000 --> 00:08:44,000
Now we are able to connect to our Astra DB right.

168
00:08:44,000 --> 00:08:45,000
Perfect.

169
00:08:45,000 --> 00:08:50,000
Now the next step will be that since we need to we need to develop the land graph itself.

170
00:08:50,000 --> 00:08:58,000
First of all, I will also install one more very important thing that is pip install lang chain underscore

171
00:08:58,000 --> 00:08:59,000
community.

172
00:08:59,000 --> 00:08:59,000
Okay.

173
00:09:00,000 --> 00:09:04,000
So let me go to go ahead and install this entire application over here.

174
00:09:04,000 --> 00:09:13,000
Once this is installed uh, I still need to install some more things like uh, lang chain grok, uh,

175
00:09:13,000 --> 00:09:16,000
lang chain hub, uh, lang Lang graphs.

176
00:09:16,000 --> 00:09:18,000
There are some more libraries that we are just going to install.

177
00:09:18,000 --> 00:09:24,000
So for that I will just go ahead and copy and paste over here and I'll talk about what all things we

178
00:09:24,000 --> 00:09:25,000
are basically going to install.

179
00:09:26,000 --> 00:09:26,000
Okay.

180
00:09:26,000 --> 00:09:31,000
So here you can see I'll be installing lang chain underscore community lang underscore community I think

181
00:09:31,000 --> 00:09:33,000
it is already been installed.

182
00:09:33,000 --> 00:09:35,000
We will be installing tick token.

183
00:09:35,000 --> 00:09:37,000
I'll talk about this.

184
00:09:37,000 --> 00:09:39,000
Uh we are going to use open source LM models.

185
00:09:39,000 --> 00:09:42,000
So for that we are going to use this Lang chain grok.

186
00:09:42,000 --> 00:09:48,000
Then you have lantern hub chrome adb lang chain lang graph lang chain hugging face.

187
00:09:48,000 --> 00:09:53,000
I will not require chrome adb because I'm specifically going to use this Datastax DB, right?

188
00:09:53,000 --> 00:09:56,000
So line graph line chain hugging face is basically there.

189
00:09:56,000 --> 00:09:59,000
So now let me just go ahead and install all these libraries.

190
00:09:59,000 --> 00:10:05,000
These are some of the basic requirements that I require in order to start my process.

191
00:10:05,000 --> 00:10:06,000
Okay.

192
00:10:06,000 --> 00:10:13,000
Now if you have been seeing my entire lecture series, uh, in this course itself, you'll be able to

193
00:10:13,000 --> 00:10:17,000
see that, um, I have already discussed about Lang Chain.

194
00:10:17,000 --> 00:10:20,000
I have discussed about recursive character text splitter.

195
00:10:20,000 --> 00:10:25,000
So first of all, what I'm actually going to do is that I'm going to read some kind of websites.

196
00:10:25,000 --> 00:10:30,000
You know, from that I will try to read the text data and convert that into vector and store it in a

197
00:10:30,000 --> 00:10:32,000
vector database which is present in Astro DB.

198
00:10:32,000 --> 00:10:33,000
Okay.

199
00:10:33,000 --> 00:10:35,000
So this is basically getting installed.

200
00:10:35,000 --> 00:10:36,000
It will take some amount of time.

201
00:10:36,000 --> 00:10:37,000
Let's wait till then.

202
00:10:38,000 --> 00:10:40,000
Then till then I will go ahead and write my other code.

203
00:10:40,000 --> 00:10:44,000
So here I'm going to use a text splitter which is called as recursive character text splitter.

204
00:10:44,000 --> 00:10:49,000
And since I told you that the data ingestion, I need to read my data from different websites.

205
00:10:49,000 --> 00:10:55,000
So I'll be loading underscore community dot document underscore loaders import web based loader okay.

206
00:10:56,000 --> 00:11:00,000
Then the URL uh which all URLs I'm specifically trying to read.

207
00:11:00,000 --> 00:11:03,000
So these are my three URLs that I'm going to use.

208
00:11:03,000 --> 00:11:09,000
One is related to agent, one is related to prompt engineering and one is related to adversarial attack

209
00:11:09,000 --> 00:11:10,000
LLM okay.

210
00:11:11,000 --> 00:11:15,000
Now what we are basically going to do is that we are going to load the URL.

211
00:11:15,000 --> 00:11:21,000
So for this I will go ahead and write docs is equal to web based web based loader.

212
00:11:21,000 --> 00:11:26,000
I will give my URL dot load instead of just using zero.

213
00:11:26,000 --> 00:11:28,000
I will use for URL in URLs.

214
00:11:28,000 --> 00:11:33,000
And this is basically going to read each and every URL and probably go ahead with the next step.

215
00:11:33,000 --> 00:11:36,000
Then I have automatically.

216
00:11:36,000 --> 00:11:37,000
This is the amazing thing.

217
00:11:38,000 --> 00:11:41,000
Google Colab provides you all the necessary things that is required.

218
00:11:41,000 --> 00:11:44,000
Okay, so here I'm going to use a text splitter.

219
00:11:44,000 --> 00:11:48,000
Now instead of using every time recursive character text splitter.

220
00:11:48,000 --> 00:11:50,000
This time I will show you something in a different way.

221
00:11:50,000 --> 00:11:55,000
So I am going to use something called as from underscore tech token Encoder.

222
00:11:55,000 --> 00:11:59,000
And here we are going to provide the chunk size of 500.

223
00:11:59,000 --> 00:12:03,000
And there will be also a chunk overlap.

224
00:12:03,000 --> 00:12:07,000
Let's say that I'm not interested in putting any kind of overlap.

225
00:12:07,000 --> 00:12:09,000
So I'll keep it to zero okay.

226
00:12:09,000 --> 00:12:14,000
So this way we will be able to do the splitting.

227
00:12:14,000 --> 00:12:19,000
Uh, so one assignment that I really want to give you is that just go ahead and explore about this particular

228
00:12:19,000 --> 00:12:22,000
function why this function is specifically used okay.

229
00:12:22,000 --> 00:12:28,000
The answer is given over here only if you just highlight this text splitter that uses tick token encoder

230
00:12:28,000 --> 00:12:30,000
to count length okay.

231
00:12:30,000 --> 00:12:35,000
So tick token encoder using uses encoding uh name as GPT two.

232
00:12:35,000 --> 00:12:36,000
You can just go ahead and see the definition.

233
00:12:36,000 --> 00:12:42,000
There is a slight difference between recursive character text splitter using this tick token encoders

234
00:12:42,000 --> 00:12:42,000
okay.

235
00:12:43,000 --> 00:12:50,000
Then I'm going to probably do the splitting my documents split, I will go ahead and define this variable.

236
00:12:50,000 --> 00:12:56,000
And I here I'm going to use my document split split underscore documents with respect to docs okay.

237
00:12:56,000 --> 00:13:02,000
Now before I go ahead and probably do this, you know, I will also go ahead and write one more line

238
00:13:02,000 --> 00:13:02,000
of code.

239
00:13:02,000 --> 00:13:05,000
That is my document list.

240
00:13:05,000 --> 00:13:12,000
Here I'm going to consider item for sub list and docs.

241
00:13:12,000 --> 00:13:18,000
I'm going to explore each and every docs for item and sub list.

242
00:13:18,000 --> 00:13:18,000
Okay.

243
00:13:19,000 --> 00:13:28,000
Let me explain about this specific code what exactly this does okay so here I'm saying hey for item

244
00:13:28,000 --> 00:13:28,000
in sub list.

245
00:13:28,000 --> 00:13:31,000
Then we are iterating to sub list in docs okay.

246
00:13:31,000 --> 00:13:33,000
And we are just getting the item okay.

247
00:13:33,000 --> 00:13:38,000
So if you just go ahead and print the document list, you'll be able to see that we'll get all the items

248
00:13:38,000 --> 00:13:39,000
that is displayed okay.

249
00:13:39,000 --> 00:13:45,000
So once I go ahead and execute this you'll be able to see okay let's execute this.

250
00:13:45,000 --> 00:13:47,000
It is going to take some amount of time.

251
00:13:47,000 --> 00:13:56,000
So here it is giving us an error saying that the list object has no attribute page underscore content.

252
00:13:56,000 --> 00:14:02,000
Let me just go ahead and check this out and let me see what is the error that is probably coming up

253
00:14:02,000 --> 00:14:02,000
over here.

254
00:14:02,000 --> 00:14:03,000
So okay.

255
00:14:03,000 --> 00:14:07,000
It should be documents doc underscore list.

256
00:14:07,000 --> 00:14:07,000
Okay.

257
00:14:07,000 --> 00:14:14,000
So if you want to just go ahead and print this doc list you'll be able to see what it prints okay.

258
00:14:15,000 --> 00:14:16,000
Okay.

259
00:14:16,000 --> 00:14:17,000
Again I'll get an error.

260
00:14:17,000 --> 00:14:19,000
So it should be doc underscore list.

261
00:14:20,000 --> 00:14:24,000
So in Doc underscore list you'll be able to see what item is basically getting displayed.

262
00:14:24,000 --> 00:14:29,000
Okay so here is all my information with respect to this.

263
00:14:29,000 --> 00:14:29,000
See.

264
00:14:31,000 --> 00:14:34,000
And then I'm taking this entire information I am splitting it.

265
00:14:34,000 --> 00:14:34,000
Okay.

266
00:14:34,000 --> 00:14:38,000
So this is my entire metadata that I have right.

267
00:14:38,000 --> 00:14:40,000
Then we do the text splitter with respect to chunk size.

268
00:14:40,000 --> 00:14:45,000
And then finally we do the we get the we do the split with the help of text underscore Splitter.

269
00:14:45,000 --> 00:14:45,000
Okay.

270
00:14:46,000 --> 00:14:49,000
Now once I have this dock underscore split.

271
00:14:49,000 --> 00:14:54,000
So if you go ahead and see this this is my dock underscore split okay.

272
00:14:55,000 --> 00:14:59,000
Now if I just go ahead and display this this is my entire splits that you'll be able to see.

273
00:14:59,000 --> 00:15:00,000
Right.

274
00:15:00,000 --> 00:15:01,000
Perfect.

275
00:15:01,000 --> 00:15:07,000
Now I need to take this content and convert this into vectors by using some kind of embeddings.

276
00:15:07,000 --> 00:15:13,000
So for this I am going to use from lang chain underscore hugging face okay.

277
00:15:13,000 --> 00:15:14,000
Hugging face.

278
00:15:14,000 --> 00:15:19,000
And from the hugging face we are going to import hugging face embeddings.

279
00:15:20,000 --> 00:15:26,000
Inside this embeddings I'm going to use hugging face embeddings.

280
00:15:28,000 --> 00:15:30,000
Hugging face embeddings.

281
00:15:30,000 --> 00:15:39,000
And we are going to use a free embedding technique that is available as an open source all dash mini

282
00:15:39,000 --> 00:15:44,000
lm okay L6V2 two.

283
00:15:44,000 --> 00:15:44,000
Okay.

284
00:15:44,000 --> 00:15:49,000
So this name if you see this is already available in the hugging face.

285
00:15:49,000 --> 00:15:52,000
So let's see this.

286
00:15:52,000 --> 00:15:54,000
And here you can see it is a sentence transformer.

287
00:15:54,000 --> 00:16:00,000
And this basically converts it maps sentences and paragraphs to a 384 dimensional dense vector.

288
00:16:00,000 --> 00:16:01,000
Okay.

289
00:16:01,000 --> 00:16:05,000
But for this you also require one very important thing.

290
00:16:05,000 --> 00:16:08,000
If I go and click on settings you'll be requiring a token.

291
00:16:08,000 --> 00:16:08,000
Right.

292
00:16:08,000 --> 00:16:12,000
So this many number of tokens is basically created right in my.

293
00:16:12,000 --> 00:16:16,000
You can go ahead and create a token because this token will be specifically used over here.

294
00:16:16,000 --> 00:16:21,000
You can see in the secret key I've added a token which is called as hugging face right.

295
00:16:21,000 --> 00:16:23,000
Hugging face API token.

296
00:16:23,000 --> 00:16:25,000
So it will be asking for this particular token itself right.

297
00:16:25,000 --> 00:16:27,000
So or h f underscore token.

298
00:16:27,000 --> 00:16:29,000
This token also you can basically specify.

299
00:16:29,000 --> 00:16:33,000
So create a token name provide a token name whatever name you want.

300
00:16:33,000 --> 00:16:39,000
And you should just provide permissions and go ahead and click create this for creating.

301
00:16:39,000 --> 00:16:43,000
You can see over here uh I will just go ahead and write read write.

302
00:16:43,000 --> 00:16:43,000
Okay.

303
00:16:43,000 --> 00:16:45,000
So let's say I want to read.

304
00:16:45,000 --> 00:16:47,000
So here I will just provide my token.

305
00:16:47,000 --> 00:16:51,000
Let's say my token name is something like h f token.

306
00:16:51,000 --> 00:16:53,000
Okay I will go ahead and create the token.

307
00:16:53,000 --> 00:16:57,000
Just copy this token over here and paste it right.

308
00:16:57,000 --> 00:17:00,000
This particular key name h f underscore token and paste it over here.

309
00:17:00,000 --> 00:17:03,000
I've already done that so I'm not going to do that.

310
00:17:03,000 --> 00:17:08,000
I will just go ahead and execute this because this is going to ask me the token information over here.

311
00:17:08,000 --> 00:17:11,000
And I just need to provide the grant access.

312
00:17:11,000 --> 00:17:15,000
So here you can see once this gets executed my token will be ready.

313
00:17:15,000 --> 00:17:18,000
See it is asking for grant access of h f underscore token.

314
00:17:18,000 --> 00:17:22,000
And here you can see it is now able to read the token itself.

315
00:17:22,000 --> 00:17:23,000
Okay.

316
00:17:24,000 --> 00:17:26,000
Now the next step over here.

317
00:17:26,000 --> 00:17:30,000
What we are basically going to do is that we are going to insert all the vectors that we have actually

318
00:17:30,000 --> 00:17:36,000
converted, uh, by using this embedding technique, okay, into our vector database.

319
00:17:36,000 --> 00:17:44,000
So first of all I will go ahead and write from lang chain lang chain Dot vector stores.

320
00:17:44,000 --> 00:17:45,000
Dot.

321
00:17:45,000 --> 00:17:46,000
Cassandra.

322
00:17:47,000 --> 00:17:47,000
Okay.

323
00:17:47,000 --> 00:17:49,000
Import.

324
00:17:49,000 --> 00:17:50,000
Cassandra.

325
00:17:50,000 --> 00:17:51,000
Okay.

326
00:17:51,000 --> 00:17:53,000
So we are going to import Cassandra.

327
00:17:53,000 --> 00:17:58,000
And then we are going to probably create our Astra underscore vector.

328
00:17:58,000 --> 00:18:02,000
Underscore store is equal to Cassandra.

329
00:18:02,000 --> 00:18:07,000
And inside this Cassandra we are going to use our embeddings.

330
00:18:07,000 --> 00:18:12,000
Embedding is equal to embeddings.

331
00:18:14,000 --> 00:18:18,000
And then I have my table underscore name is equal to.

332
00:18:18,000 --> 00:18:22,000
Let me give a table name like QA mini demo.

333
00:18:22,000 --> 00:18:25,000
Okay I'll just go ahead and write this.

334
00:18:25,000 --> 00:18:27,000
I will keep my session as none.

335
00:18:28,000 --> 00:18:35,000
Now what this is basically going to do is that it is just going to insert my data in the database that

336
00:18:35,000 --> 00:18:36,000
I've actually given.

337
00:18:36,000 --> 00:18:37,000
Okay.

338
00:18:37,000 --> 00:18:45,000
So this will basically be none Okay, so almost done.

339
00:18:45,000 --> 00:18:46,000
Any parameters has been left.

340
00:18:46,000 --> 00:18:49,000
Okay, I have to remove this bracket.

341
00:18:49,000 --> 00:18:49,000
Okay.

342
00:18:50,000 --> 00:18:51,000
Now this is done over here.

343
00:18:51,000 --> 00:18:54,000
So let me just go ahead and execute this.

344
00:18:55,000 --> 00:18:59,000
Now this will get connected to my database along with this embeddings.

345
00:18:59,000 --> 00:18:59,000
Okay.

346
00:18:59,000 --> 00:19:02,000
And the table that I'm actually going to create is this particular table.

347
00:19:02,000 --> 00:19:06,000
Now inside this table I need to just go ahead and store my data.

348
00:19:06,000 --> 00:19:07,000
Right.

349
00:19:07,000 --> 00:19:14,000
So first of all what I will do is that I will go ahead and import from lang chain dot indexes.

350
00:19:15,000 --> 00:19:15,000
Indexes.

351
00:19:15,000 --> 00:19:23,000
Dot vector store I'm going to import vector store index rapper not creator index rapper.

352
00:19:23,000 --> 00:19:29,000
Let's say because this will be a rapper on top of the vector store that we have created, the extra

353
00:19:30,000 --> 00:19:31,000
extra vector store.

354
00:19:31,000 --> 00:19:36,000
This will be my vector store itself to probably I can use it to query my vector database.

355
00:19:36,000 --> 00:19:39,000
Okay, so let me delete this.

356
00:19:39,000 --> 00:19:41,000
okay vector store index wrapper.

357
00:19:41,000 --> 00:19:52,000
Now I can use this Astra underscore vector underscore store dot add underscore documents.

358
00:19:54,000 --> 00:19:57,000
And here I'm going to basically use doc split.

359
00:19:57,000 --> 00:19:57,000
Okay.

360
00:19:58,000 --> 00:20:02,000
Then I can go ahead and print inserted

361
00:20:04,000 --> 00:20:10,000
modulus I headlines how many records I'm basically inserting.

362
00:20:10,000 --> 00:20:13,000
I'm just putting that particular information over here.

363
00:20:13,000 --> 00:20:20,000
And here I can use percentile length of the doc split.

364
00:20:21,000 --> 00:20:26,000
So this is basically how the insertion how many records has been inserted okay.

365
00:20:26,000 --> 00:20:34,000
So I'm just going to print this entire thing or inserted print inserted inserted records.

366
00:20:34,000 --> 00:20:39,000
Let me just go ahead and see whether I've done any syntax issue over here Oh yeah.

367
00:20:39,000 --> 00:20:42,000
So docs underscore split.

368
00:20:43,000 --> 00:20:44,000
Perfect, right.

369
00:20:44,000 --> 00:20:46,000
So now it is fine.

370
00:20:46,000 --> 00:20:53,000
Now I'm going to use this extra extra vector D vector index.

371
00:20:53,000 --> 00:21:00,000
And after insertion if I really want to access this I will be using this vector store index wrapper.

372
00:21:00,000 --> 00:21:02,000
And I will be using this extra vector store.

373
00:21:02,000 --> 00:21:03,000
Okay.

374
00:21:03,000 --> 00:21:05,000
So let us go ahead and execute.

375
00:21:05,000 --> 00:21:07,000
First of all it will just go ahead and insert it.

376
00:21:07,000 --> 00:21:08,000
Uh let's see.

377
00:21:08,000 --> 00:21:11,000
Vector store index wrapper from Lang cannot import the name.

378
00:21:12,000 --> 00:21:15,000
The reason is very simple here I made a spelling mistake.

379
00:21:15,000 --> 00:21:17,000
Okay, so here also I made a spelling mistake.

380
00:21:17,000 --> 00:21:19,000
It should be s capital.

381
00:21:19,000 --> 00:21:20,000
So now let's go ahead and execute this.

382
00:21:20,000 --> 00:21:24,000
This line of code is basically going to insert all the documents.

383
00:21:24,000 --> 00:21:25,000
Right.

384
00:21:25,000 --> 00:21:29,000
And then on top of this I am creating a wrapper using vector store index wrapper.

385
00:21:29,000 --> 00:21:32,000
Because of this wrapper you will be able to interact with the vector database.

386
00:21:32,000 --> 00:21:36,000
Okay so here you have this entire thing okay.

387
00:21:36,000 --> 00:21:38,000
And now let me show the next step.

388
00:21:38,000 --> 00:21:44,000
It is obviously true that you cannot just use directly vector database or this particular variable to

389
00:21:44,000 --> 00:21:45,000
access the vector database.

390
00:21:45,000 --> 00:21:49,000
Yes, you can use it, but on top of it we will try to create it as a retriever.

391
00:21:49,000 --> 00:21:56,000
So here I'm going to define my retriever is equal to Astra vector store as retriever okay.

392
00:21:56,000 --> 00:22:00,000
And then I can go ahead and ask any question that I want.

393
00:22:00,000 --> 00:22:05,000
Retriever retriever dot invoke.

394
00:22:05,000 --> 00:22:11,000
Let's say I will go ahead and ask what is agent okay.

395
00:22:12,000 --> 00:22:13,000
And let me just go ahead and execute it.

396
00:22:13,000 --> 00:22:14,000
There's an error.

397
00:22:14,000 --> 00:22:17,000
No worries okay.

398
00:22:17,000 --> 00:22:18,000
What is an agent.

399
00:22:18,000 --> 00:22:21,000
And this is my entire answer right.

400
00:22:21,000 --> 00:22:27,000
Building agents with this this this C is basically coming from the vector database itself when I probably

401
00:22:27,000 --> 00:22:28,000
use this retriever.

402
00:22:28,000 --> 00:22:28,000
Right.

403
00:22:28,000 --> 00:22:32,000
And retriever is basically created on top of vector store.

404
00:22:32,000 --> 00:22:33,000
Right.

405
00:22:33,000 --> 00:22:36,000
Which is basically referring to my vector database Perfect.

406
00:22:36,000 --> 00:22:41,000
So if I go ahead and see this part, I have actually created it, right?

407
00:22:41,000 --> 00:22:45,000
This entire part of Xtradb configuration inserting the data.

408
00:22:45,000 --> 00:22:51,000
And if you also go ahead and see over here, right over here, if I just go ahead and execute it, see,

409
00:22:51,000 --> 00:22:53,000
see the amount of data that has been put up.

410
00:22:53,000 --> 00:22:54,000
Right.

411
00:22:54,000 --> 00:22:58,000
So here is my QA mini demo default key space right.

412
00:22:58,000 --> 00:23:00,000
All the data is basically available over here.

413
00:23:00,000 --> 00:23:03,000
I'm again reloading it so that you'll be able to see this.

414
00:23:03,000 --> 00:23:06,000
If I go ahead and click this you will be able to create a collection.

415
00:23:06,000 --> 00:23:09,000
You'll be able to see this all the information over here right.

416
00:23:09,000 --> 00:23:11,000
And this is great.

417
00:23:11,000 --> 00:23:12,000
Just now you did a query.

418
00:23:12,000 --> 00:23:14,000
And these are all the information that you are able to see.

419
00:23:15,000 --> 00:23:15,000
Perfect.

420
00:23:16,000 --> 00:23:22,000
Now the next step uh, obviously if this is completed I need to create a wiki search.

421
00:23:22,000 --> 00:23:29,000
And for creating wiki search, I really need to go ahead and probably, uh, create and use an external

422
00:23:29,000 --> 00:23:30,000
tool that is called as wiki search.

423
00:23:30,000 --> 00:23:31,000
Okay.

424
00:23:31,000 --> 00:23:36,000
Now before going and creating this wiki search tool, what I'm actually going to do is that I'm going

425
00:23:36,000 --> 00:23:37,000
to define a router function.

426
00:23:37,000 --> 00:23:38,000
Okay.

427
00:23:38,000 --> 00:23:43,000
And if you are seeing my landgraaf videos, I think you should be knowing how to probably go ahead and

428
00:23:43,000 --> 00:23:44,000
create it.

429
00:23:44,000 --> 00:23:47,000
So let's start working on our land graph application.

430
00:23:47,000 --> 00:23:51,000
So here I'm going to basically write land graph application.

431
00:23:51,000 --> 00:23:58,000
And here are three important uh things we are basically going to import okay.

432
00:23:58,000 --> 00:24:05,000
One is one is from typing import literal from land underscore code or prompts.

433
00:24:05,000 --> 00:24:07,000
We are going to use chat prompt template.

434
00:24:07,000 --> 00:24:10,000
And from lang underscore core we are going to use base model and field.

435
00:24:10,000 --> 00:24:16,000
This will be important because when we are basically using or creating our root query we have to inherit

436
00:24:16,000 --> 00:24:17,000
this base model.

437
00:24:18,000 --> 00:24:22,000
So here let me just go ahead and create my data model.

438
00:24:22,000 --> 00:24:26,000
So here I'm writing grass root query base model.

439
00:24:26,000 --> 00:24:29,000
Here I've used data source as two important things.

440
00:24:29,000 --> 00:24:30,000
As a literal right.

441
00:24:30,000 --> 00:24:31,000
One is vector store, one is vector.

442
00:24:31,000 --> 00:24:32,000
See wiki search.

443
00:24:33,000 --> 00:24:39,000
Because this root query class needs to root on any one of them, whether it should go to vector store

444
00:24:39,000 --> 00:24:40,000
or wiki search.

445
00:24:40,000 --> 00:24:43,000
So given a user question, choose to root it to Wikipedia or a vector store.

446
00:24:43,000 --> 00:24:47,000
Okay, so that is the reason we are basically using this particular root query.

447
00:24:47,000 --> 00:24:49,000
So let me just go ahead and execute this.

448
00:24:49,000 --> 00:24:52,000
Because after this we are also going to create some functions.

449
00:24:52,000 --> 00:24:56,000
Now if you are familiar with already working with charts and all.

450
00:24:56,000 --> 00:25:04,000
So here what I'm actually going to do is that I will go ahead and initialize my, uh, use my grok API.

451
00:25:04,000 --> 00:25:08,000
So for grok I will just go to grok.com okay.

452
00:25:09,000 --> 00:25:12,000
Inside this grok dotcom you'll need to sign up or sign in.

453
00:25:12,000 --> 00:25:17,000
And here you can see that it provides you most of the open source model in the form of APIs.

454
00:25:17,000 --> 00:25:18,000
Right.

455
00:25:18,000 --> 00:25:20,000
You need to use the access token.

456
00:25:20,000 --> 00:25:22,000
And you should be able to use any of this.

457
00:25:22,000 --> 00:25:24,000
Even llama 3.1 is also available.

458
00:25:24,000 --> 00:25:24,000
Okay.

459
00:25:24,000 --> 00:25:27,000
So first of all I'll click on Start Building.

460
00:25:27,000 --> 00:25:30,000
I will go ahead and see my grok API.

461
00:25:30,000 --> 00:25:33,000
So I will go ahead and create my API token.

462
00:25:33,000 --> 00:25:34,000
So here you can see API keys.

463
00:25:34,000 --> 00:25:36,000
You can just go ahead and click on API key.

464
00:25:36,000 --> 00:25:39,000
Give us some name and you should be able to create it.

465
00:25:39,000 --> 00:25:42,000
And once you get the secret key you need to update this in the secret key.

466
00:25:42,000 --> 00:25:46,000
So here you can see I have already updated it in the name of grok underscore API key.

467
00:25:46,000 --> 00:25:48,000
And this is my API key right.

468
00:25:48,000 --> 00:25:56,000
So with the same name you can go ahead and call it right now from this grok I'm going to use my model.

469
00:25:56,000 --> 00:25:59,000
That is nothing but llama 3.1 70.

470
00:25:59,000 --> 00:26:01,000
Be versatile or it be instant.

471
00:26:01,000 --> 00:26:03,000
Any one of them we can specifically use.

472
00:26:03,000 --> 00:26:05,000
I will use this okay.

473
00:26:05,000 --> 00:26:07,000
And let's use this.

474
00:26:07,000 --> 00:26:12,000
So before using this first of all we need to import or get our grok API.

475
00:26:12,000 --> 00:26:19,000
So here I will go ahead and execute this um before understanding one thing that if I really want to

476
00:26:19,000 --> 00:26:25,000
access any secret keys from the Google Colab, I need to import from Google Colab, import user data,

477
00:26:25,000 --> 00:26:27,000
and then I'm using User data dot grok API.

478
00:26:27,000 --> 00:26:34,000
So if I just go ahead and print my Grok underscore API underscore key.

479
00:26:34,000 --> 00:26:37,000
You should be able to see my API key right.

480
00:26:38,000 --> 00:26:40,000
Grant access.

481
00:26:40,000 --> 00:26:42,000
And here you can see.

482
00:26:42,000 --> 00:26:47,000
Now if you go ahead and see the secret key the same API key same API key, it is basically referring

483
00:26:47,000 --> 00:26:48,000
to.

484
00:26:48,000 --> 00:26:48,000
Right.

485
00:26:48,000 --> 00:26:52,000
So here is my entire API key that you will be able to see.

486
00:26:52,000 --> 00:26:55,000
Then we will go ahead and initialize our LM model.

487
00:26:55,000 --> 00:27:00,000
So for initializing it I will write LM chat grok.

488
00:27:01,000 --> 00:27:01,000
Okay.

489
00:27:01,000 --> 00:27:05,000
And here I'm going to use grok underscore API.

490
00:27:05,000 --> 00:27:10,000
Underscore key is equal to grok underscore API underscore key.

491
00:27:10,000 --> 00:27:11,000
Okay.

492
00:27:11,000 --> 00:27:14,000
And second parameter I need to give my model underscore name.

493
00:27:14,000 --> 00:27:19,000
This model underscore name we will go ahead and initialize with llama 3.1.

494
00:27:19,000 --> 00:27:22,000
Let's see whether I should be able to copy this or not.

495
00:27:23,000 --> 00:27:25,000
Llama 3.1 70 Be.

496
00:27:25,000 --> 00:27:28,000
Let's say I'll go ahead and write over here.

497
00:27:28,000 --> 00:27:32,000
Llama 3.1.

498
00:27:33,000 --> 00:27:33,000
Okay.

499
00:27:33,000 --> 00:27:34,000
Dash.

500
00:27:34,000 --> 00:27:35,000
Dash 3.1.

501
00:27:37,000 --> 00:27:38,000
Dash 3.1.

502
00:27:38,000 --> 00:27:40,000
Dash 70.

503
00:27:40,000 --> 00:27:41,000
B 70.

504
00:27:41,000 --> 00:27:44,000
B and this is last is versatile.

505
00:27:44,000 --> 00:27:45,000
Okay.

506
00:27:45,000 --> 00:27:47,000
Please make sure that you have the name same.

507
00:27:47,000 --> 00:27:49,000
Otherwise it will not be able to call.

508
00:27:49,000 --> 00:27:50,000
Okay.

509
00:27:50,000 --> 00:27:56,000
Now if I have this what I am going to basically do is that I will just go ahead and use this LM model.

510
00:27:56,000 --> 00:27:57,000
Okay.

511
00:27:58,000 --> 00:28:01,000
We'll just go ahead and print this and see whether we are able to call it or not.

512
00:28:01,000 --> 00:28:05,000
So here you can see I'm able to call this particular model which is amazing.

513
00:28:05,000 --> 00:28:05,000
Okay.

514
00:28:05,000 --> 00:28:12,000
Now one thing that you should know is that our router you know our router this router is really important

515
00:28:12,000 --> 00:28:15,000
because based on a user query I need to give it to vector store or wiki search.

516
00:28:15,000 --> 00:28:15,000
Okay.

517
00:28:15,000 --> 00:28:20,000
So now what we are basically going to do is that we are going to integrate this route query with our

518
00:28:20,000 --> 00:28:21,000
LM model also.

519
00:28:21,000 --> 00:28:22,000
Now how do I do that.

520
00:28:22,000 --> 00:28:23,000
You know.

521
00:28:23,000 --> 00:28:28,000
So see at the end of the day whatever output that I'm actually getting, it should be in this particular

522
00:28:28,000 --> 00:28:28,000
format.

523
00:28:28,000 --> 00:28:38,000
So here I'm going to create a variable called a structured LM underscore router is equal to lm dot width

524
00:28:38,000 --> 00:28:39,000
structured.

525
00:28:39,000 --> 00:28:44,000
So there inside the LM there is something called as which structured output.

526
00:28:44,000 --> 00:28:47,000
And I'm going to use my root query over here.

527
00:28:47,000 --> 00:28:47,000
Okay.

528
00:28:47,000 --> 00:28:49,000
I'm basically going to call my root query class.

529
00:28:50,000 --> 00:28:50,000
Okay.

530
00:28:50,000 --> 00:28:52,000
Now this is fine.

531
00:28:52,000 --> 00:28:52,000
Perfect.

532
00:28:52,000 --> 00:28:58,000
Uh now let's go ahead and check whether everything will work or not with respect to our root query.

533
00:28:58,000 --> 00:28:58,000
Okay.

534
00:28:58,000 --> 00:29:00,000
Root query basically means what?

535
00:29:00,000 --> 00:29:04,000
Whenever we get any user query, it should be able to tell whether it is a wiki search or wiki vector

536
00:29:04,000 --> 00:29:05,000
DB search.

537
00:29:05,000 --> 00:29:06,000
Right.

538
00:29:06,000 --> 00:29:08,000
And for that we have also used one lm model.

539
00:29:08,000 --> 00:29:11,000
And we have used one root query inside it.

540
00:29:11,000 --> 00:29:11,000
Right.

541
00:29:11,000 --> 00:29:15,000
So first of all, what I'm actually going to do is that I'm going to use one prompt.

542
00:29:15,000 --> 00:29:15,000
Okay.

543
00:29:15,000 --> 00:29:17,000
So let's say this is my prompt.

544
00:29:17,000 --> 00:29:19,000
In this prompt I'm writing.

545
00:29:19,000 --> 00:29:23,000
Hey you are an expert at routing a user question to vector Store or Wikipedia.

546
00:29:23,000 --> 00:29:27,000
The vector store contains document related to agents, prompt engineering, and adversarial attacks.

547
00:29:27,000 --> 00:29:30,000
Use the vector store for the question on this topic.

548
00:29:30,000 --> 00:29:31,000
Otherwise, use wiki search.

549
00:29:31,000 --> 00:29:34,000
Okay, so that is what we have written over here.

550
00:29:34,000 --> 00:29:34,000
Okay.

551
00:29:34,000 --> 00:29:37,000
And that is the reason we have used this chat prompt template from message.

552
00:29:37,000 --> 00:29:41,000
We have used system system because this is the instruction that I need to give to my LM model.

553
00:29:41,000 --> 00:29:47,000
And here we are giving the question as with respect to whatever human question is basically given,

554
00:29:47,000 --> 00:29:52,000
then we will go ahead and create a variable which is called as question router.

555
00:29:52,000 --> 00:29:57,000
Here I'm going to use the same root prompt and structured LM router, because this entire task will

556
00:29:57,000 --> 00:29:59,000
be done by an LM model itself.

557
00:29:59,000 --> 00:30:00,000
Right.

558
00:30:00,000 --> 00:30:10,000
So once I execute this this is done right now I will go ahead and write print question underscore router

559
00:30:12,000 --> 00:30:18,000
dot invoke okay dot invoke question underscore router dot invoke.

560
00:30:18,000 --> 00:30:19,000
Let's let's test it.

561
00:30:19,000 --> 00:30:20,000
Okay.

562
00:30:20,000 --> 00:30:24,000
So I will just go ahead and write a question.

563
00:30:24,000 --> 00:30:27,000
Let's say the question is what is an agent.

564
00:30:27,000 --> 00:30:29,000
So if I'm writing, what is an agent?

565
00:30:29,000 --> 00:30:36,000
Obviously my answer should be it should route it to what vector store, because my vector store has

566
00:30:36,000 --> 00:30:38,000
already all this particular information.

567
00:30:38,000 --> 00:30:41,000
But what if I write a question which looks like this?

568
00:30:42,000 --> 00:30:43,000
Who is Shah Rukh Khan?

569
00:30:43,000 --> 00:30:45,000
Shah Rukh Khan is a famous actor in India, right?

570
00:30:45,000 --> 00:30:49,000
So if I go ahead and execute it, you'll be able to see that it is going to Wikipedia search, because

571
00:30:49,000 --> 00:30:52,000
that kind of information is even not present in vector store.

572
00:30:52,000 --> 00:30:57,000
So I don't need to probably push this particular query to my vector store itself.

573
00:30:57,000 --> 00:30:59,000
It should probably go to the wiki search.

574
00:30:59,000 --> 00:31:03,000
So this part of vector store I have already created, right?

575
00:31:03,000 --> 00:31:05,000
I've created a retriever.

576
00:31:05,000 --> 00:31:09,000
Now what is pending is basically for this Wikipedia search right now.

577
00:31:09,000 --> 00:31:11,000
How do I probably go ahead and create this Wikipedia search.

578
00:31:11,000 --> 00:31:16,000
So again in long chain you have this third party tool in Wikipedia.

579
00:31:16,000 --> 00:31:19,000
And for that we need to install this right.

580
00:31:19,000 --> 00:31:21,000
We, we have something like arXiv or Wikipedia.

581
00:31:21,000 --> 00:31:27,000
But I'll just go ahead and install Wikipedia and I'll also install wiki lang underscore community okay.

582
00:31:27,000 --> 00:31:29,000
so here you can see it is already been satisfied.

583
00:31:29,000 --> 00:31:34,000
So it is getting downloaded okay so let's go community.

584
00:31:34,000 --> 00:31:35,000
We have already installed it I guess.

585
00:31:35,000 --> 00:31:36,000
No worries.

586
00:31:36,000 --> 00:31:39,000
Okay now for Wikipedia.

587
00:31:39,000 --> 00:31:46,000
I will probably go ahead and import because here we are working with external tools right lang underscore

588
00:31:46,000 --> 00:31:47,000
community dot utilities.

589
00:31:47,000 --> 00:31:52,000
I'm going to import Wikipedia rapper Wikipedia API wrapper.

590
00:31:52,000 --> 00:32:05,000
Now along with this I'm also going to import from lang chain underscore community dot tools import Wikipedia

591
00:32:06,000 --> 00:32:06,000
query.

592
00:32:06,000 --> 00:32:07,000
Done right.

593
00:32:07,000 --> 00:32:09,000
We're going to import both this.

594
00:32:09,000 --> 00:32:12,000
Now first of all I will go ahead and create my API wrapper.

595
00:32:13,000 --> 00:32:19,000
And this entire thing will basically be responsible in probably running my entire queries.

596
00:32:19,000 --> 00:32:19,000
Right.

597
00:32:19,000 --> 00:32:24,000
So whenever I give a query when it is going to the Wikipedia search, this API wrapper will make sure

598
00:32:24,000 --> 00:32:28,000
that it will do that And here I will just go ahead and define my variable wiki.

599
00:32:28,000 --> 00:32:29,000
Okay.

600
00:32:29,000 --> 00:32:32,000
Inside this I can also go ahead and write my how many results I want.

601
00:32:32,000 --> 00:32:39,000
Let's say if I go ahead and write top k results is equal to one and the max to max document content

602
00:32:39,000 --> 00:32:42,000
character Max, I say that hey, I need 200 characters, okay?

603
00:32:43,000 --> 00:32:45,000
And then I will be able to use this Wikipedia.

604
00:32:45,000 --> 00:32:51,000
So once I execute this, you will be able to see that if I go ahead and ask any question.

605
00:32:51,000 --> 00:32:52,000
Wiki dot.

606
00:32:52,000 --> 00:32:56,000
If I go ahead and write wiki dot run.

607
00:32:57,000 --> 00:32:58,000
Okay.

608
00:32:58,000 --> 00:33:00,000
And let's say if I go ahead and write.

609
00:33:02,000 --> 00:33:09,000
Tell me tell me about Shahrukh Khan.

610
00:33:10,000 --> 00:33:15,000
Okay, so I should be able to get all the response from the Wikipedia itself, right?

611
00:33:15,000 --> 00:33:18,000
So all the information is in Indian actor, film producer who works in Indian cinema.

612
00:33:18,000 --> 00:33:19,000
So 200 characters.

613
00:33:19,000 --> 00:33:20,000
You will be able to see this.

614
00:33:20,000 --> 00:33:25,000
So this in short is basically querying the Wikipedia itself.

615
00:33:25,000 --> 00:33:30,000
Right now my turn is basically to create a graph.

616
00:33:30,000 --> 00:33:31,000
Right.

617
00:33:31,000 --> 00:33:34,000
So we will go ahead and create graph.

618
00:33:34,000 --> 00:33:37,000
Or we'll go ahead and create AI agents.

619
00:33:37,000 --> 00:33:41,000
A AI agent application using line graph.

620
00:33:42,000 --> 00:33:47,000
Because if you understand from our architecture we have also developed this.

621
00:33:47,000 --> 00:33:48,000
We have developed this.

622
00:33:48,000 --> 00:33:49,000
We have also developed router.

623
00:33:49,000 --> 00:33:52,000
Now it's like we need to connect this in the form of graph right.

624
00:33:52,000 --> 00:33:54,000
Like how this graph is entirely there.

625
00:33:54,000 --> 00:33:56,000
So let's go ahead and do that.

626
00:33:56,000 --> 00:33:58,000
So agents application using line graph.

627
00:33:58,000 --> 00:34:02,000
So first of all I will go ahead and create one class.

628
00:34:02,000 --> 00:34:04,000
Let me just go ahead and create one class.

629
00:34:04,000 --> 00:34:09,000
So here I have from typing import list typing extension import Typekit.

630
00:34:09,000 --> 00:34:14,000
So I'm going to create a graph state which will be my class which is inheriting type dictionary.

631
00:34:14,000 --> 00:34:18,000
And this will be in the form of key value pairs like question is equal to STR generation is equal to

632
00:34:18,000 --> 00:34:21,000
x, str and documents list of str okay.

633
00:34:21,000 --> 00:34:23,000
So I'm basically creating three variables.

634
00:34:23,000 --> 00:34:28,000
This three variables will be responsible in managing the entire state of the AI agents that I've actually

635
00:34:28,000 --> 00:34:29,000
created.

636
00:34:29,000 --> 00:34:31,000
So it represents the state of a graph.

637
00:34:31,000 --> 00:34:32,000
Attributes are this many things.

638
00:34:32,000 --> 00:34:32,000
Okay.

639
00:34:32,000 --> 00:34:35,000
So for right now just keep a note of that.

640
00:34:35,000 --> 00:34:36,000
Okay.

641
00:34:36,000 --> 00:34:38,000
You'll be able to understand once we start this.

642
00:34:38,000 --> 00:34:39,000
Okay.

643
00:34:39,000 --> 00:34:42,000
Now let's do one thing.

644
00:34:42,000 --> 00:34:48,000
Whenever let's say whenever I ask or whenever a query is basically coming, whenever we give that query

645
00:34:48,000 --> 00:34:53,000
to the vector database, then for that particular vector database, what we really need to do is that

646
00:34:53,000 --> 00:34:55,000
we need to probably retrieve from the vector database.

647
00:34:55,000 --> 00:34:57,000
And we need to give the response okay.

648
00:34:57,000 --> 00:35:02,000
Whenever we get a response that will basically be stored in this documents, okay.

649
00:35:02,000 --> 00:35:07,000
In this document variable and whatever question user is basically asking it will get stored over here.

650
00:35:07,000 --> 00:35:08,000
Right.

651
00:35:08,000 --> 00:35:14,000
So here I'm going to probably go ahead and create from line chain I'm going to import dot schema.

652
00:35:16,000 --> 00:35:20,000
So dot schema I'm going to import something called as document.

653
00:35:20,000 --> 00:35:21,000
Okay.

654
00:35:21,000 --> 00:35:25,000
Then I will write Definition retrieve.

655
00:35:26,000 --> 00:35:27,000
Definition, retrieve.

656
00:35:27,000 --> 00:35:30,000
Let's say I'm going to take some state over here.

657
00:35:30,000 --> 00:35:35,000
So this state that we have defined it will be a type of this graph state which will have this three

658
00:35:35,000 --> 00:35:35,000
information.

659
00:35:35,000 --> 00:35:36,000
Okay.

660
00:35:36,000 --> 00:35:40,000
And when we are calling this retrieve we are just going to give that particular parameter.

661
00:35:40,000 --> 00:35:46,000
So here what we are basically going to do I will just write down some of the comments so that you'll

662
00:35:46,000 --> 00:35:48,000
be able to understand what is happening inside this function.

663
00:35:48,000 --> 00:35:53,000
So here you can see State dictionary the current graph state and returns a state dictionary itself.

664
00:35:53,000 --> 00:36:03,000
Okay so here what I'm actually going to write I'll write print print retrieve.

665
00:36:06,000 --> 00:36:08,000
Retrieve.

666
00:36:08,000 --> 00:36:10,000
Dash dash dash.

667
00:36:10,000 --> 00:36:12,000
Okay I'm just going to write this print.

668
00:36:12,000 --> 00:36:17,000
And then let me quickly go ahead and write my question.

669
00:36:18,000 --> 00:36:25,000
Question is equal to obviously the question of state which should be coming from this, because the

670
00:36:25,000 --> 00:36:28,000
state, which is a type of graph state, will be keeping in a node of the question.

671
00:36:28,000 --> 00:36:30,000
So we are going to probably consider the state over here.

672
00:36:30,000 --> 00:36:33,000
And then we are going to go to the next line.

673
00:36:33,000 --> 00:36:38,000
Uh, here we are specifically going to do the retrieval or for doing the retrieval I will go ahead and

674
00:36:38,000 --> 00:36:45,000
write documents is equal to retriever dot invoke.

675
00:36:45,000 --> 00:36:49,000
And here I'm going to use the question okay.

676
00:36:49,000 --> 00:36:51,000
Now let me just go ahead and return.

677
00:36:53,000 --> 00:36:54,000
Return.

678
00:36:57,000 --> 00:37:07,000
The documents colon documents whatever documents we are going to specifically get comma.

679
00:37:08,000 --> 00:37:12,000
So this should be my question over here okay.

680
00:37:13,000 --> 00:37:13,000
Oops.

681
00:37:14,000 --> 00:37:15,000
Questions okay.

682
00:37:15,000 --> 00:37:21,000
And the second parameter that I'm going to retrieve is basically my question which will be equal to

683
00:37:21,000 --> 00:37:23,000
this particular questions.

684
00:37:23,000 --> 00:37:25,000
So this is what we are specifically returning.

685
00:37:25,000 --> 00:37:26,000
Okay.

686
00:37:26,000 --> 00:37:28,000
And just through this you will be able to see this.

687
00:37:28,000 --> 00:37:29,000
Okay.

688
00:37:29,000 --> 00:37:34,000
So overall I hope you are able to understand what we are basically doing with this retrieve.

689
00:37:34,000 --> 00:37:39,000
Retrieve basically means we are just going to query it from the retriever, and we are going to just

690
00:37:39,000 --> 00:37:39,000
display it.

691
00:37:39,000 --> 00:37:40,000
Okay.

692
00:37:40,000 --> 00:37:46,000
So I hope everybody was able to understand okay there was some indentation issues.

693
00:37:46,000 --> 00:37:47,000
No worries.

694
00:37:47,000 --> 00:37:50,000
I will just use this.

695
00:37:50,000 --> 00:37:50,000
Let's see.

696
00:37:50,000 --> 00:37:52,000
It should be fixed.

697
00:37:52,000 --> 00:37:52,000
Okay.

698
00:37:52,000 --> 00:37:53,000
Perfect.

699
00:37:53,000 --> 00:37:55,000
So now it gets executed.

700
00:37:55,000 --> 00:37:58,000
So retrieve function is basically done.

701
00:37:58,000 --> 00:38:01,000
Now similarly I will go ahead and do it for the Wikipedia search.

702
00:38:01,000 --> 00:38:04,000
So for that I can just copy and do this.

703
00:38:04,000 --> 00:38:08,000
So for Wikipedia search there will be a functionality where I take the same state.

704
00:38:08,000 --> 00:38:11,000
I will write print Wikipedia over here.

705
00:38:11,000 --> 00:38:11,000
No need to print.

706
00:38:12,000 --> 00:38:12,000
Hello.

707
00:38:12,000 --> 00:38:13,000
I'll take the question.

708
00:38:13,000 --> 00:38:14,000
I'll print the question over here.

709
00:38:14,000 --> 00:38:20,000
Then we'll go ahead and write wiki dot invoke query of question and then whatever docs I'm actually

710
00:38:20,000 --> 00:38:21,000
getting that is my wiki results.

711
00:38:21,000 --> 00:38:27,000
I'll convert that into a document and I hope I have imported the document also.

712
00:38:27,000 --> 00:38:30,000
So this should be imported now, right?

713
00:38:30,000 --> 00:38:31,000
And now this.

714
00:38:31,000 --> 00:38:35,000
Finally, I'm probably doing the Wikipedia search and converting it to a document and returning back

715
00:38:35,000 --> 00:38:36,000
all the results.

716
00:38:36,000 --> 00:38:36,000
Okay.

717
00:38:36,000 --> 00:38:38,000
So perfect.

718
00:38:38,000 --> 00:38:39,000
Uh, so what?

719
00:38:39,000 --> 00:38:42,000
All things have been implemented, we have implemented this functionality.

720
00:38:42,000 --> 00:38:46,000
We have implemented this functionality, we have implemented this functionality, even the LLM part

721
00:38:46,000 --> 00:38:49,000
also we have implemented along with the prompt engineering.

722
00:38:49,000 --> 00:38:51,000
So in short why do we say multi agents.

723
00:38:51,000 --> 00:38:53,000
Because here they are multi agents.

724
00:38:53,000 --> 00:38:54,000
One is communicating with the astrolabe.

725
00:38:55,000 --> 00:38:56,000
One is retrieving the result.

726
00:38:56,000 --> 00:38:56,000
From there.

727
00:38:56,000 --> 00:39:00,000
One is doing the Wikipedia search and all of them are interacting with each other.

728
00:39:00,000 --> 00:39:06,000
So finally uh now it's time that we go ahead and probably do all these things.

729
00:39:06,000 --> 00:39:13,000
But one thing, uh, that we missed out, right, uh, over here is with respect to the routing functionality,

730
00:39:13,000 --> 00:39:17,000
because that routing functionality needs to be also defined as a function.

731
00:39:17,000 --> 00:39:17,000
Right?

732
00:39:17,000 --> 00:39:21,000
So here I will just go ahead and define this.

733
00:39:21,000 --> 00:39:22,000
Let's go ahead and do this.

734
00:39:22,000 --> 00:39:24,000
And I think you should be able to get this.

735
00:39:24,000 --> 00:39:28,000
I'll be getting state of question I'll say question router dot invoke this one okay.

736
00:39:28,000 --> 00:39:31,000
And where do you get the question router.

737
00:39:31,000 --> 00:39:31,000
So question router.

738
00:39:31,000 --> 00:39:33,000
We have already created it earlier right.

739
00:39:33,000 --> 00:39:37,000
If you remember we have created over here question router.

740
00:39:37,000 --> 00:39:39,000
So we are going to use that question router over here.

741
00:39:39,000 --> 00:39:43,000
And here only you will be able to see that we are just writing this particular question.

742
00:39:43,000 --> 00:39:48,000
And I'm saying if source dot data source is wiki search then we return wiki search.

743
00:39:48,000 --> 00:39:49,000
Otherwise it is a vector store.

744
00:39:49,000 --> 00:39:50,000
We return vector store.

745
00:39:51,000 --> 00:39:55,000
So all the functionalities, the chunk of functionalities of all the nodes has been created.

746
00:39:56,000 --> 00:40:03,000
Okay, now it's time that we start creating our entire land graph flow, right?

747
00:40:03,000 --> 00:40:14,000
So I'll write from land graph dot graph import and then you have this state graph.

748
00:40:16,000 --> 00:40:18,000
Then you have this the start.

749
00:40:18,000 --> 00:40:18,000
Okay.

750
00:40:19,000 --> 00:40:22,000
Start now.

751
00:40:22,000 --> 00:40:24,000
The first thing is that I will start my workflow.

752
00:40:24,000 --> 00:40:25,000
I will go ahead and write.

753
00:40:25,000 --> 00:40:28,000
Workflow is equal to state graph.

754
00:40:29,000 --> 00:40:32,000
And here I'm going to use my graph state.

755
00:40:32,000 --> 00:40:35,000
Whatever graph state I've actually defined that is my default class okay.

756
00:40:36,000 --> 00:40:39,000
Then we will go ahead and define the nodes.

757
00:40:39,000 --> 00:40:41,000
What are nodes you have over here.

758
00:40:41,000 --> 00:40:43,000
Main important nodes.

759
00:40:43,000 --> 00:40:45,000
One is the wiki search node and one is the vector db.

760
00:40:45,000 --> 00:40:54,000
Now in order to create the nodes in a line graph, I will just go ahead and write this one workflow

761
00:40:54,000 --> 00:40:57,000
dot add node wiki search.

762
00:40:57,000 --> 00:41:00,000
Then you have this retrieve function.

763
00:41:00,000 --> 00:41:04,000
What is the function name you can see over here retrieve.

764
00:41:04,000 --> 00:41:04,000
Okay.

765
00:41:05,000 --> 00:41:09,000
So I will just go ahead and write this name because the spelling is wrong over there.

766
00:41:09,000 --> 00:41:12,000
So I will go ahead and define this.

767
00:41:12,000 --> 00:41:12,000
Okay.

768
00:41:12,000 --> 00:41:13,000
No worries.

769
00:41:13,000 --> 00:41:17,000
So here uh, one node name is wiki search.

770
00:41:17,000 --> 00:41:19,000
The functionality is this.

771
00:41:19,000 --> 00:41:20,000
Then I have add node.

772
00:41:20,000 --> 00:41:22,000
I'm adding retrieve which is the functionality.

773
00:41:22,000 --> 00:41:23,000
Is this okay?

774
00:41:23,000 --> 00:41:26,000
This is basically do the web search, that is Wikipedia search.

775
00:41:26,000 --> 00:41:28,000
And the other one is basically to do the vector search.

776
00:41:28,000 --> 00:41:29,000
Okay.

777
00:41:29,000 --> 00:41:31,000
Now I'm going to build the entire graph.

778
00:41:31,000 --> 00:41:32,000
This is amazing.

779
00:41:32,000 --> 00:41:33,000
This is just amazing.

780
00:41:33,000 --> 00:41:34,000
Okay.

781
00:41:34,000 --> 00:41:38,000
Workflow dot add conditional logic.

782
00:41:38,000 --> 00:41:43,000
So here I'm also going to go ahead and add conditional logics because this conditional logics will be

783
00:41:43,000 --> 00:41:44,000
really important.

784
00:41:44,000 --> 00:41:44,000
So sorry.

785
00:41:45,000 --> 00:41:47,000
Add conditional edges okay.

786
00:41:47,000 --> 00:41:48,000
Should not be logic.

787
00:41:48,000 --> 00:41:51,000
So first of all we start with start.

788
00:41:51,000 --> 00:41:54,000
Then we go with our root question right.

789
00:41:54,000 --> 00:41:57,000
So here I'll just go ahead and define my root question.

790
00:41:57,000 --> 00:42:01,000
And you know in root question what is basically going to happen.

791
00:42:01,000 --> 00:42:03,000
It is going to go in this two terms right.

792
00:42:03,000 --> 00:42:12,000
One is one is wiki search wiki search colon.

793
00:42:12,000 --> 00:42:16,000
And then I have this wiki underscore search.

794
00:42:16,000 --> 00:42:16,000
Okay.

795
00:42:17,000 --> 00:42:19,000
And the second one is nothing but vector store.

796
00:42:19,000 --> 00:42:23,000
The vector store will go to my which node.

797
00:42:24,000 --> 00:42:27,000
See this is this will basically go to this particular node.

798
00:42:27,000 --> 00:42:28,000
This node is defined over here.

799
00:42:28,000 --> 00:42:31,000
Vector store should go to my retrieve node.

800
00:42:31,000 --> 00:42:34,000
So here I'm going to basically go ahead and define my retrieve node.

801
00:42:35,000 --> 00:42:36,000
Done.

802
00:42:36,000 --> 00:42:37,000
Now this is my root question.

803
00:42:37,000 --> 00:42:38,000
Okay.

804
00:42:38,000 --> 00:42:40,000
So start we have started it over here.

805
00:42:40,000 --> 00:42:46,000
We have put a conditional edges saying that when we are routing whenever this function is written it

806
00:42:46,000 --> 00:42:50,000
should either go to wiki search that is this or this particular node that is retrieve.

807
00:42:50,000 --> 00:42:51,000
Okay.

808
00:42:51,000 --> 00:43:01,000
Then after completing this, what is the next step is that we go ahead and add workflow dot add underscore.

809
00:43:01,000 --> 00:43:03,000
Edge is nothing from from retrieve.

810
00:43:03,000 --> 00:43:04,000
Where do we go after?

811
00:43:04,000 --> 00:43:12,000
Probably if we complete this retrieve where do we go see over here after we do the retrieve.

812
00:43:12,000 --> 00:43:13,000
Retrieve is basically done.

813
00:43:13,000 --> 00:43:15,000
From here we go to our end stage.

814
00:43:15,000 --> 00:43:15,000
Right?

815
00:43:16,000 --> 00:43:17,000
So end stage will go ahead and connect it.

816
00:43:17,000 --> 00:43:20,000
So here I'm going to basically connect my end stage.

817
00:43:20,000 --> 00:43:27,000
And then I will also go ahead and write workflow dot add wiki search should also be going to the end

818
00:43:27,000 --> 00:43:29,000
stage right now.

819
00:43:29,000 --> 00:43:31,000
Finally we do compile this entire graph.

820
00:43:31,000 --> 00:43:39,000
So I will write app is equal to workflow dot compile okay.

821
00:43:39,000 --> 00:43:42,000
And now this entire compile will happen.

822
00:43:42,000 --> 00:43:43,000
Root question is there.

823
00:43:43,000 --> 00:43:46,000
Let's see okay I have to give comma over here.

824
00:43:46,000 --> 00:43:47,000
Then all it will work okay.

825
00:43:48,000 --> 00:43:50,000
So let me just go ahead and execute this.

826
00:43:50,000 --> 00:43:53,000
So root question here two options I have given them.

827
00:43:53,000 --> 00:43:56,000
Then over here that I have this entire workflow.

828
00:43:56,000 --> 00:43:58,000
And all the compilation is specifically happening.

829
00:43:58,000 --> 00:44:05,000
Now in order to just display this entire graph, I can just use this image and display from IPython

830
00:44:05,000 --> 00:44:05,000
display.

831
00:44:05,000 --> 00:44:06,000
Right.

832
00:44:06,000 --> 00:44:11,000
And this is what is the function app dot get graph dot draw mermaid png.

833
00:44:11,000 --> 00:44:13,000
So this I probably show from the documentation.

834
00:44:13,000 --> 00:44:17,000
So here you can see C start vector store retrieve.

835
00:44:17,000 --> 00:44:18,000
Otherwise Wikipedia.

836
00:44:18,000 --> 00:44:20,000
And in between there is something called as router.

837
00:44:20,000 --> 00:44:24,000
Also that router is not getting displayed but the entire flow will happen in that way.

838
00:44:24,000 --> 00:44:25,000
Okay.

839
00:44:25,000 --> 00:44:30,000
Now in order to execute and see how things are basically happening, you can actually check this out,

840
00:44:31,000 --> 00:44:31,000
okay.

841
00:44:31,000 --> 00:44:34,000
And you will be definitely able to see this okay.

842
00:44:35,000 --> 00:44:38,000
So I will just go ahead and print one of the code.

843
00:44:38,000 --> 00:44:44,000
So here you can see what is agent I'm asking the input I can add multiple inputs if I want.

844
00:44:44,000 --> 00:44:46,000
So I'll say for output in app dot stream input.

845
00:44:46,000 --> 00:44:48,000
So key value output items I'm printing the key.

846
00:44:48,000 --> 00:44:54,000
And then we are printing the document of zero dot dictionary dot metadata dot description.

847
00:44:54,000 --> 00:44:56,000
It should be able to get the answer.

848
00:44:56,000 --> 00:45:01,000
So once I execute this here you can see building agents with LM as it is control.

849
00:45:01,000 --> 00:45:06,000
So when I ask this question this is saying hey route the question to rag that is retrieve.

850
00:45:07,000 --> 00:45:09,000
This is the what is I have printed it out there.

851
00:45:09,000 --> 00:45:10,000
Right.

852
00:45:10,000 --> 00:45:13,000
And finally I am able to call this node retrieve function.

853
00:45:13,000 --> 00:45:15,000
And finally I'm getting the output.

854
00:45:15,000 --> 00:45:21,000
Similarly, if I go ahead and ask some other question, let's say I ask a basic questions like Avengers

855
00:45:21,000 --> 00:45:21,000
or something.

856
00:45:21,000 --> 00:45:23,000
Some movies right here.

857
00:45:23,000 --> 00:45:28,000
My question is Avengers, and if I just go ahead and print the same documents you should be able to

858
00:45:28,000 --> 00:45:31,000
see now it is routing to Wikipedia search.

859
00:45:31,000 --> 00:45:32,000
Right?

860
00:45:32,000 --> 00:45:36,000
So this was about this amazing end to end Rag application.

861
00:45:36,000 --> 00:45:43,000
Land graph applications are basically a multi agents where we have added conditional edges.

862
00:45:43,000 --> 00:45:47,000
We have seen how each and every node functionalities will be created and many more things.

863
00:45:47,000 --> 00:45:50,000
So I hope you like this particular video.

864
00:45:50,000 --> 00:45:52,000
Definitely go ahead and check it out.

865
00:45:52,000 --> 00:45:54,000
With respect to astrolabe, because this was quite amazing.

866
00:45:54,000 --> 00:45:57,000
Because of this we are able to do this also.

867
00:45:57,000 --> 00:46:02,000
And the vector database search that we are able to do with the help of retriever.

868
00:46:02,000 --> 00:46:03,000
It was possible.

869
00:46:03,000 --> 00:46:07,000
And again here we have used grok and the entire application has been basically created.

870
00:46:07,000 --> 00:46:07,000
Right.

871
00:46:07,000 --> 00:46:09,000
So this was it from my side.

872
00:46:09,000 --> 00:46:10,000
I hope you like this particular video.

873
00:46:10,000 --> 00:46:11,000
I will see you in the next video.

874
00:46:11,000 --> 00:46:12,000
Thank you.

875
00:46:12,000 --> 00:46:12,000
Take care.

