YouTube2Text

Loop Engineering And Harness Engineering Crash Course — Transcript

by Krish Naik · 34,113 words · 5,157 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Hello all, my name is Krishna and
  2. 0:02welcome to my YouTube channel. So guys,
  3. 0:03today in this particular video we are
  4. 0:05going to have this amazing crash course
  5. 0:07wherein we are going to discuss about
  6. 0:10two key terminologies which is called as
  7. 0:12loop engineering and harness
  8. 0:14engineering. Here uh in this specific
  9. 0:16video we are just not going to
  10. 0:18understand what is the meaning of loop
  11. 0:20engineering or harness engineering.
  12. 0:22We're also going to go ahead and
  13. 0:23implement two amazing end to-end
  14. 0:25projects wherein you will be able to
  15. 0:27understand so many things. Make sure to
  16. 0:29watch this video till the end. Uh Bappy,
  17. 0:32one of our instructor uh in Krishna
  18. 0:34Academy, he's going to probably take
  19. 0:36this entire crash course. Right. So
  20. 0:38again, this video will be for somewhere
  21. 0:40around 3 and a half hours. Uh we have
  22. 0:42made sure that we have uh taught each
  23. 0:44and everything step by step. So please
  24. 0:46go ahead and enjoy this specific crash
  25. 0:48course. Thank you.
  26. 0:49>> Uh the topic name is loop engineering in
  27. 0:52agentic. Okay. So here I'm not only
  28. 0:56going to discuss about the theoretical
  29. 0:58concept of loop engineering. Apart from
  30. 1:01that I'm also going to show you the
  31. 1:03practical demo of that. We'll try to
  32. 1:04build uh self-correcting multi-agent
  33. 1:07system. Uh so that you can understand
  34. 1:10how loop engineering works. Okay.
  35. 1:12Internally each and everything. Right.
  36. 1:14Three kinds of uh three types of
  37. 1:16application we usually develop inside
  38. 1:19generative AI. The first type is the
  39. 1:22prompting approach.
  40. 1:27Okay, prompting
  41. 1:29approach. Since prompting actually what
  42. 1:32we do, let's say here we have a large
  43. 1:35language model.
  44. 1:40This is our large language model. And
  45. 1:43here we give a prompt. Okay. and it
  46. 1:48returns a response
  47. 1:51or output whatever you can say right. So
  48. 1:54we call it as LM inference. Okay. And
  49. 1:57here LM wise we can use anything. We can
  50. 1:59use GPT,
  51. 2:01we can use LMA,
  52. 2:04we can use Gemini.
  53. 2:06Okay. We can use um any kinds of LM.
  54. 2:10Okay. We can use uh let's say ML.
  55. 2:14Okay. Anything you can use. I think you
  56. 2:16know there are thousands of thousands
  57. 2:18large language models are available
  58. 2:19nowadays over the internet. We can use
  59. 2:21any kinds of large language model here.
  60. 2:23Okay. So if you have seen uh the first
  61. 2:28uh first let's say prototype of the
  62. 2:29application whenever it came in the
  63. 2:32market especially whenever generative
  64. 2:34came in the market right so the first
  65. 2:36application got introduced something
  66. 2:38called charge GPT right so who already
  67. 2:42used charge GPT at the very beginning I
  68. 2:44think you know that we used to pass a
  69. 2:46prompt okay in the chart GPT and charg
  70. 2:48used to uh return you some kinds of
  71. 2:50response let's say you are giving just
  72. 2:52tell me about Python. Let's say this is
  73. 2:54this is your prompt. You are asking tell
  74. 2:56me about Python. So this prompt will go
  75. 2:58to the LM. Now LLM has the knowledge
  76. 3:02cutoff. Knowledge cut off means it has
  77. 3:03the knowledge base. That means large
  78. 3:06language model has trained with huge
  79. 3:08amount of internet data. So this Python
  80. 3:12information definitely it's available
  81. 3:14over the internet, right? So that that
  82. 3:16time um let's say uh they train this
  83. 3:18model. So also Python information was
  84. 3:20available inside the model. So it will
  85. 3:22try to utilize that particular knowledge
  86. 3:24base and it will give you the response.
  87. 3:25Okay, this is the Python. This Python is
  88. 3:28a programming language. Okay, now we can
  89. 3:30use this Python blah blah blah. Okay,
  90. 3:31this kinds of response you will be
  91. 3:32getting. So that means if you are asking
  92. 3:35anything to the large language model if
  93. 3:37this particular knowledge sources is
  94. 3:40available in the large language model
  95. 3:43that time it will be able to give you
  96. 3:45the response. Okay. Otherwise, it will
  97. 3:47directly tell you I don't have the
  98. 3:49informations about the questions you are
  99. 3:51asking. Okay. I can't help you with
  100. 3:54that. So, how many of you have let's say
  101. 3:58faced this kinds of uh let's say
  102. 4:00problem? Anyone here? So, if you have
  103. 4:03already used any kinds of large language
  104. 4:05model, I'm not telling you any kinds of
  105. 4:08application, any kind of way of AI agent
  106. 4:11application. I'm talking about only
  107. 4:12simple large language model application.
  108. 4:14So if you are asking anything so let's
  109. 4:16say if I'm sure
  110. 4:17>> so guys before we go ahead I would like
  111. 4:18to thank the sponsor of this specific
  112. 4:20video uh appex uh um I will be
  113. 4:24explaining you how appetics can be
  114. 4:25actually used and a huge shout out for
  115. 4:27them
  116. 4:29here's the thing about deep research
  117. 4:31with AI after a few hundred steps the
  118. 4:34context window conest lines of inquiry
  119. 4:36collide and the agent is basically
  120. 4:39proofreading its own blind spots the
  121. 4:42real problem is the model reflecting on
  122. 4:44its own draft has the exact same blind
  123. 4:47spots that made the error in the first
  124. 4:49place and that's what leads to pseudo
  125. 4:52correctness reports that look
  126. 4:54professionalized but may stay factually
  127. 4:56wrong. So today we have Apex the
  128. 4:58self-evolving heavyduty solver to
  129. 5:01research solve and discover at the
  130. 5:02frontier requires more than the model
  131. 5:04capacity. It requires rigorous reasoning
  132. 5:07each step verified. So, ApoDex is an AI
  133. 5:10system designed for complex and
  134. 5:12demanding research tasks. There are
  135. 5:14three levels of depth which is provided
  136. 5:16by Apoex. The deep research which is
  137. 5:19fast source grounded research across the
  138. 5:22full depth of available knowledge. And
  139. 5:24then we have the deep solve resolve what
  140. 5:27matters. And finally, we have the
  141. 5:30toughest one which is the deep discover
  142. 5:33which generate what is new. the highest
  143. 5:36rigger heavyduty solver for the hardest
  144. 5:38questions at the frontier of human
  145. 5:40knowledge. So, Apoex fixes this at the
  146. 5:43architecture level. It's a heavyduty
  147. 5:45solver up to 150 specialized sub aents
  148. 5:48working as synchronously with
  149. 5:50independent verification agents that did
  150. 5:52not do the reasoning. Deep discover hits
  151. 5:55the browse comp with 90.3 and Frontier
  152. 5:57Science Olympiad with 87.4.
  153. 6:01The open models punch way above their
  154. 6:03weight. Apedex deep research the 35
  155. 6:06billion model is topping future X right
  156. 6:10now and the small series at 0.8 8
  157. 6:13billion, 2 billion and 4 billion are the
  158. 6:16compact models trained on deep research
  159. 6:18SFT data alone. The 4 billion beats
  160. 6:21every open-source 30 billion class model
  161. 6:24which are all freely available on
  162. 6:26hugging face. Now let's try ApoDex. So
  163. 6:30here we are predicting whether Nvidia
  164. 6:32will maintain more than 70% of the AIGPU
  165. 6:35market share. Okay. And here you can see
  166. 6:37we have the three different options. the
  167. 6:39deep research, the deep solve and the
  168. 6:43deep discover. So we'll be right now
  169. 6:45exploring the most capable one which is
  170. 6:47deep discover.
  171. 6:50And as you can see that multiple agents
  172. 6:52are right now being dispatched. So it's
  173. 6:54right now in the research phase with
  174. 6:56multiple runs.
  175. 6:58Now as you can see here multiple agents
  176. 7:00have done their research. The Nvidia
  177. 7:02current share research then the AMD AI
  178. 7:05GPU research, the Intel AI accelerator
  179. 7:08research. So really the first step is
  180. 7:10researching and multiple agents are
  181. 7:12right now working
  182. 7:20and finally we can see that deep
  183. 7:23discover has completed.
  184. 7:25The reasoning has completed. It took
  185. 7:27around 35 minutes. Total 432
  186. 7:32claims have been verified with 961
  187. 7:35evidence. You can get the entire
  188. 7:38detailed run with respect to the
  189. 7:39research agent, the verification agent.
  190. 7:43It used six sub aents for verification.
  191. 7:46One sub aent then the total number of
  192. 7:48evidences based on that the claims that
  193. 7:50came. So it's pretty much a detailed one
  194. 7:54and right now as I can see that with
  195. 7:56respect to the competitors also uh for
  196. 7:59every organization I can say that it has
  197. 8:01been provided with a lot of detail
  198. 8:04and finally I can say that all the major
  199. 8:07references from where it actually got
  200. 8:09the evidences and finally looked into
  201. 8:12the claims. So all those are available
  202. 8:15in our final report. So I can say that
  203. 8:17this is really impressive. So this video
  204. 8:20is sponsored by Apodex. So try this
  205. 8:23solver now. Links in the description.
  206. 8:25Builders, go grab the open models. Stop
  207. 8:29proofreading your own blind spots. Go
  208. 8:31try it today. Showing you if I show you
  209. 8:34the open AI
  210. 8:38model list. Okay?
  211. 8:41Or any any kinds of model list. You can
  212. 8:43simply open up.
  213. 8:48Okay, you can open up and you can see it
  214. 8:52is having a uh knowledge cut off date.
  215. 8:55Okay, so let me show you uh view all the
  216. 8:58models. So let's pick one model here. So
  217. 9:01let's say I'm going to pick this um GPT
  218. 9:0440 mini. Okay, let's I'll pick this
  219. 9:06particular model. Now if I open this
  220. 9:09model you will see that it is having
  221. 9:11some kinds of information. The first
  222. 9:13information is nothing but it's a
  223. 9:14context window. Context window means
  224. 9:17it's a input size of the model. That
  225. 9:18means at a time how many tokens it can
  226. 9:21take as an input. Okay. That means this
  227. 9:23model can take this amount of tokens.
  228. 9:26Okay. Then this can generate this this
  229. 9:28is the maximum amount of tokens it can
  230. 9:30generate as an as an output. And this is
  231. 9:32the knowledge cutff date. That means
  232. 9:34this model got trained till October 1,
  233. 9:362023. Okay, that means till October 10,
  234. 9:392023 whatever data was available over
  235. 9:42the internet this model got trained.
  236. 9:45Okay, this model got trained and this
  237. 9:46model is having the u I mean uh
  238. 9:49information till Octo 2023. If you are
  239. 9:52asking okay after October 2003 let's say
  240. 9:55you are asking tell me about 2026 FIFA
  241. 9:59World Cup okay who won the world world
  242. 10:01cup right so definitely these kinds of
  243. 10:03questions your LLM will be able to uh
  244. 10:06won't be able to give you the response
  245. 10:07because it doesn't have this kinds of
  246. 10:09informations okay so this was the main
  247. 10:11problem with this prompting approach
  248. 10:13okay this was the main problem with the
  249. 10:14prompting approach so that's why um what
  250. 10:18researcher thought let's say right now
  251. 10:21if you
  252. 10:22This data is getting updated day by day.
  253. 10:25Okay. In internet every day there are
  254. 10:27some new informations are coming. So
  255. 10:30fine-tuning this kinds of large language
  256. 10:32model is super hard. Right? So we can't
  257. 10:34fine-tune this kinds of large language
  258. 10:35model because it's expensive. We need a
  259. 10:38good instance. Okay. That is powerful
  260. 10:40machine
  261. 10:42context learning or engineering. You can
  262. 10:45tell
  263. 10:49learning we also call it as a rag that
  264. 10:52means retable augmented generation okay
  265. 10:54I think you already know about this rag
  266. 10:58rightable augmented generation we call
  267. 11:00it as a context learning as well okay so
  268. 11:02in context learning what happens let's
  269. 11:04say you are having your large language
  270. 11:06model
  271. 11:07let's say this is your large language
  272. 11:09model LLM okay and uh see it is it is
  273. 11:14not only going to rely on its own
  274. 11:16knowledge base. Instead of that, we
  275. 11:18provide additional knowledge sources
  276. 11:20here. Okay, provide additional knowledge
  277. 11:22sources.
  278. 11:25Okay, this is called knowledge base. And
  279. 11:28here we use a vector database.
  280. 11:32Vector database. Okay, and this vector
  281. 11:34database we stores all kinds of new
  282. 11:37informations and we connect with the
  283. 11:39large language model. So when every user
  284. 11:41is asking any kinds of question okay it
  285. 11:44is giving you the response with respect
  286. 11:46to this particular context okay or
  287. 11:49knowledge base. So this is called
  288. 11:50actually context the information it is
  289. 11:53getting from the knowledge base this is
  290. 11:54called context that's why it's called it
  291. 11:55as a context learning on retable
  292. 11:58augmented generation that means if user
  293. 12:00is asking anything let's say if user is
  294. 12:02asking tell me about let's say uh FIFA
  295. 12:04world cup 2026 right so that time if
  296. 12:07this information is not available inside
  297. 12:09LM knowledge base let's say you are
  298. 12:11using GPT5 here or let's GPT4 here this
  299. 12:14for information is not available here
  300. 12:16that that time what it will do it will
  301. 12:18go to the knowledge base Okay. And let's
  302. 12:20say knowledge base we have already
  303. 12:21stored these informations about the FIFA
  304. 12:23World Cup 2026. So it will fetch this
  305. 12:26informations from the knowledge base as
  306. 12:27a context. It will pass to the LLM.
  307. 12:30Okay. And LM will try to refine the
  308. 12:32answer and it will give you the final
  309. 12:33response. Okay. This is called context
  310. 12:35learningable augmented generation that
  311. 12:37means rag. Okay. But what was the main
  312. 12:40problem with this retable augmented
  313. 12:41generation as well? The problem is that
  314. 12:43if you are asking anything real time or
  315. 12:45if you are giving any kinds of
  316. 12:46automation. Okay. Okay, automation means
  317. 12:48let's say you are asking to do let's say
  318. 12:51send a email to the customer A. So that
  319. 12:55time this kinds of application won't be
  320. 12:57able to do that because it can generate
  321. 12:59the email for you but it can't send the
  322. 13:01email because it doesn't have any kinds
  323. 13:03of automation tools right or let's say
  324. 13:06another example I'll give you if you're
  325. 13:08asking tell me the current weather tell
  326. 13:10me the latest news for today's so this
  327. 13:13kinds of application doesn't have any
  328. 13:14kinds of tools that can use to fetch the
  329. 13:17real-time informations okay this was the
  330. 13:19main problem with the lag application
  331. 13:21okay so that that's why researcher again
  332. 13:23introduced another
  333. 13:25technology we call it as a agentic AI
  334. 13:29okay agentic AI or AI agents whatever
  335. 13:32you say right so in agentic what it
  336. 13:34means you'll have your large language
  337. 13:36model everybody you will be using large
  338. 13:37language model only okay but the types
  339. 13:40should be different now this large
  340. 13:42language model is having your knowledge
  341. 13:44base connection it's completely fine
  342. 13:46let's say have connected with the
  343. 13:47knowledge base it's completely fine even
  344. 13:49it will also have connection with the
  345. 13:51tools
  346. 13:53okay it will also have connection with
  347. 13:54the tools. Now what is the tools? Tools
  348. 13:58could be anything. Any kinds of API, any
  349. 14:00kinds of database, any kinds of let's
  350. 14:02say uh any kinds of let's say uh tools.
  351. 14:06Okay, anything. Okay, anything you can
  352. 14:09call it as a tools. Okay. So let's say
  353. 14:12you want to send the email. So to send
  354. 14:15the email guys, what I need? I need
  355. 14:17Gmail API key, right? So Gmail API,
  356. 14:20okay, would be one kinds of tool here.
  357. 14:22Let's say you want to send the message
  358. 14:23automatically to your WhatsApp. So
  359. 14:25WhatsApp API would be your tools. So
  360. 14:27that means whatever application you use
  361. 14:30especially software application every
  362. 14:32application having their developer side
  363. 14:35that means the API. So you can API you
  364. 14:38you can use that API to perform some
  365. 14:40kinds of automations right. So that's
  366. 14:42why these kinds of tools we provide to
  367. 14:44the uh alm right that means this is our
  368. 14:49agent. Okay, this is our agent.
  369. 14:52Okay, we provide 2D agents. Now, if
  370. 14:55you're asking anything
  371. 14:57now, it will utilize that knowledge base
  372. 14:59as well as the tools. Okay, and it will
  373. 15:01give you the response. Okay, now it it
  374. 15:05is not only going to use that tool, it
  375. 15:07can also perform the automation. Let's
  376. 15:08say you are telling just send the email
  377. 15:10to the customer A. Now, first of all,
  378. 15:12what what it will do? Let's say you will
  379. 15:14send this particular, it will come to
  380. 15:16the agents. agents will decide whether I
  381. 15:19have to generate this email from my
  382. 15:22knowledge base or I need some additional
  383. 15:24informations. Let's say I'm talking
  384. 15:26about this uh let's say I'm talking
  385. 15:29about let's say one website called
  386. 15:30krishnagin website. So I'm telling just
  387. 15:33try to send a email regarding our latest
  388. 15:36webinar to this particular student. Now
  389. 15:39how it will get the latest given
  390. 15:41informations definitely I'll try to put
  391. 15:44these are the informations in the
  392. 15:45knowledge base right okay about the
  393. 15:47Krishna so what will happen this
  394. 15:50informations will come to the LLM lm
  395. 15:53will try to uh read that and it will
  396. 15:55prepare a email okay with the help of
  397. 15:58some kinds of tool now after uh
  398. 16:00preparing this particular email I also
  399. 16:03told this email should be sent to the
  400. 16:05learner right so what it will do it will
  401. 16:07take the learner's email
  402. 16:09It will use the email API key to send
  403. 16:11that particular email. That means
  404. 16:12everything is being automated here. You
  405. 16:14are giving a single prompt and all of
  406. 16:16this process is getting automated. So
  407. 16:19this is the main benefit with this agent
  408. 16:21applications. Okay. Now here whatever
  409. 16:24tools technology we have used we also
  410. 16:26call it as a harness engineering. Okay.
  411. 16:30I think you have also probably heard of
  412. 16:31this name right harness engineering. So
  413. 16:34don't worry I'm going to take another
  414. 16:35webinar there. I'm going to tell you
  415. 16:37about this hardness in engineering now
  416. 16:39but just now just try to consider
  417. 16:41whatever tools and technology we use we
  418. 16:43try to integrate with the large language
  419. 16:44model or sorry with our agents we call
  420. 16:47it as a harness engineering so with
  421. 16:49right we so without API you can't create
  422. 16:52any kinds of agent applications every
  423. 16:54aent applications are using these kinds
  424. 16:57of tools and API okay to perform the
  425. 16:59automations
  426. 17:01guys yes or no tell me in the chat guys
  427. 17:04are
  428. 17:06It is getting clear all of you.
  429. 17:09That means in general there are three
  430. 17:11types of application we usually create.
  431. 17:14The first type application we create
  432. 17:15called based application. Okay. There we
  433. 17:19uh voice is fine guys. Voice is
  434. 17:21breaking.
  435. 17:25Just a mate. Let me check
  436. 17:32now. Is it fine? I think it's it should
  437. 17:34be fine. I think it's clear, right?
  438. 17:39Okay. Fine guys. I told you there would
  439. 17:42be some kinds of uh like technical
  440. 17:44issues because this is online seminar.
  441. 17:46Okay. So, please let me know if you are
  442. 17:48facing any kinds of problem. Definitely
  443. 17:50I'm going to fix that. Okay. So, let's
  444. 17:52continue. So, I told you inside
  445. 17:54generative we create three types of
  446. 17:56applications. Okay.
  447. 17:59One is the prompting applications. Then
  448. 18:01we only send the prompt. Okay, we try to
  449. 18:03use the prompting. So that's why at the
  450. 18:05very beginning you saw that whenever uh
  451. 18:07we got this kind of generative
  452. 18:09technology, people used to focus on the
  453. 18:11prompt engineering. Okay, now have you
  454. 18:14seen anywhere people are using prompt
  455. 18:15engineering? No. Right? Because things
  456. 18:17are getting changed, right? Now we are
  457. 18:19using agentic AI applications. So
  458. 18:22traditional prompting approach won't
  459. 18:23work, right? So that's why prompting has
  460. 18:25been almost uh I'll say deprecated but
  461. 18:28yeah this has this has become old,
  462. 18:30right? Yeah.
  463. 18:36voice is breaking.
  464. 18:41I think my connection is also good.
  465. 18:50My connection is good. I think yep
  466. 18:58voice is clear too, right? Uh yeah,
  467. 19:00someone is telling uh many people are
  468. 19:02telling voice is uh voice is clear.
  469. 19:04Okay, but uh some of you are getting
  470. 19:06issues. I don't know what is happening.
  471. 19:33Let me check my mic as well. Yeah, mic
  472. 19:35is also fine, I think.
  473. 19:40[clears throat]
  474. 19:45Now guys, uh is it clear? Am I clear?
  475. 19:48Right.
  476. 19:52Okay. Fine. I think I'm clear right now.
  477. 19:55Okay. Now let's continue. Um yeah. So
  478. 19:58now what I told you guys? I told you in
  479. 20:00generative way there are three kinds of
  480. 20:02application we develop. One is the
  481. 20:03prompting, one is the context landing or
  482. 20:05rack and another is the agent
  483. 20:06applications. Okay. Now you can ask me.
  484. 20:09Okay. It's completely fine. We got to
  485. 20:11know in generative there are three types
  486. 20:14of applications. Okay.
  487. 20:16we uh we usually develop inside
  488. 20:20generative eBay. But what is this loop
  489. 20:23engineering exactly? Okay, why people
  490. 20:24are talking about the loop engineering
  491. 20:26nowadays? I think if you open your
  492. 20:28LinkedIn, if you open your Instagram
  493. 20:30right now, you will try to see this
  494. 20:32kinds of loop engineering concept is
  495. 20:34very trending, right? Even on YouTube
  496. 20:36channel also lots of creators are
  497. 20:38creating this kinds of content. Now
  498. 20:40let's try to understand what is loop
  499. 20:42engineering whether it's a different
  500. 20:43field or it is the same thing we usually
  501. 20:45using okay but we don't know about that
  502. 20:48we'll just try to uh discuss this
  503. 20:50particular point
  504. 20:57yeah I'm going to clarify all of your
  505. 20:59questions please uh be with me first of
  506. 21:00all let me clarify okay everything now
  507. 21:03let's try to see what is loop
  508. 21:05engineering
  509. 21:08loop engineering
  510. 21:11See, I'm going to give you the
  511. 21:12definition. Don't worry. First of all,
  512. 21:14let me just give you a high level
  513. 21:15overview about the loop engineering.
  514. 21:24Okay. Now see what happens.
  515. 21:27The same the type three application
  516. 21:30agent. I'll take this particular example
  517. 21:32only. Let's say we are having
  518. 21:36uh we are having
  519. 21:41one agent.
  520. 21:44Okay, we are having an agent.
  521. 21:48Okay, and you know that it has a
  522. 21:50connection with lots of tools.
  523. 21:54Okay, tools with with the help of these
  524. 21:56tools, it can perform some kinds of
  525. 21:58automations. Okay. And here we are
  526. 22:00giving the questions and here we're
  527. 22:01giving getting the responses. Okay. Now
  528. 22:05the simple AI agents we usually develop
  529. 22:09it has the two connections only. One is
  530. 22:11the input. Okay. And another one is the
  531. 22:15output. Okay. So this is the simple
  532. 22:18agent uh architecture usually correct.
  533. 22:21So that means if user is giving any
  534. 22:22kinds of input these agents will uh
  535. 22:26decide. Okay. It will use the large
  536. 22:28language model for the reasoning and it
  537. 22:30will understand the user requirement
  538. 22:32based on that it will select a tools and
  539. 22:34with the help of these tools it will
  540. 22:35generate that particular response or it
  541. 22:37will perform some kinds of work and it
  542. 22:39will give you the output right so this
  543. 22:41is what actually we usually create okay
  544. 22:43inside applications but this is not
  545. 22:46enough okay if you're creating this
  546. 22:48kinds of agent application this is kinds
  547. 22:50of oneshot agents you are creating why
  548. 22:53I'm telling as a oneshot agents because
  549. 22:55you are giving a out input and you are
  550. 22:57getting an output there is a direct
  551. 22:59communications okay there is no there is
  552. 23:02no any kinds of verifications okay so
  553. 23:04what happens in real world let's say if
  554. 23:06I'm learning anything from my teacher
  555. 23:09right so definitely teacher will give me
  556. 23:11some kinds of task and I will complete
  557. 23:13that task and again I will go go to my
  558. 23:16teacher for the review okay uh teacher
  559. 23:18will try to review the entire task and
  560. 23:21he or she will give me the feedback
  561. 23:23right let's say you have done a mistake
  562. 23:25here or your uh work is completely fine.
  563. 23:27Okay, we can approve the your work. So
  564. 23:29these kinds of feedback is needed
  565. 23:31whenever you are learning anything
  566. 23:32whenever you are doing anything for the
  567. 23:34first time right if you're getting this
  568. 23:36kinds of feedback if you're getting this
  569. 23:38kinds of suggestion so it will help me a
  570. 23:40lot to learn that particular topic in
  571. 23:42depth but if I'm directly I getting the
  572. 23:45task and if I'm completing and there is
  573. 23:47no verification there is no marking so
  574. 23:49now tell me would it be good or bad
  575. 23:53definitely this is not a right right way
  576. 23:55to learn right anything so that's why
  577. 23:58there should be some kind of
  578. 24:00verifications. There should be kinds of
  579. 24:01feedback layer. Okay. So that whatever
  580. 24:04things we are doing for the first time
  581. 24:06we get we get a feedback based on that
  582. 24:08we can improve either we can continue.
  583. 24:10Okay. Now especially nowadays those who
  584. 24:13are using any kinds of coding agents. I
  585. 24:15think you were using coding agents
  586. 24:16right? Can you name some of the coding
  587. 24:19agents you were using in your life? So I
  588. 24:21think the first one you will tell okay
  589. 24:23sir I'm using cloud code. I'm using VS
  590. 24:26code copilot. I'm using cursor ID. Okay.
  591. 24:30I'm using anti-gravity. I'm using
  592. 24:33codeex. So what is this? What are these
  593. 24:36informations about?
  594. 24:38Okay. This information is all about it's
  595. 24:41a coding agents, right? It's a coding
  596. 24:43agents. Even charge GPT also we can
  597. 24:46consider it can also generate the code.
  598. 24:48Again we don't use charg for the coding
  599. 24:50purpose. Yes, some someone might be
  600. 24:53using that. Especially for coding
  601. 24:55agents, there are some kinds of software
  602. 24:57they have created for us. Okay. Now, if
  603. 24:59you have seen the coding agents, what
  604. 25:02coding agent does? Let's say you are
  605. 25:03giving a prompt. Just generate let's say
  606. 25:06a flask project for me or let's say you
  607. 25:08are giving uh let's say uh my name is
  608. 25:11Buppy. I done a YouTube channel called
  609. 25:14DS with Buppy. For this, I need a
  610. 25:16website. Okay, just try to create this
  611. 25:18particular website for me. Now, what
  612. 25:20will happen? your agents will start
  613. 25:22write the code, right? And it's not like
  614. 25:24that. Whenever it will start writing the
  615. 25:26code and once code is prepared, it will
  616. 25:29directly give you the code. Okay, it's
  617. 25:30not like that. What coding agent does
  618. 25:33once it has generated the code, okay,
  619. 25:35once it has generated the code or any
  620. 25:37kinds of functions, it will verify
  621. 25:39whether this code works or not. If you
  622. 25:41are generating any kinds of buggy code,
  623. 25:43okay, and if you're giving to me, that
  624. 25:45time your application is not good to me,
  625. 25:47right? I'm not going to use your
  626. 25:48application. if you're giving a buggy
  627. 25:50code to me so I can even write a better
  628. 25:53code than your applications right so
  629. 25:55that's why this kinds of application is
  630. 25:57having one verification layer nowadays
  631. 25:59okay so what this verification layer
  632. 26:02does whatever your agents are generating
  633. 26:04let's say this is my codeex okay or
  634. 26:06let's say this is my cloud code it is uh
  635. 26:09here I'm going to draw another example
  636. 26:12let's say this is my agent
  637. 26:16okay here we're giving the input
  638. 26:19And instead of directly giving the
  639. 26:21output, it is passing this particular
  640. 26:23output to a verifier.
  641. 26:26Okay, verifier. And what this verifier
  642. 26:28is doing, it is verifying whether the
  643. 26:31generated code or generated response is
  644. 26:33fine or not. Okay, if it is fine, it
  645. 26:36will give you the output directly. Okay,
  646. 26:38it will give you the output. If it is
  647. 26:40not fine, what will happen? It will
  648. 26:42generate the feedback and again this
  649. 26:45feedback will go to the agent. Okay,
  650. 26:47this is called actually feedback loop.
  651. 26:49Okay, this is called actually feedback
  652. 26:51loop. So this feedback loop will be
  653. 26:54running unless and until your agent is
  654. 26:56generating the perfect output for you or
  655. 26:59perfect code for you. Okay, so this is
  656. 27:01called actually agentic loop. What it
  657. 27:04called? This is called actually agentic
  658. 27:06loop.
  659. 27:08Okay, now I can show you one realtime
  660. 27:10example. If you go to the cloud code
  661. 27:12documentations and if you go go to this
  662. 27:15code component called how cloud code
  663. 27:17works. Okay. Now here in this particular
  664. 27:19sections they have already discussed
  665. 27:20about this agentic loop. Can you see
  666. 27:22guys agentic loop? Now here they have
  667. 27:25already told that whenever user is
  668. 27:26giving any kinds of prompt. Okay. So
  669. 27:29what it is doing it is first of all
  670. 27:30gathering the content taking the
  671. 27:32actions. Okay. That taking the action
  672. 27:34means it is generating that code for
  673. 27:36you. Okay. Because cloud code is
  674. 27:38specially for the uh coder okay it will
  675. 27:41generate the code for you. So it will
  676. 27:43generate the code. So after generating
  677. 27:45code it is not directly giving you okay
  678. 27:47instead of that it is trying to to the
  679. 27:50another layer called verify layer. Okay.
  680. 27:52And this verify layer will try to verify
  681. 27:54whether this generating code generated
  682. 27:57code is fine or not whether it is
  683. 27:58running or not. Is there any bugs or
  684. 28:00not? If there is not any kinds of bug it
  685. 28:02will directly give you it will tell
  686. 28:04done. Okay, let's say this is your code,
  687. 28:06just try to use that or else if it is
  688. 28:08found any kinds of bug, if it founds any
  689. 28:10kinds of issue, then again it will try
  690. 28:12to give the feedback to the agents.
  691. 28:15Okay, it will try the agents. Okay, this
  692. 28:16is the feedback. It has this kinds of
  693. 28:18problem again try to regenerate that
  694. 28:20particular code. Again agent will take
  695. 28:22the actions. Okay, again it will
  696. 28:24generate something. Again it will pass
  697. 28:25to the verification layer. Again
  698. 28:27verification layer will check if fine it
  699. 28:30will send done otherwise again it will
  700. 28:31go to the agents again. That means this
  701. 28:33is kind of agentic loop is running.
  702. 28:35Okay, I think you have already studied
  703. 28:37about the loop in Python, right? How
  704. 28:39many of you have studied about the loop
  705. 28:40concept? I know you already already know
  706. 28:43about loop, right? What loop means? Loop
  707. 28:46means you are giving a task which would
  708. 28:49be continuously running and this should
  709. 28:51be definitely a termination condition.
  710. 28:54If there is not any kinds of termination
  711. 28:56condition, this loop would be completely
  712. 28:58infinite. That means if you send a
  713. 29:00prompt to the agents, agents will run I
  714. 29:02mean infinite time. Okay, [laughter]
  715. 29:05your entire life you have to wait in
  716. 29:06front of your in front of your computer.
  717. 29:09Okay, so definitely there should be
  718. 29:10kinds of some kinds of interruption.
  719. 29:13Okay, that's why it is telling there
  720. 29:14should be some kinds of interruption
  721. 29:16either this interruption you provide as
  722. 29:18a HITL that is human in the loop either
  723. 29:21you can assign any kinds of condition
  724. 29:24either you can give any kinds of maximum
  725. 29:26iteration limit. Okay. So this thing you
  726. 29:28will try to provide to the infinite
  727. 29:30loop. Okay. So that means inside aentic
  728. 29:33loop there there are main two component
  729. 29:36the first component is the verifier. The
  730. 29:38second component is the interruption
  731. 29:40rule. Get it guys.
  732. 29:44Is the feedback consist of human in the
  733. 29:47loop. Uh question I think you have now
  734. 29:49got it. Not only human you can either
  735. 29:52use human either you can write any kinds
  736. 29:54of condition. Okay. Either you can give
  737. 29:56any kinds of other let's say termination
  738. 29:59condition. It's completely up to you
  739. 30:00your design pipeline. It's not necessary
  740. 30:03to always put the human verifications
  741. 30:05here. Okay.
  742. 30:09Okay. Because if you have already used
  743. 30:11coding agents, so coding agents
  744. 30:12sometimes it will ask for the human
  745. 30:14input. If you're giving human input
  746. 30:16again it will run the loop and once it
  747. 30:18found like okay this content is
  748. 30:20completely fine that time this loop
  749. 30:21would be automatically break. Right?
  750. 30:23Definitely one condition we know which
  751. 30:25is that if our generated response is
  752. 30:28completely fine. Okay, this condition
  753. 30:30again just try to understand this
  754. 30:31condition. Once this generated output is
  755. 30:34completely fine, there is no issue this
  756. 30:36agent will break this loop. Okay,
  757. 30:38because user will get the result and
  758. 30:40this loop would be break, right? But if
  759. 30:42it is not uh if it is not good, if it is
  760. 30:45having some kinds of issue, then this
  761. 30:47root would repeat again. Okay, but there
  762. 30:51is a possibility every time your agents
  763. 30:53will generate some buggy code. Okay, and
  764. 30:55it's not like that you have to always
  765. 30:57run this again and again. Okay, so there
  766. 30:59should be some kinds of termination
  767. 31:00condition in case let's say if your
  768. 31:02agents is not able to do that. There
  769. 31:04would be some kinds of termination
  770. 31:06conditions either you can give set any
  771. 31:07kinds of maximum iterations either you
  772. 31:09can ask your human to stop that
  773. 31:11particular conditions for you. Okay.
  774. 31:15[clears throat]
  775. 31:16Yeah, definitely it will use it will use
  776. 31:19the tool to perform the actions right
  777. 31:20Krishna agents always remember agents
  778. 31:23means it has the tool connection none of
  779. 31:26the agent I mean it doesn't have the uh
  780. 31:29sorry none of the agents uh don't have
  781. 31:32the tools okay every agents have the
  782. 31:34tool
  783. 31:38got it
  784. 31:42so whenever I'm talking about
  785. 31:44applications definitely there would be
  786. 31:45tool connection without tool
  787. 31:47we can create the agents. Okay, two
  788. 31:49would be definitely there.
  789. 31:52Okay, now I think you have understand
  790. 31:55how these kinds of coding agent works
  791. 31:57especially the cloud a code then we have
  792. 32:00codex we have cursor ID we have my uh
  793. 32:04viscode copilot okay whatever agentic uh
  794. 32:08agentic let's say this kinds of coding
  795. 32:10agents you are using every coding agents
  796. 32:13use this kinds of agentic look to part
  797. 32:16uh to uh give you this uh kinds of let's
  798. 32:19say uh free code. Okay. It's not like it
  799. 32:22is directly generate. It is not uh it's
  800. 32:25not like that is directly generating the
  801. 32:27code for you and it is giving to you
  802. 32:29before giving to you. It is doing one
  803. 32:31kinds of verification with the help of
  804. 32:33verify. Okay. And it is giving you the
  805. 32:36output. If this particular particular
  806. 32:38output is good, you will be getting the
  807. 32:40output otherwise this feedback loop
  808. 32:42would be running continuously. This is
  809. 32:44what actually loop engineering is. Okay.
  810. 32:46This is called actually loop
  811. 32:47engineering. See this is nothing but our
  812. 32:50agent concept only only the things they
  813. 32:53have added this looping concept okay
  814. 32:55that means we are not going to trust one
  815. 32:58short response instead of that we'll
  816. 33:00verify that okay just try to match with
  817. 33:02your real life whenever you are learning
  818. 33:04something definitely you need a mentor
  819. 33:06and mentor will give you the feedback
  820. 33:08okay you are doing great or this is the
  821. 33:10issue uh um you are facing okay or let's
  822. 33:12say this improvement you have to do if
  823. 33:14you're getting this kinds of feedback
  824. 33:15right from the teacher itself then you
  825. 33:18can do something good in your life
  826. 33:20otherwise you don't know what is
  827. 33:21happening to you right whatever things
  828. 33:23you are doing you don't know whether
  829. 33:24it's right or wrong so that's why one
  830. 33:26kinds of verification is required so
  831. 33:28these kinds of verification we add
  832. 33:30inside loop engineering only and we make
  833. 33:32this kinds of agent more powerful and
  834. 33:34whatever output we are getting this is
  835. 33:36more reliable more safe okay this is the
  836. 33:39concept of loop engineering is there one
  837. 33:42agents or one agent for generation
  838. 33:44another agents for verifications exactly
  839. 33:47Adil you are right Okay. Now it it not
  840. 33:49necessary to only use two agents here.
  841. 33:51There should be multiple agents. Let's
  842. 33:53say you are creating a blog writing
  843. 33:56agents. Okay. Now in blog writing agents
  844. 33:58what happens? One agents would be your
  845. 34:01topic research. Okay. It will do the
  846. 34:02topic research. Then it will pass to the
  847. 34:04another agent. Another agents will try
  848. 34:06to research this particular topic over
  849. 34:08the internet. Then it will send to the
  850. 34:10another agents. Another agent will try
  851. 34:11to write that. Okay. After writing it
  852. 34:13will send uh send this particular uh
  853. 34:16content to the reviewer agents. Okay.
  854. 34:18Now reviewer is the verifier here. Okay.
  855. 34:20It will review whether this particular
  856. 34:21resulted blog is fine or not. If this is
  857. 34:24fine, it will directly pass to the final
  858. 34:27response and final response agent will
  859. 34:29provide uh the final format to the user.
  860. 34:31Otherwise, it will give the feedback to
  861. 34:33the where to the again writer agents.
  862. 34:37Okay, it will give the feedback to the
  863. 34:38writer agents. Try to improve this.
  864. 34:40Right. Okay. Again writer agents will
  865. 34:42work. So this is called actually your
  866. 34:43agentic loop that time.
  867. 34:47Get it guys? So it's not necessary to
  868. 34:49add one agents only. It depends upon
  869. 34:51your design philosophy whether you are
  870. 34:53creating a single agent, whether you are
  871. 34:54creating a multi- aent system.
  872. 35:01Yeah, this session is recorded Imran.
  873. 35:03Okay, it it would be recording. So got
  874. 35:06it guys. So far everyone is clear. If
  875. 35:08you're clear clear guys, please write
  876. 35:09clear in the chat all of you. I want
  877. 35:11confirmation from you. Then I will go to
  878. 35:13the next part. Let me know guys if
  879. 35:15you're clear. Still here.
  880. 35:22Okay. Now we'll try to deep dive into
  881. 35:25this loop engineering mode. Okay. Don't
  882. 35:26worry. I have just given you high level
  883. 35:28overview. Now we'll try to understand.
  884. 35:30Okay. For this I have created a PP for
  885. 35:32you. Okay. We'll try to go through this
  886. 35:33entire PPT and we'll try to understand
  887. 35:34about this loop engineering. Now let's
  888. 35:37open this PT and let's try to understand
  889. 35:39about this loop engineering. So this is
  890. 35:40the PPT guys. Don't worry I'm going to
  891. 35:42share with you uh as well. Okay. Now see
  892. 35:45guys on my screen
  893. 35:47I have already written the definition
  894. 35:49about this loop engineering. So as you
  895. 35:51can see what is loop engineering? Loop
  896. 35:53engineering means designing an agents
  897. 35:54that repeatedly works checks its result
  898. 35:58learn from the feedback and tries again
  899. 36:00until the goal is achieved. Now you are
  900. 36:03getting this definition I think uh but
  901. 36:06if I showed you this definition at the
  902. 36:08very first time definitely you would you
  903. 36:10would have the confusions right? That's
  904. 36:11why first of all I have given you that
  905. 36:13high level overview okay through this
  906. 36:15architecture now I think you can
  907. 36:17understand this particular definition
  908. 36:18okay what is loop engineering exactly
  909. 36:20now instead of human continuously
  910. 36:22telling the agents let's say try again
  911. 36:24fix this problem check your answer
  912. 36:26improve the output okay we are using
  913. 36:29loop engineering concept that means we
  914. 36:31are writing a agentic loop we are
  915. 36:33integrating our agentic loop our agent
  916. 36:35itself is automatically correcting its
  917. 36:37own mistake okay so pre uh see the main
  918. 36:40issue with the charg GPT is it doesn't
  919. 36:42have the looping concept. Yeah, you can
  920. 36:44generate the code with the chart GPT but
  921. 36:46it will give you one shot output, right?
  922. 36:47Let's say I need uh image classification
  923. 36:51code with tensorflow. It will give you
  924. 36:53the code but charge GP even don't know
  925. 36:56whether this code will work or not. So
  926. 36:58what it will do you will do you will
  927. 36:59just try to copy that code run in your
  928. 37:02local machine and you will face any
  929. 37:03kinds of issue. Again you will copy the
  930. 37:05issue and you will tell your f uh charge
  931. 37:08to fix this problem. Again charg will do
  932. 37:10some research again it will fix that
  933. 37:12problem again it will give some kinds of
  934. 37:14code again it will run this code if the
  935. 37:16if let's say this uh uh is not uh looks
  936. 37:21good with you again it will tell try
  937. 37:22again or check your answer improve the
  938. 37:24output it will give different different
  939. 37:26manual prompting we don't want that we
  940. 37:28need some kinds of system this will
  941. 37:30automatically work for me right so this
  942. 37:32is called actually agentic agentic loop
  943. 37:35application especially whatever coding
  944. 37:37agents we are using nowadays
  945. 37:39getting
  946. 37:42how it's a different from a deep
  947. 37:43learning model. Deep learning model is
  948. 37:45different. Okay, deep learning model
  949. 37:46means it's a predictive model. But here
  950. 37:49we are working with the generative
  951. 37:50model. Hubernus
  952. 37:53is it very token heavy? uh definitely uh
  953. 37:56whenever you are creating this kinds of
  954. 37:58uh let's say agentic loop uh especially
  955. 38:02uh it will cost more tokens than your
  956. 38:04simpler agents because every time it has
  957. 38:07to take the output it has to verify it
  958. 38:10will give the feedback again based on
  959. 38:12the feedback it will work again will get
  960. 38:13the output so this kinds of loop is
  961. 38:15going right so definitely some uh I mean
  962. 38:18token heavy would be available that's in
  963. 38:20this case of um um I mean um coding
  964. 38:23events is having a subscript
  965. 38:25subscription plan. Okay, they will take
  966. 38:26good amount of money from you. Why?
  967. 38:28Because of this token. Okay, you are you
  968. 38:32are spending the tokens here, not
  969. 38:33anything else. So none of the coding
  970. 38:36agents are free nowadays. If you're
  971. 38:37using any kinds of coding agents, you
  972. 38:39have to pay for that. Okay.
  973. 38:43Yeah. Now let's try to see one example.
  974. 38:47Let's say in our traditional aentk
  975. 38:49application, not traditional. Yeah.
  976. 38:51See it's not like that you always need
  977. 38:53to add the verification layer inside
  978. 38:54your agents. It depends upon the problem
  979. 38:57statement. Let's say you're creating a
  980. 38:58coding agents that needs the
  981. 38:59verification. But if you're creating a
  982. 39:01simple let's say a simple let's say uh
  983. 39:04trip planner agents that will only plan
  984. 39:06the trip for you. That mean this kinds
  985. 39:08of verification is not required. So I'll
  986. 39:10give a trip topic and it will do some
  987. 39:12research over the internet and it will
  988. 39:14give me the plan. Let's say I want to
  989. 39:16visit from Bengal to Japan, right? So I
  990. 39:20need a trip plan like uh in Japan which
  991. 39:23place I have to visit, what kinds of
  992. 39:25food I have to eat, right? So these
  993. 39:26kinds of things we can easily do with
  994. 39:28the help of these kinds of agents. Okay,
  995. 39:29we don't need any kinds of verification
  996. 39:31layer here. So again it depends upon
  997. 39:33your problem statement. If your problem
  998. 39:36statement needs a verifications that can
  999. 39:38go with loop engineering concept
  1000. 39:39otherwise the simple agents whatever you
  1001. 39:41have learned so far. Okay.
  1002. 39:44So this is what your simple approach
  1003. 39:47that means if user is asking anything
  1004. 39:48agent is returning the answer in one
  1005. 39:50shot. There is no verifications. Okay
  1006. 39:52you are getting the output and this
  1007. 39:54agent is getting stopped terminated. In
  1008. 39:56loop engineering in agentic loop what is
  1009. 39:59happening? User is asking a questions.
  1010. 40:01Okay it is going to the agents. Agents
  1011. 40:03is generating something. This generation
  1012. 40:05is giving to the feedback layer. Okay.
  1013. 40:06Feedback lane or verify. Verify will try
  1014. 40:09to verify whether this particular result
  1015. 40:11is fine or not. If it is fine, it will
  1016. 40:13return otherwise again it will return
  1017. 40:15you the feedback. That means this loop
  1018. 40:17will continuously run.
  1019. 40:20Okay,
  1020. 40:21great guys. So that's why a normal AI
  1021. 40:24call usually gives one response and
  1022. 40:26stops. Okay, that is fine for the simple
  1023. 40:28question answer but risky when the task
  1024. 40:31has many requirement especially the
  1025. 40:33coding agents. Okay. Uh a loop adds a
  1026. 40:36check uh checking st if the output fails
  1027. 40:38feedback goes back into the agents for
  1028. 40:41another attempt. Okay. So simple media
  1029. 40:44answer once this is risky. Okay. But if
  1030. 40:47you check and improve this is more
  1031. 40:48reliable.
  1032. 40:52Yeah. You were right. Okay.
  1033. 40:57H. Now let's take one very simple
  1034. 41:00example. I already taken that classroom
  1035. 41:03example. Let's see if you are a learner.
  1036. 41:05So first of all your teacher will give
  1037. 41:07you something any kinds of task. Let's
  1038. 41:08say you are giving exams. So after
  1039. 41:10giving these exams you are giving this
  1040. 41:12exam paper to the teacher teacher is
  1041. 41:14giving you some kinds of feedback some
  1042. 41:16kinds of improvement you are again um I
  1043. 41:19mean doing that particular task okay
  1044. 41:20that's how we usually learn right
  1045. 41:24okay now we can see simple definition
  1046. 41:27loop engineering means designing an AI
  1047. 41:29agents that can generate work evaluate
  1048. 41:31the result receive feedback try again
  1049. 41:33and stop when the goal is met okay that
  1050. 41:36means generate check improve repeat so
  1051. 41:38this is the architecture of uh loop
  1052. 41:41agents. Okay. Now this is the classroom
  1053. 41:43analogy I have already given you. Yeah.
  1054. 41:46Now non- aent loop. Let's try to
  1055. 41:49understand in non-agent loop. What will
  1056. 41:51happen? User is giving a goal. It will
  1057. 41:53generate once. Okay. Return the answer.
  1058. 41:56Your agents will stop. There is no
  1059. 41:57repeatation. There is no looping. Right?
  1060. 41:59Example a customer support reply. So it
  1061. 42:02will write customer support reply and it
  1062. 42:04will stop. Okay? Okay, if you are using
  1063. 42:07agentic loop that time what will happen?
  1064. 42:09It will write the customer support
  1065. 42:11message. Okay, it will understand first
  1066. 42:13of all customer customer let's say
  1067. 42:16intention customer let's say uh feelings
  1068. 42:19based on that it will write the message
  1069. 42:21to you. Let's say someone is asking sir
  1070. 42:23uh I need to I I need a uh I need a
  1071. 42:25carrier guidance uh from you. I'm not
  1072. 42:29getting a job. That means this person is
  1073. 42:31get frustrated right? So the way I have
  1074. 42:33to reply to this particular letter that
  1075. 42:35would be kinds of different tone but if
  1076. 42:36I'm telling uh let's say I I can't help
  1077. 42:40you with that or let's say go go ahead
  1078. 42:42and try to find a job okay so this is
  1079. 42:44not a right tone so I have to understand
  1080. 42:46the customer behavior customer feelings
  1081. 42:49based on that I have to generate the
  1082. 42:51response okay so that's why if this
  1083. 42:53kinds of uh response you are generating
  1084. 42:56with the help of non uh loop aents that
  1085. 42:59time there is a possibility it will only
  1086. 43:00generate this answer runtime it will not
  1087. 43:03even verify whether this is perfect for
  1088. 43:04this user or not and user will not
  1089. 43:07interest in your applications right it's
  1090. 43:09better to have a verifications so that
  1091. 43:12it will understand this output uh and it
  1092. 43:15will verify okay whether this is match
  1093. 43:18with this customer or not okay I hope
  1094. 43:20you got it guys
  1095. 43:22how feedback is giving to the agents
  1096. 43:26I'll tell you this part see here you can
  1097. 43:28understand okay how this feedback is
  1098. 43:29going to the agents now see whenever
  1099. 43:31where user is giving any kinds of input
  1100. 43:33to the agents. Agents is generating
  1101. 43:34something. Okay. And here you have the
  1102. 43:37verifier. Okay. Now if this particular
  1103. 43:39answer is good, it will directly send
  1104. 43:41you this output. Okay. Otherwise this
  1105. 43:44verification will give you feedback.
  1106. 43:45Okay. Feedback means it will check this
  1107. 43:48output and definitely the verifier we're
  1108. 43:50using this would be a kinds of this
  1109. 43:53would be kinds of agent. Okay. See this
  1110. 43:55verifier you are using right? This
  1111. 43:57should be also kinds of agent. it it
  1112. 43:59will also have some kinds of language
  1113. 44:01language model okay to understand this
  1114. 44:04particular output now here there are
  1115. 44:06different different techniques you can
  1116. 44:07use either you can use your custom
  1117. 44:09agents either you you can use some kinds
  1118. 44:12of tool here okay I'm going to show you
  1119. 44:14two approach today we'll be creating one
  1120. 44:16agents with the help of uh our own
  1121. 44:19custom agents with the help of large
  1122. 44:20language model even I'm also going to
  1123. 44:22show you an amazing tool called test
  1124. 44:24sprite okay with the help of test sprite
  1125. 44:26also you can create this particular
  1126. 44:27verifier
  1127. 44:29Do we have framework for the
  1128. 44:31implementation the loop or it has to be
  1129. 44:33custom function? See this is just a
  1130. 44:36custom things. Okay, you have to create
  1131. 44:38this particular verifier whether
  1132. 44:40whenever you are creating any kinds of
  1133. 44:41agents. Okay, let's say you're creating
  1134. 44:43a blog wring agents. So after generating
  1135. 44:45the blog just try to create another
  1136. 44:46agents to verify that particular blog
  1137. 44:48before publishing it getting Rajes. So
  1138. 44:51this is a custom things you are writing
  1139. 44:53that things. There is no direct
  1140. 44:55framework you can integrate here. Okay.
  1141. 44:57But there are some tools definitely you
  1142. 44:59can use to create this particular
  1143. 45:01verifier. Okay. Some more tools are
  1144. 45:03available. One of the tools we'll be
  1145. 45:05using called sprite. Okay. I'm going to
  1146. 45:07show you these tools as well how to work
  1147. 45:08work with that tool.
  1148. 45:10Okay. Don't worry. So this particular
  1149. 45:14verifier will verify this answer or this
  1150. 45:16output. If it is good it will return
  1151. 45:18otherwise it will give the feedback to
  1152. 45:20the agents again based on the feedback
  1153. 45:22agents again it will work and it will
  1154. 45:24generate another output and again
  1155. 45:26verifier will check that. So that's how
  1156. 45:28this loop will continuously run unless
  1157. 45:29and until we are not getting our actual
  1158. 45:32output. Okay, whichever we are expecting
  1159. 45:34from the agents. This is what actually
  1160. 45:36our goal. This loop should not be
  1161. 45:38infinite loop. There should be some
  1162. 45:40kinds of termination condition. Either
  1163. 45:42you can terminate with the help of HITL,
  1164. 45:45either you can give any kinds of maximum
  1165. 45:46iteration. Either you can Okay, either
  1166. 45:50you can provide a different condition
  1167. 45:51for that. Okay. So that's why you will
  1168. 45:54see that in this loop agents what will
  1169. 45:56happen? First of all, it will generate
  1170. 45:57an answer. Evaluate an that particular
  1171. 46:00answer. If it fails, create the
  1172. 46:02feedback. Try again with the feedback.
  1173. 46:04Stop when this passes or reaches the
  1174. 46:06limit. One thing you have to remember
  1175. 46:08important things, a loop must have a
  1176. 46:11stopping rules otherwise the agents may
  1177. 46:13keep spending tokens and time without
  1178. 46:15reaching the better result. So that's
  1179. 46:17why one termination condition is super
  1180. 46:19important here. Okay. Now we'll try to
  1181. 46:22understand how this termination
  1182. 46:24condition we can add. Okay. So whenever
  1183. 46:26we see the practical I'll show you this
  1184. 46:27part as well. Now see this is what our
  1185. 46:30actually this verifier this is what our
  1186. 46:34custom verifier that means we're using
  1187. 46:35some kinds of low language model some
  1188. 46:37kinds of agents here right but one one
  1189. 46:40more architecture I want to show you you
  1190. 46:42can create with the help of test pride
  1191. 46:43verifier so let's say this is your
  1192. 46:45agents it is uh getting a Google your
  1193. 46:48agents is running okay let's say it it
  1194. 46:51has generated one uh website it this
  1195. 46:54website is live okay on the server and
  1196. 46:57you have used This test sprite verifier.
  1197. 46:59Okay, test sprite is a tool. Okay, I'm
  1198. 47:01going to tell you it's a testing tool.
  1199. 47:03It's a testing tool. You can test your
  1200. 47:05applications. So, this tool
  1201. 47:06automatically checks your application is
  1202. 47:08having any kinds of bugs or not. If it
  1203. 47:10is found any kinds of bugs, okay, what
  1204. 47:12will happen? It will generate some kinds
  1205. 47:14of bug snapshot. Snapshot means it will
  1206. 47:17understand the bugs where it found the
  1207. 47:19bug. What is the problem? It will
  1208. 47:21automatically understand. Okay? And it
  1209. 47:23will generate a snapshot. Okay? This
  1210. 47:26this snapshot will go to the agents
  1211. 47:27again. Now agents will understand okay
  1212. 47:29so I have a problem in this particular
  1213. 47:31section in this particular line this is
  1214. 47:32the problem. Now it will again that take
  1215. 47:35this particular snapshot it will improve
  1216. 47:36the code again it will make it live
  1217. 47:39again test sprite will check that if now
  1218. 47:41it is found completely good it will send
  1219. 47:43the pass and you will achieve your goal.
  1220. 47:45Okay otherwise this loop will
  1221. 47:47continuously learn would be some kinds
  1222. 47:49of stopping condition. Okay either you
  1223. 47:52can stop either you can set some kinds
  1224. 47:54of maximum iteration from your end.
  1225. 47:56Okay, now you can see the coding agents
  1226. 47:58builds or change the app. Test sprite
  1227. 48:00checks the live app. Test sprite says
  1228. 48:02pass or fail. The agent uses the failure
  1229. 48:05evidence to fix the issue. Test sprite
  1230. 48:07return the same verifications. So the
  1231. 48:09loop is agent acts test sprite verify
  1232. 48:12agent fixes test price verify again. So
  1233. 48:14this is what our loop is running here.
  1234. 48:19Okay.
  1235. 48:21Huh. kinds of treatment you can say but
  1236. 48:23this is kinds of different purpose we'll
  1237. 48:25be using okay I'm going to do this part
  1238. 48:27don't worry okay stay with me I'm going
  1239. 48:29to clarify each and everything
  1240. 48:34okay now see um we'll try to understand
  1241. 48:37this anatomy of a good good loop that
  1242. 48:40means inside a good loop what are the to
  1243. 48:41uh things should be available definitely
  1244. 48:43the goal observation feedback actions
  1245. 48:46evaluation and most importantly the
  1246. 48:48stopping rule okay without stopping rule
  1247. 48:51didn't create any kinds of loop guys.
  1248. 48:54Okay, so simple formula loop is equal to
  1249. 48:57Google plus action plus evaluation
  1250. 48:59feedback plus stopping conditions. If
  1251. 49:01you combine all of them, you'll be
  1252. 49:02writing a good loop inside your agents.
  1253. 49:05Now let's try to see the difference
  1254. 49:07between non-loop agents and loop agents.
  1255. 49:09Now non-loop agents answer once. Okay,
  1256. 49:12fast and simple, low cost, no automatic
  1257. 49:16self corrections best for low-risk task.
  1258. 49:18Okay. But in on the other hand, loop
  1259. 49:21agents can try multiple times, checks
  1260. 49:23the output, uses feedback to improve,
  1261. 49:26higher cost, best for multi-step task.
  1262. 49:29Okay. So this is the difference between
  1263. 49:30your non-loop agent and loop agents. Now
  1264. 49:33we can decide which one you have to use
  1265. 49:35based on your requirement. If your
  1266. 49:36requirement is having a reliability mode
  1267. 49:39that time you can use loop aence. If
  1268. 49:41your problem statement is having some
  1269. 49:43kinds of low-level task that time go
  1270. 49:45with non-loop agents. Okay? It's
  1271. 49:47completely up to you because if you're
  1272. 49:49going with loop agents definitely there
  1273. 49:50would be higher cost because of the
  1274. 49:52tokens. Okay. But if you're going with
  1275. 49:53the non-loop agents there would be lower
  1276. 49:55cost because it generates the output
  1277. 49:57only one shots.
  1278. 49:59Okay. So here speed matters here quality
  1279. 50:01matters. So whenever you are worrying
  1280. 50:03about the speed you need a faster
  1281. 50:05response that time go with non-loop
  1282. 50:06agents because it runs one time. But
  1283. 50:08whenever you need quality that time go
  1284. 50:11with okay loop agents because if you are
  1285. 50:14using scans of quality agents I will you
  1286. 50:16will see that here time doesn't matter
  1287. 50:18okay we we can wait until our execution
  1288. 50:21is over we only wait for the quality of
  1289. 50:24the output we are getting from the
  1290. 50:25coding agent right so here time doesn't
  1291. 50:27matter so that's why they're using loop
  1292. 50:30agents but if you're worrying about the
  1293. 50:32time especially charge we need a faster
  1294. 50:35response that time we'll be using non
  1295. 50:37loop agents I think you are getting
  1296. 50:39like I'm doing a self projects I will
  1297. 50:41manage that with prompt only but for
  1298. 50:44quality it's required yes okay
  1299. 50:48so one line you can tell in non-loop
  1300. 50:51agents answer once a loop agents work
  1301. 50:53checks improve and repeat
  1302. 50:58yeah we'll we'll do the project okay
  1303. 50:59definitely I'll show you the practical
  1304. 51:01don't worry okay stay with me I'll show
  1305. 51:02you two practical one practical we'll
  1306. 51:04develop with the custom agents we'll
  1307. 51:07create a custom verification. Okay,
  1308. 51:09verifier and one more agents will be
  1309. 51:11creating. Okay, especially see this this
  1310. 51:13thing test sprite we use with the
  1311. 51:15existing existing actually uh um loop
  1312. 51:18agent that means our coding agents
  1313. 51:20either you are using copilot codeex okay
  1314. 51:23or let's say cursor ID then you will be
  1315. 51:24using test plate so both I'm going to
  1316. 51:26show you I'm going to show you
  1317. 51:27application level
  1318. 51:29even I'm also going to show you the
  1319. 51:31existing uh agents we are using how to
  1320. 51:34integrate these things okay this
  1321. 51:36verifier I'm going to show you
  1322. 51:40I will send you Okay, everything don't
  1323. 51:41worry. Okay,
  1324. 51:44now let's take one example of this uh
  1325. 51:46coding agents. Um so sorry uh let's try
  1326. 51:50to take an example of this loop
  1327. 51:52engineering. I'll take this coding agent
  1328. 51:54example. So the agents write the code
  1329. 51:56runs tests. Okay, read the error, fix
  1330. 51:58the codes and runs the test again. Okay,
  1331. 52:01that means in coding agents what
  1332. 52:02happens? You are writing the code, your
  1333. 52:04code is getting verified if found the
  1334. 52:05bugs. Okay, again it will give the
  1335. 52:07feedback again your agents will write
  1336. 52:09that. And once it is fixed you will get
  1337. 52:10the output. Okay. So typical coding loop
  1338. 52:13is issue generate the code run test read
  1339. 52:15errors fix code reset final patch. Okay.
  1340. 52:19Stopping condition all test pass or the
  1341. 52:21agent reaches the maximum number of
  1342. 52:23repair items. Okay. So this is our
  1343. 52:24termination condition here. Okay. Now
  1344. 52:27one example is uh travel planning. Let's
  1345. 52:30say you want to build a very robust
  1346. 52:32travel planner. It will generate a
  1347. 52:35travel travel plan for you. First of all
  1348. 52:37it will check the hotel. It will checks
  1349. 52:39the different different places. It will
  1350. 52:41also check the flight. Okay. So it needs
  1351. 52:43a different verifications. Let's say if
  1352. 52:45I if I'm using aent so there is a
  1353. 52:47possibility it will generate a dummy
  1354. 52:49flight for you. Okay. Let's say this
  1355. 52:51flight doesn't exist. But if I'm using a
  1356. 52:53verify this verify will verify whether
  1357. 52:55this flight is exist or not. If exist
  1358. 52:58okay what time? Okay. What date? Which
  1359. 53:01input? Again it will verify everything.
  1360. 53:03Then it will give you the final
  1361. 53:05responses.
  1362. 53:10Okay. So as you can see um loop checks
  1363. 53:14is within the budget are dates valid is
  1364. 53:17travel time realistic are hotels
  1365. 53:20available does it follow user
  1366. 53:22constraint? Okay. So these are the
  1367. 53:24checks it will do in the loop itself. If
  1368. 53:27it is matches then you will be uh
  1369. 53:29getting the final uh travel planning uh
  1370. 53:33output otherwise this loop will
  1371. 53:34continuously run unless and until you
  1372. 53:37are getting this particular response.
  1373. 53:41Okay
  1374. 53:44H
  1375. 53:51now let's do the final recap. As you can
  1376. 53:54see in loop engineering um we'll do
  1377. 53:58definitely the looping concept. So
  1378. 54:00whatever things we have learned so far
  1379. 54:02the non loop okay the basically it
  1380. 54:04answer once and stop use for simple and
  1381. 54:08lowest task and loop work check improve
  1382. 54:12and repeat until the result passes.
  1383. 54:14Evaluator will evaluate the quality of
  1384. 54:17the answer we are getting. You can even
  1385. 54:20add the guardrails okay if you want.
  1386. 54:22Let's say nowadays people are also
  1387. 54:23integrating guardrails safety right uh
  1388. 54:26to prevent the violation okay or let's
  1389. 54:28say any kinds of sexual content or let's
  1390. 54:30say any kinds of harmful content okay so
  1391. 54:33they're using guardrails to prevent that
  1392. 54:36you can either integrate guard this is
  1393. 54:38optional okay but if you're creating
  1394. 54:40agent application I'll suggest you also
  1395. 54:41use the guards here then definitely
  1396. 54:43there would be a stopping conditions
  1397. 54:45that means your agent should not be
  1398. 54:48infinite okay infinite loop there would
  1399. 54:51be some kinds of stopping conditions.
  1400. 54:56H evaluation is a later step. Uh I mean
  1401. 55:00after creating your agents you can do
  1402. 55:02the evaluations but guards should be
  1403. 55:03added. Okay, guards is important here.
  1404. 55:06So that's why there is another PP you
  1405. 55:08can see guards inside the loop. If you
  1406. 55:10want you can add a guards. Okay, guard
  1407. 55:12means whether the content you are
  1408. 55:15getting from the user this is safe or
  1409. 55:17not. Okay, this is safe to execute or
  1410. 55:19not. So this is what actually you have
  1411. 55:21to add inside the guardrails.
  1412. 55:24Great. H So yes uh this is all about our
  1413. 55:28loop engineering understanding at least
  1414. 55:32on the theoretical level. Now guys are
  1415. 55:35you clear the entire concept I told you
  1416. 55:38about this loop engineering. If you are
  1417. 55:39clear then I will go to the practical
  1418. 55:41implementation right now.
  1419. 55:45guardrails rule is that let's say if
  1420. 55:48user is giving one input so let's say
  1421. 55:50I'll take this example
  1422. 55:53okay let's say you are using the coding
  1423. 55:55agent okay you are using a coding let's
  1424. 55:57say you are using uh client desktop or
  1425. 56:00sorry uh not you are using let's say
  1426. 56:02co-pilot Microsoft copilot okay so now
  1427. 56:06you're telling Microsoft copilot to
  1428. 56:09write a code to hack Google platform now
  1429. 56:13tell me will your Hope it will write
  1430. 56:16that code for you. Just try it right now
  1431. 56:18and tell me definitely you will see that
  1432. 56:20it will tell no I can't help you with
  1433. 56:22that. It doesn't meet with our
  1434. 56:25guardrails. Right? It doesn't meet with
  1435. 56:28our policy.
  1436. 56:30This is what your guardrails. That means
  1437. 56:33if you're doing any kinds of illegal
  1438. 56:35related task, if you're giving any kinds
  1439. 56:37of illegal related prompt which is
  1440. 56:39having a violation which is having uh
  1441. 56:42let's say
  1442. 56:44um I mean uh harmful related content. So
  1443. 56:47these kinds of work your agents will not
  1444. 56:50work. Okay. This is called actually
  1445. 56:52guardress. The role of the address
  1446. 57:00it's provides security on the AI
  1447. 57:03generated things. Yes, exactly.
  1448. 57:07Yeah.
  1449. 57:10Okay.
  1450. 57:11H
  1451. 57:14now I will go to the practical uh
  1452. 57:17development. First of all, we'll try to
  1453. 57:19develop this this architecture. Okay,
  1454. 57:23first of all, we'll work on this this
  1455. 57:24architecture. That means here we'll try
  1456. 57:27to create a multi- aent system and here
  1457. 57:29we'll try to write a verification
  1458. 57:32agents. Okay. So, whatever answer,
  1459. 57:35whatever result we'll be getting from
  1460. 57:37our agents first of all, we'll verify
  1461. 57:38that if this verification meets then
  1462. 57:41we'll continue otherwise we'll give the
  1463. 57:43feedback to the agents again. Okay. So
  1464. 57:45for this example I'm going to take one
  1465. 57:48uh very simple example uh so that
  1466. 57:50everyone can understand because I know
  1467. 57:51that in this webinar there are different
  1468. 57:53types of learners are available. Some of
  1469. 57:56the learners are completely beginners.
  1470. 57:57Some of the learners are intermediate.
  1471. 57:59Some of the learners are advanced. Okay.
  1472. 58:00So I have to take uh take care everyone.
  1473. 58:02So that's why I'll take a very simple
  1474. 58:04example. We'll be creating a blog
  1475. 58:06writing agents. Okay. We'll be creating
  1476. 58:08a blog writing agents multi- aent blog
  1477. 58:10writing agents and there we'll try to
  1478. 58:11integrate this agentic loop. Okay. And
  1479. 58:14even after that I'm going to show you
  1480. 58:16this application level verification as
  1481. 58:18well. Let's say if you're using
  1482. 58:20Microsoft VS code. Let's say uh I think
  1483. 58:23you use VS code right.
  1484. 58:26Let's say this is our VS code. So in VS
  1485. 58:28code you have the agents as well. Right?
  1486. 58:30Here we give the prompt and this uh uh
  1487. 58:33copilot will generate the code for me.
  1488. 58:36So this is one kinds of coding agents.
  1489. 58:38Then you will be using cursor ID codeex
  1490. 58:40right
  1491. 58:42code. So these are the coding agents. So
  1492. 58:44how we can utilize test sprite as a
  1493. 58:46verifier in this kinds of existing uh
  1494. 58:49agentic applications? We'll also try to
  1495. 58:51see this example as well. Okay, both
  1496. 58:52example I'll show you first of all this
  1497. 58:54example then this example. Okay, we'll
  1498. 58:56try to see both example.
  1499. 58:59Okay fine. So for this let's try to uh
  1500. 59:02create a folder here. So I'm going to
  1501. 59:04create a folder and I'm going to name it
  1502. 59:07as let's say uh
  1503. 59:14I'm going to name it as let's say
  1504. 59:17loop agent
  1505. 59:22okay sale correcting agent whatever name
  1506. 59:24you can give it's up to you here I'm
  1507. 59:26going to open up my terminal
  1508. 59:34And I'm going to open up my visual code
  1509. 59:36studio here.
  1510. 59:44H So I believe everyone is having VS
  1511. 59:46Code Anaconda installed in your system.
  1512. 59:48Yes or no? I'm expecting you have these
  1513. 59:50are the tools, right? These are the
  1514. 59:53things are common. I'm not going to
  1515. 59:54repeat it again. Okay.
  1516. 1:00:09H. [clears throat]
  1517. 1:00:19Okay. Now see guys uh the agents I'm
  1518. 1:00:21going to develop. Uh first of all let me
  1519. 1:00:24show you the architecture.
  1520. 1:00:30So this is the agents I'm going to
  1521. 1:00:31develop
  1522. 1:00:33save correcting multi- aent system with
  1523. 1:00:37the help of loop engineering. So this is
  1524. 1:00:39the architecture. So he here user will
  1525. 1:00:41give a questions. Okay that means the
  1526. 1:00:43blog topic
  1527. 1:00:45and what will happen
  1528. 1:00:48uh this will go to the writing agents.
  1529. 1:00:50Okay writing agents will write that.
  1530. 1:00:52Okay, see for the simpler purpose here
  1531. 1:00:54I'm not going to add any kinds of tools.
  1532. 1:00:56You can integrate any kinds of tool if
  1533. 1:00:58you want. You can integrate any internet
  1534. 1:01:00search tool which is tably SAR API.
  1535. 1:01:03Okay, you can use anything but for the
  1536. 1:01:05simpler purpose I'm going to directly
  1537. 1:01:06invoke the large language model to
  1538. 1:01:08generate the content for us. Okay, then
  1539. 1:01:10what will happen? This writer agents
  1540. 1:01:13will write something and this is our uh
  1541. 1:01:16verifier. Okay, this agents will be
  1542. 1:01:18creating for the verification. That
  1543. 1:01:20means whatever writer agent is writing
  1544. 1:01:23before I give this particular content to
  1545. 1:01:26to my uh let's say user first of all
  1546. 1:01:30I'll try to give to the reviewer agents
  1547. 1:01:32reviewer agents will try to review that
  1548. 1:01:34okay it will try to verify that whether
  1549. 1:01:37this written content is good or not now
  1550. 1:01:40definitely there should there should be
  1551. 1:01:42some kinds of condition will add what
  1552. 1:01:44kinds of what kinds of let's say blog I
  1553. 1:01:47want what kinds of content I want from
  1554. 1:01:48the writing agents. Let's say someone
  1555. 1:01:50pref someone will prefer beginner
  1556. 1:01:53friendly more clear. It will also have
  1557. 1:01:56the examples. Okay. So these are the
  1558. 1:01:58let's say my rules. Okay. Whenever I
  1559. 1:02:01want to generate some kinds of content
  1560. 1:02:02from my agents, I should have some kinds
  1561. 1:02:05of rules. Let's say every time whatever
  1562. 1:02:07content it is generating, it should have
  1563. 1:02:09a beginner friendly okay beginner
  1564. 1:02:11friendly
  1565. 1:02:13discussion. It will also have some kinds
  1566. 1:02:15of example. Okay. It will also have some
  1567. 1:02:18kinds of let's say code example any
  1568. 1:02:21kinds of rules you can assign here. So
  1569. 1:02:23my reviewer agents will try to review
  1570. 1:02:25that whether it is meet uh meeting that
  1571. 1:02:27particular criteria or not. If it is
  1572. 1:02:30meeting the criteria this will pass that
  1573. 1:02:31that means user will able to see the
  1574. 1:02:33final answer. Okay. Otherwise what will
  1575. 1:02:36happen? It will send this particular
  1576. 1:02:39okay it will send this particular
  1577. 1:02:40feedback to the revi uh revisor agent
  1578. 1:02:44again. Okay. Either you can directly
  1579. 1:02:46send to the writer again agent again but
  1580. 1:02:48you can also create a different agent
  1581. 1:02:50for that for the revision operation that
  1582. 1:02:52means whatever writer agent has done
  1583. 1:02:54some mistake you already captured inside
  1584. 1:02:57this writer agents okay so reviewer
  1585. 1:02:59agents that means all of the feedback
  1586. 1:03:01now this feedback you are giving to the
  1587. 1:03:02another agents called re reviser agent
  1588. 1:03:05okay reviser will try to revise that
  1589. 1:03:06that means whatever content I generated
  1590. 1:03:09again I'll try to improve that okay
  1591. 1:03:11based on the feedback after improving
  1592. 1:03:13that I'll try to I'll try to send to the
  1593. 1:03:18reviewer. Okay, reviewer will again try
  1594. 1:03:20to review. Again, it will check whether
  1595. 1:03:22this particular things are perfect or
  1596. 1:03:24not. If perfect, it will give you the
  1597. 1:03:25final answer. Otherwise, again, it will
  1598. 1:03:27give the feedback to the revisor agents.
  1599. 1:03:29That mean this is the loop we are
  1600. 1:03:30creating here. I think you can see this
  1601. 1:03:32is the loop guys here. Okay. Now,
  1602. 1:03:34instead of reviser agent, you can
  1603. 1:03:35directly also pass to the writer agents.
  1604. 1:03:37But here, I'm going to create a reviser
  1605. 1:03:38agent. Okay. This is completely your
  1606. 1:03:41design philosophy. Okay. You can either
  1607. 1:03:43keep only one agent either you can keep
  1608. 1:03:45multiple agents. You are designing your
  1609. 1:03:47own agents. Okay. So the way I'm
  1610. 1:03:49creating it's not necessary to create
  1611. 1:03:51it. Okay. You can also change this
  1612. 1:03:53architecture as per your requirement.
  1613. 1:03:55Okay. So here what is the stop condition
  1614. 1:03:58reviewer get it passed that means once
  1615. 1:04:00it is passed either maximum revision
  1616. 1:04:02limits. Okay. We'll try to add the
  1617. 1:04:03iteration limits. Let's say after five
  1618. 1:04:06iteration if we are not able to get the
  1619. 1:04:08output whatever final output we got
  1620. 1:04:11we'll try to show as a final answer
  1621. 1:04:13answer okay so this is what our stop
  1622. 1:04:15condition is here
  1623. 1:04:17so are you clear guys with this
  1624. 1:04:18architecture yes or no tell me clear
  1625. 1:04:21this architecture you are getting the
  1626. 1:04:24loop condition you are getting now let's
  1627. 1:04:26try to implement with the help of lang
  1628. 1:04:27graph okay I'll be using lang graph
  1629. 1:04:29framework to implement this particular
  1630. 1:04:31agents now how many of your family with
  1631. 1:04:33lang graph here guys tell
  1632. 1:04:35Lang graph is a aentk orchestration
  1633. 1:04:37framework. Okay. With the help of
  1634. 1:04:38langraph we create aentk applications.
  1635. 1:04:41Okay. If you are not famili familiar
  1636. 1:04:42guys I think on krishna academy there
  1637. 1:04:45are different different courses
  1638. 1:04:46different different tutorials are
  1639. 1:04:47available on the langraph. You can go
  1640. 1:04:49ahead with that. Okay.
  1641. 1:04:51I think it will help you a lot to
  1642. 1:04:53understand. Again uh I'm going to
  1643. 1:04:55explain in a simpler manner. I think you
  1644. 1:04:57will try to understand.
  1645. 1:04:59Fine. So let's try to use langraph to
  1646. 1:05:01implement this uh this self correcting
  1647. 1:05:04multi-agent system. Okay. So for this
  1648. 1:05:06I'm going to open up my VS code and here
  1649. 1:05:08first of all I'm going to do the project
  1650. 1:05:10setup. Okay. So first of all here I'm
  1651. 1:05:13going to uh write a readme file.
  1652. 1:05:16Here I'm going to show you all the
  1653. 1:05:18commands you need to execute.
  1654. 1:05:21First of all you have to create the
  1655. 1:05:22environment. Okay. So contact create
  1656. 1:05:24rate.
  1657. 1:05:25You can also use UV but I'm going to use
  1658. 1:05:27cond
  1659. 1:05:29N. You can give the environment name.
  1660. 1:05:31Let's say I'll give agent.
  1661. 1:05:35Okay.
  1662. 1:05:37Agent test or anything you can give.
  1663. 1:05:40Then you can take the Python. Let's say
  1664. 1:05:41Python is equal to uh 3
  1665. 1:05:4511. Okay. Or you can also take it as a
  1666. 1:05:48demo. Okay. It's up to you. Any kinds of
  1667. 1:05:49name you can take from here and you can
  1668. 1:05:51give the yes permission. So this is what
  1669. 1:05:53you have to execute to create the
  1670. 1:05:54environment for you. Now I'll copy this
  1671. 1:05:57uh okay command and execute from your
  1672. 1:06:00terminal. Okay. So I already have this
  1673. 1:06:02environment guys. I'm not going to
  1674. 1:06:03create but if you don't have you have to
  1675. 1:06:04create this environment. Okay. So after
  1676. 1:06:06creating that you have to activate this
  1677. 1:06:07environment. So for this you have to
  1678. 1:06:09write this command ponda activate.
  1679. 1:06:12Okay demo.
  1680. 1:06:18So ponda activate demo. So see this is
  1681. 1:06:20our environment I already created. Okay,
  1682. 1:06:22but if you don't have, please try to
  1683. 1:06:23create. Okay, after creating it, you
  1684. 1:06:25have to install the requirement. So,
  1685. 1:06:27let's write pip install
  1686. 1:06:31r requirement.
  1687. 1:06:34Okay, [clears throat]
  1688. 1:06:37requirements
  1689. 1:06:39txt. Okay, so we'll be creating a
  1690. 1:06:41requirement.txt file here
  1691. 1:06:44and inside that I'm going to mention all
  1692. 1:06:46of this requirement I need.
  1693. 1:06:48Yeah, you can also use UV. Okay, there
  1694. 1:06:50is no issue. any kinds of package
  1695. 1:06:52manager you can use. Now here I need
  1696. 1:06:55some of the package guys. So here I'll
  1697. 1:06:57be using these are the package langraph
  1698. 1:06:58langchain. I'll be using gro provider
  1699. 1:07:01guys to access the large language model
  1700. 1:07:03because I know that many people doesn't
  1701. 1:07:04have the open API key. That's why we'll
  1702. 1:07:06be using free model. Okay. Python dnb to
  1703. 1:07:09manage the environment variable. That
  1704. 1:07:10means here we'll try to mention all of
  1705. 1:07:12the API key and everything. Identic for
  1706. 1:07:15the uh structured output. Fast API will
  1707. 1:07:18be also creating a simple user interface
  1708. 1:07:19and backend API with the help of fast
  1709. 1:07:21API. UNO is the dependency package of
  1710. 1:07:24fast API and ginger 2 also dependency
  1711. 1:07:26package of fast API. Okay. Now simply
  1712. 1:07:28you just need to copy this command
  1713. 1:07:30and execute from the terminal. Okay. It
  1714. 1:07:32will install all of the necessary
  1715. 1:07:34package in your environment. So for me
  1716. 1:07:36it is already uh telling it's satisfied.
  1717. 1:07:38Okay. One thing you will be doing which
  1718. 1:07:40is you have to take the version of the
  1719. 1:07:42package. Okay. Otherwise, if you're
  1720. 1:07:44running this project after uh let's say
  1721. 1:07:46one month, there is a possibility this
  1722. 1:07:48project should not be run because there
  1723. 1:07:50should be some kinds of dependency
  1724. 1:07:52change. That's why always you have to
  1725. 1:07:53track the version. So for this you can
  1726. 1:07:55write pip list and you can check the
  1727. 1:07:57version. Okay. So these are the version
  1728. 1:07:59just try to take one by one and add it
  1729. 1:08:02here. Do pip freeze operation because
  1730. 1:08:05pip freeze actually saves all of these
  1731. 1:08:07package but I don't want that. I only
  1732. 1:08:09want to add the version I'm using here.
  1733. 1:08:11Add the package I'm using here. Let's
  1734. 1:08:13say lang graph. Okay. So for lang graph
  1735. 1:08:15I'm using this version. So I'll copy
  1736. 1:08:16this version and add it here.
  1737. 1:08:20Now find for langen.
  1738. 1:08:23For langen
  1739. 1:08:26I'm using this version. Copy that. Add
  1740. 1:08:29it here. So this looks like more clean.
  1741. 1:08:31Okay. I like this approach. Okay. Then
  1742. 1:08:34langen gro.
  1743. 1:08:36Lenchen gro. Langen. Lenchen.
  1744. 1:08:39Langen gro. I'll copy this.
  1745. 1:08:42and add it here.
  1746. 1:08:45Okay, I think I have done some mistake.
  1747. 1:08:48Lang chin growth 1.1.3. Copy that and
  1748. 1:08:52add it here.
  1749. 1:08:55Now, Python envy
  1750. 1:08:58Python.v Python. Env this one.
  1751. 1:09:06Yeah. Pip list.
  1752. 1:09:09Then identic
  1753. 1:09:20past API
  1754. 1:09:31then econ
  1755. 1:09:39And last we have ginger too.
  1756. 1:09:51Okay. Yeah. So I have captured all of
  1757. 1:09:53the version. Okay. Now this is more
  1758. 1:09:55clear enough. Okay. Instead of preap
  1759. 1:09:57phrasing I only have uh mentioned those
  1760. 1:10:00are the package actually I'm using here.
  1761. 1:10:02Langen uh verb is not copied properly.
  1762. 1:10:06Langen. Okay. Uh let me check. Lenin.
  1763. 1:10:09Langen. Lenin. Okay. A good observation.
  1764. 1:10:11I'll copy this and mention it here.
  1765. 1:10:14Okay. Now I think it looks good, right?
  1766. 1:10:16Yeah. So now you just keep it this
  1767. 1:10:18requirement with you. So if you're
  1768. 1:10:20running this project after one year
  1769. 1:10:21also, there should not be any kinds of
  1770. 1:10:22problem because you have already
  1771. 1:10:24captured the version. Okay. Fine. Now
  1772. 1:10:28next thing guys, I have to collect the
  1773. 1:10:29API key. So here I need some API key
  1774. 1:10:31guys. Uh I need actually these are the
  1775. 1:10:34informations. Yeah, first of all you
  1776. 1:10:36need Gro API key. So here we'll be using
  1777. 1:10:38Gro provider. You can use any kinds of
  1778. 1:10:40provider. You can use Gemini, Open AI,
  1779. 1:10:42open router, anything you can use but
  1780. 1:10:44I'm going to use Gro Gro API here. And
  1781. 1:10:47Grock model wise I'm going to use Lama
  1782. 1:10:483.37 billion versatile model and max
  1783. 1:10:52revisions. Okay. Now can anybody tell me
  1784. 1:10:54what is this max revision parameter? I
  1785. 1:10:56think you can see the architecture this
  1786. 1:10:58stop condition maximum revision that
  1787. 1:11:00means limit let's say if my reviewer uh
  1788. 1:11:04let's say if my writer agents or let's
  1789. 1:11:06say revision agents is not able to write
  1790. 1:11:08the content properly okay after two
  1791. 1:11:12revision that means two iteration okay
  1792. 1:11:15it will stop the condition uh sorry it
  1793. 1:11:17will stop the loop because I have I have
  1794. 1:11:19added the maximum revision here okay but
  1795. 1:11:22in real world this maximum iteration
  1796. 1:11:24should be a little bit bigger but for
  1797. 1:11:25example Example, I have only taken two
  1798. 1:11:27here. Okay, after two iteration, it will
  1799. 1:11:29stop. But in real world, you have to
  1800. 1:11:31take a little bit more iteration here at
  1801. 1:11:34least 20, 30, 40, 50. Okay, you have to
  1802. 1:11:37take this kinds of iteration.
  1803. 1:11:39Okay, this is our safer purpose for the
  1804. 1:11:41safer purpose. But there's a possibility
  1805. 1:11:44our uh revisor agents will revise based
  1806. 1:11:47on the feedback and it will generate
  1807. 1:11:49something good for okay, good for the
  1808. 1:11:51user and this particular check would be
  1809. 1:11:53pass. Okay, we are expecting but in case
  1810. 1:11:55if it is failing that time it will
  1811. 1:11:58depend upon the maximum revision uh
  1812. 1:12:00stopping condition that time. Okay, so
  1813. 1:12:02these are the informations we have put
  1814. 1:12:04inside my now let's collect this GO API
  1815. 1:12:07key. Now how to collect the GO API key
  1816. 1:12:09guys? Very simple. Uh you have to go to
  1817. 1:12:11the Gro platform.
  1818. 1:12:14Gro API key
  1819. 1:12:18search for Gro API key. Go to the first
  1820. 1:12:20website and make sure you create one
  1821. 1:12:22account. I already have the account
  1822. 1:12:24guys. Here you have to create an API
  1823. 1:12:25key. Okay. So I already have created
  1824. 1:12:27this API key and if you don't have you
  1825. 1:12:29just create it here. Okay. So I already
  1826. 1:12:30have the API key. I'm not going to
  1827. 1:12:32create again. Okay. But don't use my API
  1828. 1:12:34key guys. I'm going to remove after this
  1829. 1:12:36session only. Okay. And here I'm using
  1830. 1:12:38this model. Now how you can get the
  1831. 1:12:39model? Go to the playground. Expand it
  1832. 1:12:42here. Now you are having different
  1833. 1:12:43different model. Which model you like?
  1834. 1:12:44Just try to select here. Let's say I'm
  1835. 1:12:46using this model. I just copied this ID
  1836. 1:12:48and paste it at here. Okay.
  1837. 1:12:51Get it guys?
  1838. 1:12:54Yeah. Now I'll be creating some more
  1839. 1:12:56folder. Uh I'll be creating uh first of
  1840. 1:12:59all I'll be creating a file called
  1841. 1:13:01backend.py
  1842. 1:13:07and app.py.
  1843. 1:13:10Okay. Then I'll be also creating user
  1844. 1:13:12interface. We'll be using fast API. For
  1845. 1:13:14this I need templates folder.
  1846. 1:13:19I also need static folder.
  1847. 1:13:23How many you know about
  1848. 1:13:26uh this one first API guys? If you know
  1849. 1:13:29first API I think you know that whatever
  1850. 1:13:31I'm writing right static templates you
  1851. 1:13:33know that. So inside templates we keep
  1852. 1:13:36our HTML code
  1853. 1:13:39index HTML. This is the page
  1854. 1:13:43and static we keep our CSS design and
  1855. 1:13:46JavaScript
  1856. 1:13:48style
  1857. 1:13:51dot CSS
  1858. 1:13:54and uh
  1859. 1:13:56app dot js and again if you're doing
  1860. 1:13:59front end development guys don't worry
  1861. 1:14:01you can take the help from ch and you
  1862. 1:14:02can create this user interface okay but
  1863. 1:14:05in company there are different uh job
  1864. 1:14:07role for that front- end developer they
  1865. 1:14:09will basically take care part this part
  1866. 1:14:11for you. Okay. So here I'll be creating
  1867. 1:14:13a very simple user interface. Even I
  1868. 1:14:15have also taken the help from chart GP
  1869. 1:14:17to create this user interface. Okay.
  1870. 1:14:18HTML CSS code. If you don't know it's
  1871. 1:14:20completely fine.
  1872. 1:14:22Yeah.
  1873. 1:14:26Now first of all let's write our backend
  1874. 1:14:28file because this should be my main
  1875. 1:14:30agentic workflow. Okay.
  1876. 1:14:33H [cough]
  1877. 1:14:34[clears throat]
  1878. 1:14:37Okay. So first of all here we'll try to
  1879. 1:14:39import all of the necessary library. So
  1880. 1:14:44these are the necessary necessary
  1881. 1:14:45libraries guys I need. I need um
  1882. 1:14:49just a media I need operating system. I
  1883. 1:14:52need uh uh literal type dictv
  1884. 1:14:56chat gro from langen grog. Then from
  1885. 1:14:59lang graph I'm importing end start and
  1886. 1:15:02state graph. Okay. So definitely you
  1887. 1:15:04should have knowledge on lang graph
  1888. 1:15:05otherwise this session might be little
  1889. 1:15:06bit confusing to you. Uh that's why I uh
  1890. 1:15:10strongly recommend after this session
  1891. 1:15:12please try to complete the langraph at
  1892. 1:15:13least like how langraph works. Okay,
  1893. 1:15:16what is the syntax? Just try to study
  1894. 1:15:17about. Okay, now from importing base
  1895. 1:15:20model and field. These are the things
  1896. 1:15:22are required
  1897. 1:15:25uh GitHub repo uh I'm going to create.
  1898. 1:15:27Okay, first of all, let me complete the
  1899. 1:15:29implementation. After that, I'm going to
  1900. 1:15:30share you the source code. Okay, don't
  1901. 1:15:32worry about that. Okay, I'm going to
  1902. 1:15:34share each and everything. But first of
  1903. 1:15:36all, just try to be with me and try to
  1904. 1:15:37learn everything.
  1905. 1:15:39Okay, now I'll load my invement
  1906. 1:15:42variable.
  1907. 1:15:44So this is my environment variable. I'm
  1908. 1:15:46loading it.
  1909. 1:15:49Okay. After that we'll try to load my
  1910. 1:15:52model as well as the maximum revision
  1911. 1:15:54from my environment variable. So this is
  1912. 1:15:56the syntax for that. OS.get env. I'm
  1913. 1:15:59loading my groth model and I'm also
  1914. 1:16:01loading my maximum iterations. Okay.
  1915. 1:16:03Even I'm also giving the default value
  1916. 1:16:04in case let's say you haven't mentioned
  1917. 1:16:06these are the var uh values here. So it
  1918. 1:16:09will use that default one. Okay. at that
  1919. 1:16:11time.
  1920. 1:16:13Now we'll try to define a model. So here
  1921. 1:16:16we'll be using this group provider. We
  1922. 1:16:20are giving the model ID, temperature and
  1923. 1:16:23API key. Whatever API key we're loading.
  1924. 1:16:25Okay. API key. I think uh
  1925. 1:16:28huh. So we are loading it here. W.get
  1926. 1:16:30env. Okay. We are loading the API key
  1927. 1:16:32here as well.
  1928. 1:16:35Get it.
  1929. 1:16:38H
  1930. 1:16:41now those who already know lang graph
  1931. 1:16:45right in lang graph the first thing we
  1932. 1:16:47have to create which is state
  1933. 1:16:50okay state means let's say
  1934. 1:16:54uh I'll go to the architecture yeah
  1935. 1:16:59[clears throat]
  1936. 1:17:02I I'll share this code after the
  1937. 1:17:04implementation okay uh first of all try
  1938. 1:17:06to see the implementation after the
  1939. 1:17:07implementation I'm going to share this
  1940. 1:17:09code with you. Don't worry. So see every
  1941. 1:17:12agents every nodes will return some
  1942. 1:17:16kinds of output. Okay. To save this
  1943. 1:17:18output I need a state here in langraph
  1944. 1:17:20we call it as a state state memory.
  1945. 1:17:22Okay. So here we'll try to prepare the
  1946. 1:17:24state right now. So these are the state
  1947. 1:17:28I need.
  1948. 1:17:31First of all I need a topic draft
  1949. 1:17:34feedback decision revision. Okay, let me
  1950. 1:17:37explain what I have written here. See
  1951. 1:17:39topic. Topic means whatever topic user
  1952. 1:17:42will provide. Let's say user has
  1953. 1:17:43provided agentic AI. Okay, this is the
  1954. 1:17:46topic. Based on that, our writer agents
  1955. 1:17:49will write something, right? So this
  1956. 1:17:50topic information will save in this
  1957. 1:17:52particular topic state and the type
  1958. 1:17:54should be string type. Now we have
  1959. 1:17:56draft. Okay, draft means whatever my
  1960. 1:17:59writer agents will write on top of the
  1961. 1:18:01agent TKI, this is called draft. So this
  1962. 1:18:04draft result will try to save inside the
  1963. 1:18:06draft variable draft state memory. Again
  1964. 1:18:09the type should be string. Now the
  1965. 1:18:11feedback okay feedback means my reviewer
  1966. 1:18:15will generate some kinds of feedback
  1967. 1:18:16whether this particular written is good
  1968. 1:18:18or bad. This feedback will try to save
  1969. 1:18:21while inside the feedback variable.
  1970. 1:18:23Again the type should be string. Okay.
  1971. 1:18:25Now decision. Okay. Decision means our
  1972. 1:18:28reviewer agents will also give me some
  1973. 1:18:29kinds of decision. Okay. Decision means
  1974. 1:18:32whether this particular written should
  1975. 1:18:35be pass or revised. If it is pass that
  1976. 1:18:38means your user will getting the final
  1977. 1:18:40response. If it is revised that means it
  1978. 1:18:42will go to the revise agent again. So
  1979. 1:18:44this is called decision. So this is
  1980. 1:18:45decision pass or fail will try to save
  1981. 1:18:47inside the decision variable. Again this
  1982. 1:18:49should be string. Okay. Now the revision
  1983. 1:18:52count. Revision count means how many
  1984. 1:18:54time this loop is running. This
  1985. 1:18:56information will save while in the
  1986. 1:18:58revision count because here I have to
  1987. 1:19:00save the maximum revision. Okay, I think
  1988. 1:19:02you have already saw that maximum
  1989. 1:19:04revision I have added two that means how
  1990. 1:19:07many times my loop is running this
  1991. 1:19:09information should be saved inside my
  1992. 1:19:10revision count and this should be
  1993. 1:19:12integer type. Clear guys this state
  1994. 1:19:15definition is clear all of you. This is
  1995. 1:19:18called state memory in langraph.
  1996. 1:19:25You can increase the temperature
  1997. 1:19:26parameter. It's the creativity
  1998. 1:19:28parameter. You can either keep it to
  1999. 1:19:30zero. Either keep it to one. It's up to
  2000. 1:19:31you. But I have kept to zero only. I
  2001. 1:19:34don't want my let's say uh agent to more
  2002. 1:19:37creative. Okay. I want like the
  2003. 1:19:39authentic output. That's why I given
  2004. 1:19:40that. Yeah. Clear guys. This state
  2005. 1:19:44definition is clear. And definitely uh
  2006. 1:19:47if you have little bit of knowledge on
  2007. 1:19:49the langraph this uh code would be
  2008. 1:19:52completely um I mean easy for you. But
  2009. 1:19:54if you are completely first to the
  2010. 1:19:56langraph it might be little bit
  2011. 1:19:58confusing but I strongly recommend try
  2012. 1:20:00to learn the langraph. Okay. Yeah.
  2013. 1:20:02Because langraph is the most demandable
  2014. 1:20:05orchestration framework nowadays in the
  2015. 1:20:07market. So try to master the langraph as
  2016. 1:20:09soon as possible. Okay. If you want to
  2017. 1:20:11be a engineer. So fine guys we have
  2018. 1:20:14already created all of the state all the
  2019. 1:20:16utility variable we have created now
  2020. 1:20:19we'll try to work on the agent okay now
  2021. 1:20:21the first agent guys we'll try to create
  2022. 1:20:23the writer agent
  2023. 1:20:26type we need to uh to let's say define
  2024. 1:20:29the state here see here okay type dick
  2025. 1:20:33means this is a dictionary type we have
  2026. 1:20:35defined this is the key this is the
  2027. 1:20:36value this is the key this is the value
  2028. 1:20:38so whenever it will save the information
  2029. 1:20:40in the memory it will save as a
  2030. 1:20:41dictionary that's why the type is
  2031. 1:20:43dictionary. Okay, we call it as a type
  2032. 1:20:45dict and this type dict we have already
  2033. 1:20:47imported from typing and we have
  2034. 1:20:49inherited in this inside this particular
  2035. 1:20:51class. Get it? This is a Python concept.
  2036. 1:20:56And to define the state we're using
  2037. 1:20:58state function
  2038. 1:21:00uh no you can take this state uh uh
  2039. 1:21:05state class uh as per your requirement.
  2040. 1:21:07You can give any kinds of name but I
  2041. 1:21:09have given state here.
  2042. 1:21:12Now we'll try to create this writer
  2043. 1:21:14agent. Okay, let's try to quickly create
  2044. 1:21:15this writer agent. So I already created
  2045. 1:21:17our writer agent guys. Let me just show
  2046. 1:21:19you this things are very simple. I'm not
  2047. 1:21:22going to create from scratch. See this
  2048. 1:21:24is our writer agent. So writer agent is
  2049. 1:21:27taking this state okay as an input. And
  2050. 1:21:30here in the writer agent guys we are
  2051. 1:21:31directly invoking the model. Okay which
  2052. 1:21:33model? The model we have defined here.
  2053. 1:21:36Okay. Now here we are giving a prompt
  2054. 1:21:38role content. You are a beginner
  2055. 1:21:41friendly teacher. Explain the topic in
  2056. 1:21:44let's say uh 120 or 160 words. Okay. So
  2057. 1:21:48basically we are generating a topic.
  2058. 1:21:50Okay. Topic or blog whatever you can say
  2059. 1:21:52we are generating a topic and this is
  2060. 1:21:54our condition. Just try to generate a
  2061. 1:21:56beginner friendly okay blog for that or
  2062. 1:21:59content for that. Use a simple language
  2063. 1:22:01one everyday analogy and one tiny
  2064. 1:22:04examples. Okay. and whatever user topic
  2065. 1:22:06is giving. Okay. So just try to take the
  2066. 1:22:09topic from the state because inside the
  2067. 1:22:10state we have the topic that's why from
  2068. 1:22:12the state we're taking the topic because
  2069. 1:22:14this is a dictionary type right now.
  2070. 1:22:15Okay. Now based on the topic it will
  2071. 1:22:17generate a content for that particular
  2072. 1:22:21uh topic and it will return the draft
  2073. 1:22:24result. Now this draft we are saving
  2074. 1:22:26inside the draft variable. Okay. And
  2075. 1:22:28apart from that whatever things we have
  2076. 1:22:30like feedback decision, revision we are
  2077. 1:22:31making it as a completely empty because
  2078. 1:22:33at the very first time we don't have
  2079. 1:22:35feedback decision and revision count.
  2080. 1:22:37Okay. These are the things are empty.
  2081. 1:22:38Okay. This is our writer agent is great.
  2082. 1:22:41That means this writer agent we have
  2083. 1:22:42created. Now we'll try to create our
  2084. 1:22:45reviewer agent. Okay. Now we'll try to
  2085. 1:22:47create this verifier guys. This verifier
  2086. 1:22:49again this verifier should be one kinds
  2087. 1:22:51of agent custom agent. Okay. Now see
  2088. 1:22:54here this is my verifier. Very simple.
  2089. 1:22:57This is not a very complex topic guys.
  2090. 1:23:00The agents you are creating the same
  2091. 1:23:01agents only only you just need to making
  2092. 1:23:05it as a verifier in the prompt itself.
  2093. 1:23:06You can tell you have to verify this
  2094. 1:23:08particular result. Okay. Now to verify
  2095. 1:23:11it guys I'm going to use another model
  2096. 1:23:14but in a structured way.
  2097. 1:23:17Have you studied about pientic? Anyone
  2098. 1:23:19here? Pentic I think you know with the
  2099. 1:23:21help of pyic we can generate a
  2100. 1:23:23structured output. So this is what yeah
  2101. 1:23:25we have generated we have written a
  2102. 1:23:27pentic class guys as you can see we have
  2103. 1:23:28in inhited with the base model of
  2104. 1:23:30pientic and here we are telling the
  2105. 1:23:33generated output should be decision and
  2106. 1:23:36feedback okay we are telling our model
  2107. 1:23:38to strictly generate only decision and
  2108. 1:23:41feedback decision means pass or revise
  2109. 1:23:43and feedback means what feedback you
  2110. 1:23:45want to give to the revise agent okay so
  2111. 1:23:48this is what I need from the this agent
  2112. 1:23:51okay this agent and to generate the
  2113. 1:23:53structured output I need this particular
  2114. 1:23:55pyentic class okay but if you're not
  2115. 1:23:58using this pentic class every time your
  2116. 1:23:59large language model will generate
  2117. 1:24:01something new new format but I don't
  2118. 1:24:03want that if you want your agents or llm
  2119. 1:24:06format should be same that time you can
  2120. 1:24:08use pentic class for that okay this is
  2121. 1:24:10called pyic structure or data
  2122. 1:24:12verifications
  2123. 1:24:15okay now this thing we'll be using guys
  2124. 1:24:18this thing we'll try to use but before
  2125. 1:24:20that we'll try to create an object for
  2126. 1:24:22that So this is the object we have
  2127. 1:24:24created here. So reviewer model is equal
  2128. 1:24:27to model with structured output and we
  2129. 1:24:30are giving this identic class. Now this
  2130. 1:24:33object will be using here. Now you can
  2131. 1:24:35see we're using here for the invoke
  2132. 1:24:36operation. Now whatever prompt you will
  2133. 1:24:39give to this particular model. It will
  2134. 1:24:41only give you two things. One is the
  2135. 1:24:43decision, one is the feedback. Get it?
  2136. 1:24:47uh decision means pass or fail and
  2137. 1:24:50feedback means whatever feedback it will
  2138. 1:24:52provide to the revised agent. This is
  2139. 1:24:54how your re reviewer agents. Okay. Now
  2140. 1:24:56inside review agents you can see I
  2141. 1:24:58strictly mentioned you are the strict
  2142. 1:25:00reviewer check the answer using only
  2143. 1:25:02this rules. If it is easy for the
  2144. 1:25:05beginner it contains every analogy
  2145. 1:25:07everyday analogy. It consists a tiny
  2146. 1:25:10concrete example. It says focus on the
  2147. 1:25:12requested topic. If any fails okay
  2148. 1:25:15choose revise and give to the uh give
  2149. 1:25:19one or two practice improvement. Okay.
  2150. 1:25:22So here I'm directly mention to the
  2151. 1:25:24reviewer you strictly review or verify.
  2152. 1:25:27Okay. Your task is to verify whatever
  2153. 1:25:31writer agent is giving you. Okay. So
  2154. 1:25:33whatever draft you are getting from the
  2155. 1:25:36writer agents just try to review that
  2156. 1:25:38and give your own feedback. Okay.
  2157. 1:25:40Whether this should be pass or fail and
  2158. 1:25:43what is your feedback on that getting
  2159. 1:25:46guys? This is our verifi.
  2160. 1:25:51Okay. This is our verifier is got it. So
  2161. 1:25:55this verifier we have created right now.
  2162. 1:25:57This verifier
  2163. 1:26:01clear. Now I think this part is clear.
  2164. 1:26:04All of you see this verifier you can
  2165. 1:26:06create anything. You can create either a
  2166. 1:26:08custom agent either you can you simply
  2167. 1:26:12use a large language model but I will
  2168. 1:26:14suggest you to use a agent here that
  2169. 1:26:16would be good for you
  2170. 1:26:25see uh again uh this be out pentic to
  2171. 1:26:29understand you should have knowledge on
  2172. 1:26:30pentic okay because in single session I
  2173. 1:26:32can't cover each and everything I'm
  2174. 1:26:34expecting you know about pentic
  2175. 1:26:36line graph. Okay, these are the things I
  2176. 1:26:38think you should know at least. So after
  2177. 1:26:40this session, please try to check one
  2178. 1:26:42tutorial, small tutorial about pentic. I
  2179. 1:26:45don't think you will have any kinds of
  2180. 1:26:46questions. Okay.
  2181. 1:26:48Yeah. So pentic we use for the uh
  2182. 1:26:52structured output to get from the LLM.
  2183. 1:27:04Okay. Now my reviewer agent is done.
  2184. 1:27:07That means my verifier is done. So here
  2185. 1:27:08let me comment. This is my verifier.
  2186. 1:27:12This is my verifier
  2187. 1:27:18in the loop.
  2188. 1:27:20Okay.
  2189. 1:27:23H. Now we'll try to create this agent
  2190. 1:27:26which is nothing but rei reviser agent
  2191. 1:27:28that means whatever review uh feedback
  2192. 1:27:31it will get based on that it will do the
  2193. 1:27:33improvement of the content. Okay. Now
  2194. 1:27:35let's try to create this agent.
  2195. 1:27:42So this is my revisor agent guys as you
  2196. 1:27:45can see. So here we are uh again inoking
  2197. 1:27:48the model and we're telling you reviser
  2198. 1:27:50improve the answer using the reviewer
  2199. 1:27:53feedback. That means whatever feedback
  2200. 1:27:54we are getting from the reviewer just
  2201. 1:27:56try to use the feedback and improve
  2202. 1:27:58that. Keep it beginner friendly and
  2203. 1:28:00concise. Written only improved answer.
  2204. 1:28:02Okay. So whatever topics and draft we
  2205. 1:28:05got and whatever feedback we got based
  2206. 1:28:07on that it will do the improvement.
  2207. 1:28:09After doing the improvement, okay, it
  2208. 1:28:11will again save the content to the
  2209. 1:28:13draft.
  2210. 1:28:15Get it?
  2211. 1:28:17And that means this part is also done.
  2212. 1:28:20Okay. Now what is left? left is nothing
  2213. 1:28:22but the connection. Okay. Now we have to
  2214. 1:28:24connect all of the agents together. This
  2215. 1:28:26is called connection in line graph.
  2216. 1:28:27Okay. Now we'll try to connect
  2217. 1:28:28everything. We'll create a graph. We'll
  2218. 1:28:31add the nodes and connect the edges.
  2219. 1:28:33Okay. But before that I need to create
  2220. 1:28:34another function. So this function will
  2221. 1:28:36basically route your uh direction. That
  2222. 1:28:40means if your reviewer agent is giving
  2223. 1:28:44pass that means it will directly end
  2224. 1:28:46that particular workflow. That means
  2225. 1:28:48user will get the final answer. But if
  2226. 1:28:49it is written revised that time revise
  2227. 1:28:52agent will be triggered. Okay. So this
  2228. 1:28:53is what we are writing. If our decision
  2229. 1:28:56is pass that time return done otherwise
  2230. 1:28:58okay just try to check the maximum
  2231. 1:29:01revision okay and try the loop okay and
  2232. 1:29:05uh what to return return revise that
  2233. 1:29:07means it will go to the revise again.
  2234. 1:29:10Okay revise will continuously generate
  2235. 1:29:12and improve that particular content.
  2236. 1:29:14Okay once this iteration is done just
  2237. 1:29:16try to break this loop and return done.
  2238. 1:29:18Okay, this is one simple condition we
  2239. 1:29:20have written. Now we have to add inside
  2240. 1:29:22the graph. Lang graph graph. Okay, now
  2241. 1:29:24how to add this lang graph graph? This
  2242. 1:29:27is what we usually write.
  2243. 1:29:29Okay. So state graph we are using this
  2244. 1:29:32function state graph. Inside that we are
  2245. 1:29:35giving the state and we're adding the
  2246. 1:29:38nodes. First of all we are adding the
  2247. 1:29:39writer agent. Writer agent then reviewer
  2248. 1:29:42agent.
  2249. 1:29:45Reviewer agents. Okay. Then we are
  2250. 1:29:47adding the revisor agent. These are my
  2251. 1:29:49agents. Okay, these are my note. After
  2252. 1:29:52that we are doing the connection. Start
  2253. 1:29:53to writer. So start to writer. Writer to
  2254. 1:29:58reviewer.
  2255. 1:30:00Writer to reviewer. Then conditional
  2256. 1:30:02edges. That means if reviewer returns
  2257. 1:30:05if reviewer returns done it will
  2258. 1:30:08directly end the workflow. Otherwise if
  2259. 1:30:10if it is return revise, it will go to
  2260. 1:30:12the revise agent again. So this
  2261. 1:30:15additional conditional ages right
  2262. 1:30:17basically this change the direction that
  2263. 1:30:19means this direction this is the loop if
  2264. 1:30:22it is returns it will directly end
  2265. 1:30:24otherwise it will go to the revise
  2266. 1:30:25agents and this loop will run so this is
  2267. 1:30:27what we are doing here okay then at the
  2268. 1:30:29last we're adding reviser to reviewer
  2269. 1:30:32reviser to reviewer that means it will
  2270. 1:30:34again send for the review operations
  2271. 1:30:36okay so this is our simple graph
  2272. 1:30:39definitions okay inside lang graph and
  2273. 1:30:41we are compiling the graph at the very
  2274. 1:30:44Okay. After that we'll try to run this
  2275. 1:30:46workflow.
  2276. 1:30:48So to run this workflow we'll be using
  2277. 1:30:49one function for that. So this is the
  2278. 1:30:52function we'll be using. Okay. These a
  2279. 1:30:55very simple function we using run the
  2280. 1:30:57workflow. So here what we are doing we
  2281. 1:30:59are first of all generating all of the
  2282. 1:31:01state topics draft feedback decision re
  2283. 1:31:05uh revision count. Now see at the very
  2284. 1:31:06first time only topic would be there.
  2285. 1:31:08These are the things would be completely
  2286. 1:31:09empty. At the very first time whenever
  2287. 1:31:11you are executing your agents there
  2288. 1:31:13should not be any draft feed feedback
  2289. 1:31:15decision. Okay. So that's why these are
  2290. 1:31:17the empty. So every time whenever it
  2291. 1:31:19will run these are the variables should
  2292. 1:31:21be added that time. Okay. Only at the
  2293. 1:31:23very first time topic should be there
  2294. 1:31:25because we are getting the topic from
  2295. 1:31:26the user. Then what we are doing we are
  2296. 1:31:29executing the graph. Okay. This graph
  2297. 1:31:31whatever we have we are executing the
  2298. 1:31:33graph and we are giving the input and
  2299. 1:31:36whatever output we are getting we are
  2300. 1:31:38returning it. That's it. Okay. Now let's
  2301. 1:31:41try to test whether it's working or not.
  2302. 1:31:43Now to test that simply what you can do
  2303. 1:31:46uh either you can also test in your
  2304. 1:31:48terminal
  2305. 1:31:51uh in terminal demo. Let me show you. I
  2306. 1:31:53created another function for this
  2307. 1:31:55terminal. So this is the function you
  2308. 1:31:58can use to check your agents in the
  2309. 1:32:00terminal. So we are invoking this run
  2310. 1:32:02workflows. Okay with the topics and
  2311. 1:32:05we're running it. Okay. Now let me show
  2312. 1:32:07you how this works. So for this I'm
  2313. 1:32:08going to open up my terminal
  2314. 1:32:13and clear it
  2315. 1:32:16python backend.py.
  2316. 1:32:20Now it is asking for the topic. Let's
  2317. 1:32:22say I will give agentic
  2318. 1:32:25AI.
  2319. 1:32:27Enter. Now see guys uh it has configured
  2320. 1:32:31the model everything. Writer agent has
  2321. 1:32:33written something. Reviewer agent
  2322. 1:32:35decision is pass. Okay, they see first
  2323. 1:32:37writer whatever it has written at the
  2324. 1:32:40very first loop my reviewer agent
  2325. 1:32:43selected that that means this particular
  2326. 1:32:44content is good. It is easy to
  2327. 1:32:46understand. It has the example. Okay.
  2328. 1:32:48Whatever constraint we have given in the
  2329. 1:32:50reviewer it is checking everything and
  2330. 1:32:52it is making it as a pass feedback. No
  2331. 1:32:55change needed.
  2332. 1:32:57And this is what our final answer.
  2333. 1:33:00Okay. But if you're giving any complex
  2334. 1:33:03topic
  2335. 1:33:08agentic
  2336. 1:33:10AI
  2337. 1:33:13in advance
  2338. 1:33:19let's say advanc way
  2339. 1:33:27now see guys here multiple revision
  2340. 1:33:29required. So this is the first write
  2341. 1:33:31written
  2342. 1:33:33uh this is the reviewer reviewer it is
  2343. 1:33:36see decision is revised now this
  2344. 1:33:37particular generation it has done this
  2345. 1:33:40is not beginner friendly that means this
  2346. 1:33:42condition is not matching right now
  2347. 1:33:47this condition it not it it's not
  2348. 1:33:49matching okay that's why it is giving
  2349. 1:33:51the suggestion again okay it is giving
  2350. 1:33:53the suggestion the answer provides a
  2351. 1:33:55good analogy and example but it could be
  2352. 1:33:57improved by adding more focus on the
  2353. 1:33:59advance Okay, that means whatever user
  2354. 1:34:01wants. Okay, based on that it is giving
  2355. 1:34:04a feedback again reviewer. So is
  2356. 1:34:07generating something. Okay, again
  2357. 1:34:09reviewer is checking now it is got
  2358. 1:34:11passed. Okay, no change is needed and
  2359. 1:34:12this is the final answer. Get it? Now
  2360. 1:34:15you can see revision used one that means
  2361. 1:34:17one revision required that is one
  2362. 1:34:19iteration happened inside my loop. It is
  2363. 1:34:22yes or no. Tell me yes or no. Are you
  2364. 1:34:25clear this looping concept? How it is
  2365. 1:34:27working?
  2366. 1:34:31Now this is moreable output. Okay, this
  2367. 1:34:33is not a single short generator. This is
  2368. 1:34:35using some kinds of verifier. After
  2369. 1:34:38verification, it is giving me the final
  2370. 1:34:40answer. Although token is getting more
  2371. 1:34:42cost here. But yeah, we are getting some
  2372. 1:34:44reliable output. Now this thing I have
  2373. 1:34:47executed in the terminal. This not locks
  2374. 1:34:49uh this uh not looks good. Now we'll try
  2375. 1:34:51to add a user interface. Okay, simple
  2376. 1:34:54user interface so that you can use it
  2377. 1:34:56from the user interface.
  2378. 1:34:59So for this in the app.py we'll just
  2379. 1:35:01write the fast API code. Guys again
  2380. 1:35:03don't worry if you don't about the fast
  2381. 1:35:05API if you don't know about the HTML CSS
  2382. 1:35:08it's completely fine you can generate
  2383. 1:35:09this code from SGPT. Okay. So only you
  2384. 1:35:11just need to import fast API. So these
  2385. 1:35:15are the libraries are required from fast
  2386. 1:35:17API and we also need to import this
  2387. 1:35:21this this function
  2388. 1:35:24run flow because this is our final
  2389. 1:35:26function. Okay. inside app.py. So I'll
  2390. 1:35:28just write from
  2391. 1:35:31back end
  2392. 1:35:34import
  2393. 1:35:39run workflow.
  2394. 1:35:41Okay, after that we'll try to initialize
  2395. 1:35:45the first API.
  2396. 1:35:48So that's how we initialize the first
  2397. 1:35:49API and make sure you write all of the
  2398. 1:35:51HTML content and CSS everything. Again,
  2399. 1:35:54don't worry about the HTML CSS. you can
  2400. 1:35:56easily generate it from chart GP okay I
  2401. 1:35:58also generated from chart GPT these are
  2402. 1:35:59the things now I'll add the CSS design
  2403. 1:36:03that means the color in gradient okay
  2404. 1:36:05everything in the CSS and some
  2405. 1:36:08JavaScript code to work with my API
  2406. 1:36:12yeah so these are my JavaScript code I
  2407. 1:36:14generated from charg okay now simply
  2408. 1:36:16I'll just add my remaining code
  2409. 1:36:20uh this is the simple fast API route I
  2410. 1:36:22created let me show
  2411. 1:36:26So this is the simple fast API route. So
  2412. 1:36:28this is my home route. That means if
  2413. 1:36:30user hits my application, user will able
  2414. 1:36:33to see the index.html page. Okay. And if
  2415. 1:36:36user hits the API/ run, it will execute
  2416. 1:36:39my
  2417. 1:36:41um function run markflow functions.
  2418. 1:36:43Okay. And we're running on local host
  2419. 1:36:45port number um port number
  2420. 1:36:498,000. And this is running in app.py.
  2421. 1:36:52Pi. So here also I have to provide app.
  2422. 1:36:56Sorry
  2423. 1:37:00app. Okay. App is this to app because
  2424. 1:37:02here I have created the app object.
  2425. 1:37:06Simply you can copy this backend code.
  2426. 1:37:08Okay. You can copy this back end code
  2427. 1:37:10and you can give the chart uh you can
  2428. 1:37:12give to chart GPT uh to generate a user
  2429. 1:37:14interface for this particular project.
  2430. 1:37:16Okay. Charge GP will automatically
  2431. 1:37:17understand what kinds of user interface
  2432. 1:37:19it needs. It will give you these kinds
  2433. 1:37:21of CSS HTML design. Simple. Okay. Now
  2434. 1:37:25let's run and try to check whether
  2435. 1:37:27everything is fine or not. So I'll open
  2436. 1:37:29up my terminal. Clear. Run the Python
  2437. 1:37:32app.py.
  2438. 1:37:34Now this application is running
  2439. 1:37:36localhost port number 8,000. Now I'll go
  2440. 1:37:37to my Google search for localhost port
  2441. 1:37:40number 8,000. Now see that's how my
  2442. 1:37:42application looks like. Is it good guys?
  2443. 1:37:45The interface is good. So again I
  2444. 1:37:47generated from chat GPT but I think it
  2445. 1:37:49looks good. Okay. Yeah. Now simply here
  2446. 1:37:51I have writer agent, reviewer agent,
  2447. 1:37:53reviser agent. Okay. Now let's give a
  2448. 1:37:55topic. Let's say I'll give what is
  2449. 1:37:56agentic AI. Now if I run this loop,
  2450. 1:37:59you'll see that writer agent has written
  2451. 1:38:02something. Reviewer agent has reviewed
  2452. 1:38:05and it got passed because the first
  2453. 1:38:07iteration the content it has generated
  2454. 1:38:10it looks good. Okay. And this is our
  2455. 1:38:12final response. But let now let's try to
  2456. 1:38:14give another one. Let's say what is
  2457. 1:38:16agenti in advance
  2458. 1:38:22add
  2459. 1:38:24advanc
  2460. 1:38:27uh way.
  2461. 1:38:30Now if I run this loop
  2462. 1:38:34now it should do multiple iteration. See
  2463. 1:38:36first of all right agent has written
  2464. 1:38:38something reviewer has reviewed that and
  2465. 1:38:40it got revised. Okay it is telling the
  2466. 1:38:43answer is not easy for the beginner.
  2467. 1:38:44Okay. Again you have to generate
  2468. 1:38:46something. It has generated. Again it
  2469. 1:38:48got reviewed. Okay. Then again it saw
  2470. 1:38:50that this answer is not good. Again it
  2471. 1:38:52needs some revision. Again it generated
  2472. 1:38:54some feedback. Again uh revisor agent
  2473. 1:38:56will generate something. Again it will
  2474. 1:38:58review. Okay. Now see how many iteration
  2475. 1:39:00it has done. Just try to check. Revision
  2476. 1:39:03one, revision two. What was my maximum
  2477. 1:39:06iteration? What was my max maximum
  2478. 1:39:09iteration? Tell me. Two. That means two
  2479. 1:39:11maximum iteration is over. that time
  2480. 1:39:14whatever final answer I got this should
  2481. 1:39:15be my final result okay but if you
  2482. 1:39:18increase it to little bit more let's say
  2483. 1:39:20I'll give I'll give five now let's try
  2484. 1:39:23to see what happens
  2485. 1:39:26I'll give this prompt again
  2486. 1:39:32now see first time
  2487. 1:39:35second time yeah second time it got
  2488. 1:39:37approved only okay so this is what we
  2489. 1:39:40give for the safest purpose if in Yes,
  2490. 1:39:43my loop is not breaking it will break as
  2491. 1:39:45per the maximum iteration otherwise if
  2492. 1:39:49it is matching with the uh reviewer
  2493. 1:39:52rules that time this particular loop
  2494. 1:39:55should be break clear guys yes or no
  2495. 1:39:58tell me I think in the user interface it
  2496. 1:40:01is more clear so how was this project
  2497. 1:40:03how was this example of this loop on
  2498. 1:40:05this loop engineering did you like it
  2499. 1:40:09are you able to understand.
  2500. 1:40:12Yeah, I kept everything simple so that
  2501. 1:40:14everyone can understand.
  2502. 1:40:17Thank you guys.
  2503. 1:40:23Thank you.
  2504. 1:40:27Perfect. And all of the source code I'm
  2505. 1:40:29going to share each and everything. No
  2506. 1:40:30need to worry. I'm going to share you
  2507. 1:40:32each and everything. You can execute
  2508. 1:40:34from your end.
  2509. 1:40:37Yeah. Loop engineering only consist of
  2510. 1:40:38selfcorrection aspect. Yeah, Sharma you
  2511. 1:40:41are right because if it is not doing the
  2512. 1:40:43self-improvement then how it will
  2513. 1:40:45generate the perfect result for you.
  2514. 1:40:47Okay, that's why self-improvement is
  2515. 1:40:49required. So in everyone live also this
  2516. 1:40:52loop engineering concept should be
  2517. 1:40:54included. Okay, everyone live. So if I'm
  2518. 1:40:57running my own live I should have this
  2519. 1:40:58loop that means the verifier. Okay, so
  2520. 1:41:01that whatever work I'm doing I need some
  2521. 1:41:04kinds of feedback so that I can improve
  2522. 1:41:06myself daily basis.
  2523. 1:41:09No, I haven't created a GitHub link, but
  2524. 1:41:11I'll create a GitHub link. Just give me
  2525. 1:41:13a minute. And I'm going to share the
  2526. 1:41:16source code. Let's create one GitHub
  2527. 1:41:18link, guys.
  2528. 1:41:23Repository.
  2529. 1:41:26So, this is my GitHub. You can search
  2530. 1:41:27with the name entpre.
  2531. 1:41:32give
  2532. 1:41:37what I can give
  2533. 1:41:44self-correcting multi-agent system
  2534. 1:41:46that's this name I'll give
  2535. 1:41:59now I'll keep it as public uh addi file
  2536. 1:42:02file uh I think I already have the
  2537. 1:42:05readmi file not required get ignore I'll
  2538. 1:42:08add python we using python and license
  2539. 1:42:11let's take any license let's say I'll
  2540. 1:42:12take apache one and create the
  2541. 1:42:14repository and one thing you can do you
  2542. 1:42:16can uh write the readmi in a good way so
  2543. 1:42:19you can ask your agent to do that uh
  2544. 1:42:24update the readmi file
  2545. 1:42:29for this project
  2546. 1:42:34like and
  2547. 1:42:37open source repo. So it will
  2548. 1:42:40automatically understand my code based
  2549. 1:42:43on that it will write the readmi file
  2550. 1:42:45for me because readmi should be properly
  2551. 1:42:47written otherwise uh nobody can
  2552. 1:42:50understand your project. Okay.
  2553. 1:42:52Yeah.
  2554. 1:42:58See this is what our coding agents now
  2555. 1:43:00see one prompt I have given it is also
  2556. 1:43:02using the agentic loop concept in the
  2557. 1:43:03back end. Now I'm going to show this
  2558. 1:43:05example as well. Okay. How to utilize
  2559. 1:43:07these kinds of coding agents and add a
  2560. 1:43:09verification layer there.
  2561. 1:43:13Yeah. So it is writing the readmi right
  2562. 1:43:15now. It is understanding my project and
  2563. 1:43:17writing the readmi for me. I can also
  2564. 1:43:20write but it will take time. Okay. Line
  2565. 1:43:21by line I have to write everything. I
  2566. 1:43:23don't want that because AI is
  2567. 1:43:25everywhere. Now see readmi has written
  2568. 1:43:27completely properly. See even I can show
  2569. 1:43:30you the preview. Now see now this readmi
  2570. 1:43:33is more readable. Okay. Now let's try to
  2571. 1:43:37commit the changes. I'll click on code.
  2572. 1:43:40Copy the link address. I'll uh open up
  2573. 1:43:43my terminal. Stop the execution. I'll
  2574. 1:43:46just write get clone. Paste the URL.
  2575. 1:43:50Clone it. And inside that
  2576. 1:43:54whatever I have. Okay. Okay, I have to
  2577. 1:43:56also enable the hidden items. Okay, now
  2578. 1:44:00I can see the G folder. Let's copy
  2579. 1:44:02everything and paste it inside my
  2580. 1:44:05project directory and I'll delete this
  2581. 1:44:06folder. Okay, I have opened it in a
  2582. 1:44:11uh what I can do, I can simply close
  2583. 1:44:14this file and now let's delete it. Okay,
  2584. 1:44:18now done. Now I'll open my VS code
  2585. 1:44:21again. Code space dot
  2586. 1:44:29Okay, now let's commit the changes.
  2587. 1:44:32Clear. So, get add space dot then get
  2588. 1:44:39commit-
  2589. 1:44:42m updated code
  2590. 1:44:46then get push
  2591. 1:44:49origin
  2592. 1:44:52main.
  2593. 1:44:55So it has pushed. Now I'll go to my
  2594. 1:44:57GitHub
  2595. 1:45:00and do refresh. Now see my repo is
  2596. 1:45:04updated. Okay. Now I'm going to share
  2597. 1:45:05the URL.
  2598. 1:45:08Uh everyone I'm going to share the URL.
  2599. 1:45:10Now tell me guys, are you able to access
  2600. 1:45:12my GitHub?
  2601. 1:45:17Are you able to open the GitHub?
  2602. 1:45:20Okay. Now keep the code and please try
  2603. 1:45:22to execute in your system as well. Okay.
  2604. 1:45:24And if you found any issue do let me
  2605. 1:45:25know.
  2606. 1:45:29Okay.
  2607. 1:45:34Perfect. Now what I will do guys I'll uh
  2608. 1:45:37simply go to uh show you the next
  2609. 1:45:39example which is this architecture.
  2610. 1:45:42Okay. Now I'm going to use existing
  2611. 1:45:45um agentic uh um agentic application
  2612. 1:45:49that means we'll be using coding agent.
  2613. 1:45:52Uh see I'll be using the VS code agent
  2614. 1:45:54only. You can use also cursor ID then
  2615. 1:45:57codex anything you can use but VS code
  2616. 1:46:00comes up with by default is uh okay uh
  2617. 1:46:03copilot. So I'm going to utilize the
  2618. 1:46:05copilot and we'll try to see how we can
  2619. 1:46:09use test sprite. Okay, test sprite as a
  2620. 1:46:11verifier uh to run the tests and find
  2621. 1:46:15the bugs and how we can fix it
  2622. 1:46:16automatically. Everything we'll try to
  2623. 1:46:18see that.
  2624. 1:46:21Perfect. So let's start with this uh
  2625. 1:46:24second example that means test sprite as
  2626. 1:46:26a verifier. Now first of all let me tell
  2627. 1:46:29you what is test sprite exactly. So you
  2628. 1:46:31can search for test sprite okay.com. So
  2629. 1:46:34this is their platform. So this is
  2630. 1:46:36agentic testing for AI native teams.
  2631. 1:46:38Okay, that means you can test your AI
  2632. 1:46:40users. That means you can use it for the
  2633. 1:46:41verifier. Okay, now they're having uh
  2634. 1:46:46two kinds of like one is the MCP server.
  2635. 1:46:50You can directly use MCP server. Either
  2636. 1:46:52you can use test sprite CLI. Okay, test
  2637. 1:46:55sprite
  2638. 1:46:57uh test sprite cla
  2639. 1:47:01we'll be using. Okay, we'll be executing
  2640. 1:47:03everything from the command line.
  2641. 1:47:10Okay. So this is the CLI. So
  2642. 1:47:14as you can see uh test sprite this is
  2643. 1:47:16the verification layer for the agentic
  2644. 1:47:18agentic coding error. That means if
  2645. 1:47:20you're using any kinds of coding agents
  2646. 1:47:23that time you can use this test sprite
  2647. 1:47:25as a verifier. Okay that means the
  2648. 1:47:27verifier I told you this verifier.
  2649. 1:47:30Please verify that means whatever code
  2650. 1:47:33your agents is generating definitely
  2651. 1:47:35there is a possibility there should be
  2652. 1:47:37some kinds of mistake okay in the code
  2653. 1:47:40see you are using coding agents it's
  2654. 1:47:41completely fine but after using coding
  2655. 1:47:44agent also there is a possibility
  2656. 1:47:46there should be some kinds of bugs your
  2657. 1:47:49application is not working the way you
  2658. 1:47:51are expecting that's why you can use
  2659. 1:47:54test sprite as a verification layer so
  2660. 1:47:56whatever coding agency is writing
  2661. 1:47:58definitely test sprite It needs the live
  2662. 1:48:01application. Okay. So you first of all
  2663. 1:48:03need to deploy this application. Okay.
  2664. 1:48:05And after that you have to give this
  2665. 1:48:07deployment URL to the test pride
  2666. 1:48:08verifier. Now test pride verifier will
  2667. 1:48:11go to the deployment server. It will
  2668. 1:48:12check the application. So I think you
  2669. 1:48:14know right previously we we uh we had to
  2670. 1:48:18head inside company. Have you seen that?
  2671. 1:48:26You will get this resources inside this
  2672. 1:48:28uh uh platform only. Okay, when I have
  2673. 1:48:30already shared you my GitHub URL, so
  2674. 1:48:33this is the GitHub inside that you will
  2675. 1:48:35get all of the resources. Okay,
  2676. 1:48:38uh test sprite is a production grade.
  2677. 1:48:39Okay, it's a production grade platform.
  2678. 1:48:41Okay, so have you seen um previously all
  2679. 1:48:46of the company used to hire tester,
  2680. 1:48:49software tester or AI tester guys? Have
  2681. 1:48:52you seen?
  2682. 1:48:55So what is the work of a tester? Tester
  2683. 1:48:57means they will test the applications.
  2684. 1:48:59Okay. And they will find the bugs.
  2685. 1:49:02So this you can use as a tester inside
  2686. 1:49:04your application. So basically it will
  2687. 1:49:06test the application. If it founds any
  2688. 1:49:08kinds of bugs, it will generate the f
  2689. 1:49:12final uh failure bundles. Okay, failure
  2690. 1:49:14bundles mean it is a snapshot. That
  2691. 1:49:16means where it has the issue, what line
  2692. 1:49:18it has the issue, what is the issue? It
  2693. 1:49:20will give you the complete evidence.
  2694. 1:49:22Okay, this evidence will try to send to
  2695. 1:49:23the coding agents again. Coding agents
  2696. 1:49:25will try to read that again. It will fix
  2697. 1:49:27the code. Again we'll deploy again we'll
  2698. 1:49:29try to run the test sprite test will
  2699. 1:49:32verify the server again it will try to
  2700. 1:49:34find the bugs if bug not found then it
  2701. 1:49:36will pass that otherwise again it will
  2702. 1:49:38generate the failure bundle again it
  2703. 1:49:40will try to send to the coding agents
  2704. 1:49:43okay so this is the loop actually we
  2705. 1:49:44have to create right now now we'll be
  2706. 1:49:47using this sprite verifier as a sorry
  2707. 1:49:49test sprite as a verifier now this is
  2708. 1:49:51the test sprite cla we'll be using for
  2709. 1:49:53that okay now you can see it what is
  2710. 1:49:55test sprite cla So despite is a AI
  2711. 1:49:59testing platform. Uh they have that many
  2712. 1:50:02of teams to use their software front end
  2713. 1:50:04and back end both you can test in the
  2714. 1:50:06cloud against the live product not Mox
  2715. 1:50:08the repo it's official CLI. Okay. Now
  2716. 1:50:11they have already given their quick
  2717. 1:50:13start guide like how to use that how to
  2718. 1:50:15install that everything they have given.
  2719. 1:50:17Uh for this definitely you need NodeJS
  2720. 1:50:19install in your system which is very
  2721. 1:50:21easy. Simply you can copy this and you
  2722. 1:50:23can search over Google NodeJS install or
  2723. 1:50:27download and as per your operating
  2724. 1:50:29system just try to download and install.
  2725. 1:50:31Okay, those are using Windows uh use the
  2726. 1:50:33MSI downloader. If you're using any
  2727. 1:50:35other operating system you can check
  2728. 1:50:37your operating system and you can also
  2729. 1:50:39execute. Okay, so for me I have already
  2730. 1:50:41installed NodeJS. Okay, the first step
  2731. 1:50:43guys you have to install the NodeJS.
  2732. 1:50:46Okay, after installing NodeJS guys, you
  2733. 1:50:49have to install this um install this uh
  2734. 1:50:52test plate CLL. Okay, so I'm going to
  2735. 1:50:54show you step by step everything. First,
  2736. 1:50:56first of all, let me show you the
  2737. 1:50:57application. So, see what I have done
  2738. 1:50:59guys. I already created one application.
  2739. 1:51:02Okay, with the help of my coding agent,
  2740. 1:51:04let me show you this application. So,
  2741. 1:51:06this is the application I created.
  2742. 1:51:09Now, let me show you first of all this
  2743. 1:51:11application how this looks like. Now
  2744. 1:51:13again this application I created with
  2745. 1:51:15the help of NodeJS. Okay NodeJS this is
  2746. 1:51:17the uh web application I created. Let me
  2747. 1:51:20show you
  2748. 1:51:22now you can use any application not
  2749. 1:51:24NodeJ application you can use Python
  2750. 1:51:26application any kinds of agent
  2751. 1:51:27application it's up to you step you have
  2752. 1:51:30to see how we can use this test bit as a
  2753. 1:51:32verifier. Okay, now I'll open up my
  2754. 1:51:34code.
  2755. 1:51:43Let me zoom.
  2756. 1:51:49Yeah. So what I'm doing guys, see I have
  2757. 1:51:52open VS code and I told VS code to
  2758. 1:51:56create a
  2759. 1:51:58uh loop cut application. Do you know
  2760. 1:52:01what is look at application? I think
  2761. 1:52:03those who have already used any
  2762. 1:52:05e-commerce site any purchasing website
  2763. 1:52:07you will see that you will select a
  2764. 1:52:09product after that you will do the check
  2765. 1:52:11check checklist right and if you are
  2766. 1:52:14having a coupon code you can provide the
  2767. 1:52:16coupon code you can get the discount
  2768. 1:52:19have you seen this kinds of application
  2769. 1:52:20guys I think every platform is having
  2770. 1:52:22this kinds of functionality even course
  2771. 1:52:25purchase also whenever you want to
  2772. 1:52:27purchase the course you will have a
  2773. 1:52:28capon code right if you give the capon
  2774. 1:52:30code let's say save 20% you will get 20%
  2775. 1:52:34offer and you will get the final amount.
  2776. 1:52:36Okay, this kinds of application I
  2777. 1:52:37created here. Let me show you. I'll
  2778. 1:52:39first of all run this application and
  2779. 1:52:40let me show you. So to run this
  2780. 1:52:42application guys, uh I already given the
  2781. 1:52:44command in the readmi file. So in the
  2782. 1:52:46readmi everything is available. I'll
  2783. 1:52:49make it as preview. So you have to run
  2784. 1:52:51this command. Okay, but before that you
  2785. 1:52:52have to install NodeJS guys. Okay, the
  2786. 1:52:54way I showed you. So let's copy this
  2787. 1:52:56command and execute from my terminal.
  2788. 1:52:59Now this application is running local
  2789. 1:53:00host uh port number 5173. So this is the
  2790. 1:53:04application
  2791. 1:53:07uh this is the application guys. Look at
  2792. 1:53:09check out. So let's say I have purchased
  2793. 1:53:10one mechanical keyboard and aentic
  2794. 1:53:12engineering book. Let's say this is $60.
  2795. 1:53:15This is uh $40. How much? $100. Okay.
  2796. 1:53:20Let's say I have a capon code. The capon
  2797. 1:53:22code is save.
  2798. 1:53:25Save. This is the capon code. I'll copy
  2799. 1:53:30and paste it here. Now see if I apply
  2800. 1:53:32capon that means how much percent
  2801. 1:53:35percentage it should return return me
  2802. 1:53:37guys tell me if I apply this apply this
  2803. 1:53:39capon so what would be the total price
  2804. 1:53:41as per your knowledge
  2805. 1:53:4580 right but see what I have done I have
  2806. 1:53:49added a bug in this application let me
  2807. 1:53:51show you if I apply this coupon code it
  2808. 1:53:54will show you 20 sorry $2 discount only
  2809. 1:53:58is it correct it should give me $20
  2810. 1:54:01discount It is giving $2 discount. Is it
  2811. 1:54:03correct?
  2812. 1:54:05Let me let me know. No, it's not
  2813. 1:54:06correct. Right. That means total amount
  2814. 1:54:08I have to pay $98. That means definitely
  2815. 1:54:11this application is working fine. But
  2816. 1:54:14there is a bug. So these kinds of
  2817. 1:54:16mistake your coding agent can do because
  2818. 1:54:18it's not a human, right? Again it's an
  2819. 1:54:20AI. So there is a possibility whatever
  2820. 1:54:24whatever code you are generating from
  2821. 1:54:26the coding agent whether you are using
  2822. 1:54:27copilot whether you're using codeex
  2823. 1:54:29whether you're using cursor ID it
  2824. 1:54:31doesn't matter there is a possibility
  2825. 1:54:33there should be kinds of bug okay and
  2826. 1:54:36this bug we have to figure out we have
  2827. 1:54:38to test this bug now either you can test
  2828. 1:54:40it manually either you can use some
  2829. 1:54:43kinds of okay and the will be using test
  2830. 1:54:46sprite cla for that test sprite cla what
  2831. 1:54:48it will do it will automatically figure
  2832. 1:54:51out the bugs from the application. It
  2833. 1:54:53will generate the evidence. This
  2834. 1:54:55evidence it will send it to the agents.
  2835. 1:54:56Agents will try to fix that. Again it
  2836. 1:54:58will test run the test and again it will
  2837. 1:55:01check whether this bugs is available or
  2838. 1:55:03not. How many it will run unless and
  2839. 1:55:05until this application got fixed.
  2840. 1:55:08Okay. Now we'll try to see this
  2841. 1:55:12application. We'll try to check this
  2842. 1:55:13application with the help of test sprite
  2843. 1:55:15as a verifier.
  2844. 1:55:31Okay,
  2845. 1:55:37just a minute. All right,
  2846. 1:55:41so now what did I do guys?
  2847. 1:55:45So it's like a coding agent to test
  2848. 1:55:48sprite uh and feedback and fix. Yeah,
  2849. 1:55:51see test sprite it's a tool. Okay. And
  2850. 1:55:56you are using whatever coding agent it's
  2851. 1:55:58completely fine.
  2852. 1:56:01So you can use test sprite as a verifier
  2853. 1:56:04so that whatever coding agent is
  2854. 1:56:06generated let's say I generated this
  2855. 1:56:07project with the help of this copilot in
  2856. 1:56:10the VS code copilot I have right I given
  2857. 1:56:12a prompt I need this kinds of website
  2858. 1:56:14please generate for me. So it has given
  2859. 1:56:16me this website. Now when I executed
  2860. 1:56:18this website I saw it's working fine.
  2861. 1:56:21Only mistake I saw that this is giving
  2862. 1:56:23me $98 or it should give me $80. So this
  2863. 1:56:27is a bugs right now. Either I can like
  2864. 1:56:30fix it. Okay, I can fix it manually.
  2865. 1:56:32Either I can ask my agent to do that.
  2866. 1:56:35But there is a possibility.
  2867. 1:56:38Okay, this this error is like very major
  2868. 1:56:41error. Let's say there are there are
  2869. 1:56:44thousands of thousands code you have
  2870. 1:56:45written very big application you have
  2871. 1:56:47created that time it's would be a little
  2872. 1:56:49bit difficult for you to find the right
  2873. 1:56:51bugs that we can use test sprite as a
  2874. 1:56:53verifier so what I will do I'll use test
  2875. 1:56:56sprite and I'll tell test sprite to
  2876. 1:56:58verify this project test this project
  2877. 1:57:01test sprite will run all the test cases
  2878. 1:57:03and it will figure out the bugs if it
  2879. 1:57:05having any kinds of bug and these bugs
  2880. 1:57:07it will show me as evidence okay I will
  2881. 1:57:10be able to see the bugs in live demo
  2882. 1:57:13only I will be able to see I'll show you
  2883. 1:57:14okay and this live evidence I'll again
  2884. 1:57:18provide to my agent that I got this bug
  2885. 1:57:21my test sprite found this bugs now try
  2886. 1:57:23to fix that then my agents will again
  2887. 1:57:25fix that then we'll try to correct this
  2888. 1:57:27application that's how the things works
  2889. 1:57:29get it
  2890. 1:57:31how it will know the test cases
  2891. 1:57:35already having all of the functionality
  2892. 1:57:37that's how test right has been designed
  2893. 1:57:39okay this is the one of the test pite it
  2894. 1:57:41will run all of the test cases and how
  2895. 1:57:44it will run the test cases everything
  2896. 1:57:45they have created in that test CLA
  2897. 1:57:47itself we don't need to worry about that
  2898. 1:57:49we will be only executing few commands
  2899. 1:57:52that's it
  2900. 1:57:54okay yeah first of all let me show you
  2901. 1:57:56the demo that time you will understand
  2902. 1:57:57okay now see this application is running
  2903. 1:57:59completely fine there is no error uh
  2904. 1:58:01sorry uh error definitely when bugs is
  2905. 1:58:03there uh now first of all see test
  2906. 1:58:06doesn't work locally it has to be remote
  2907. 1:58:08server so first of all we'll be
  2908. 1:58:10deploying this application over the
  2909. 1:58:11Versel website. Okay, Versel cloud. So,
  2910. 1:58:15make sure you create one account in
  2911. 1:58:16Versel guys. Okay, free account you
  2912. 1:58:19create uh Versel also you can deploy
  2913. 1:58:21your application as free. You just need
  2914. 1:58:23to create one Versel account. Okay, so
  2915. 1:58:26this is my account. I already logged in
  2916. 1:58:28and now we'll try to deploy this
  2917. 1:58:30application. How will you deploy this
  2918. 1:58:31application? We'll try to open the
  2919. 1:58:32terminal, stop the application and few
  2920. 1:58:36commands you have to execute. So first
  2921. 1:58:38of all you have to execute
  2922. 1:58:42uh this command.
  2923. 1:58:44First of all you have to install versel.
  2924. 1:58:47So this is the command for that. npm
  2925. 1:58:50installg versel.
  2926. 1:59:06Now you can deploy anywhere. You can
  2927. 1:59:08deploy AWS, you can deploy render,
  2928. 1:59:10anywhere you can deploy. This is the
  2929. 1:59:12NodeJS application. That's why I'm using
  2930. 1:59:14Versel cloud. Okay? Because this would
  2931. 1:59:16be easy for me to deploy.
  2932. 1:59:28Okay, I think it has uh
  2933. 1:59:32installed. Now we'll just try to run
  2934. 1:59:34this command versus login.
  2935. 1:59:44So this is the login URL and it will
  2936. 1:59:47automatically launch one website. Okay,
  2937. 1:59:49authentication website. Now here you
  2938. 1:59:51have to allow that. Make sure you
  2939. 1:59:53already logged in with the versel. Okay,
  2940. 1:59:54otherwise it won't be able to select the
  2941. 1:59:57account. So I already logged in with my
  2942. 1:59:58versel. So that's why uh see this
  2943. 2:00:01account I will be able to see that.
  2944. 2:00:02Okay. Now I'll just try to give the
  2945. 2:00:04authorization. Allow.
  2946. 2:00:29Let's wait for the authentication.
  2947. 2:00:34Okay, authentication is done. Even you
  2948. 2:00:37will also see the success message here
  2949. 2:00:49see it uh it is getting congratulation
  2950. 2:00:52you were signed in. Okay now we are also
  2951. 2:00:54giving the successful message. Now I can
  2952. 2:00:56close this window even I will go get
  2953. 2:00:58back to my versel. Now let me close some
  2954. 2:01:00of the tab because too many tabs I have
  2955. 2:01:02created. I'll close this. I'll also
  2956. 2:01:05close this. I'll also close this. Also
  2957. 2:01:07close this one. Okay. And this one. This
  2958. 2:01:10one. I'll close this. Okay. Now fine.
  2959. 2:01:12Now I successfully logged in with my
  2960. 2:01:14versel. Now I have to deploy my
  2961. 2:01:17application. Okay. Now to deploy your
  2962. 2:01:19application you have to write this
  2963. 2:01:20command.
  2964. 2:01:26H sorry not this one.
  2965. 2:01:30>> [snorts]
  2966. 2:01:34>> Marcel sorry hypen broad
  2967. 2:01:40now it is asking do you want to create a
  2968. 2:01:42new project I'll tell yes use your arrow
  2969. 2:01:44key I'll go down I'll tell yes create a
  2970. 2:01:47new project
  2971. 2:01:49now it is telling please give the name
  2972. 2:01:51of your project let's say I'll give this
  2973. 2:01:54name
  2974. 2:01:58uh loop card test sprite
  2975. 2:02:02or let's say loop card project
  2976. 2:02:08you can give any name now it is telling
  2977. 2:02:11uh do you want to copy all of the source
  2978. 2:02:13chrome from your right directory I'll
  2979. 2:02:14tell yes I'll press enter
  2980. 2:02:17now it is telling do you want to change
  2981. 2:02:19any setting I'll tell no
  2982. 2:02:21enter now it is connect connected g
  2983. 2:02:26repository See
  2984. 2:02:28uh connect detected git repository. I'll
  2985. 2:02:31tell I'll tell no
  2986. 2:02:36it is deploying.
  2987. 2:02:42Now it's ready. Okay. Now I'll go to the
  2988. 2:02:43versel website. Uh see my application
  2989. 2:02:46got registered here. Now I'll click here
  2990. 2:02:49and there is a live URL I'll get. Okay.
  2991. 2:02:51Domains. Now I'll open it. Now see my
  2992. 2:02:54application is live right now. Okay. See
  2993. 2:02:56now even you can also access my
  2994. 2:02:57application guys. I'll give the URL. Now
  2995. 2:03:00tell me are you able to access my
  2996. 2:03:01application?
  2997. 2:03:05No it only work live application not
  2998. 2:03:07local host guys. Are you able to access
  2999. 2:03:09my application? Okay. Now let's test.
  3000. 2:03:11Okay. I'll give save 20.
  3001. 2:03:16Apply coup. Now see this is having the
  3002. 2:03:18bug. Okay. Now I will run test sprite
  3003. 2:03:20test cases. Okay. So how to do that? So
  3004. 2:03:22for this I have already given all of the
  3005. 2:03:25command you have to execute. Okay. So
  3006. 2:03:27first of all here you have to install
  3007. 2:03:30the test sprite. Okay. Now we'll try to
  3008. 2:03:32install the test sprite. So to install
  3009. 2:03:35the test sprite
  3010. 2:03:37what you have to do.
  3011. 2:03:40Okay. But before that you have to create
  3012. 2:03:41one account in the test sprite website.
  3013. 2:03:43So this is the test sprite website. Just
  3014. 2:03:45make sure you create a free account. So
  3015. 2:03:47I already have the account. I'll just
  3016. 2:03:48try to sign in because you need a API
  3017. 2:03:51key. Okay. from the test sprite.
  3018. 2:03:55So this is the dashboard and from here
  3019. 2:03:58you have to get one API key. Okay. So
  3020. 2:04:00let's create one API key.
  3021. 2:04:05So I already created some API key
  3022. 2:04:07before. I'm going to remove them.
  3023. 2:04:11I'm going to create a new one. Let's
  3024. 2:04:14name it as demo. Create.
  3025. 2:04:19copy this API key and keep it somewhere
  3026. 2:04:21safe so that I can use it later on.
  3027. 2:04:24Let's say I'll keep it here.
  3028. 2:04:27Okay, just for your reference. I'll keep
  3029. 2:04:29it here. And right now what I'm going to
  3030. 2:04:32do, let's close this as of now. Okay,
  3031. 2:04:35[snorts] now what I have to do guys, I
  3032. 2:04:37have to
  3033. 2:04:39I have to go to the test CLI GitHub.
  3034. 2:04:42Okay, now here they have already given
  3035. 2:04:43the installation guideline. So you have
  3036. 2:04:45to copy these two command. Okay, now
  3037. 2:04:47let's copy this command. Open up your
  3038. 2:04:49terminal.
  3039. 2:04:51Clear and execute. Paste. Anyway, so
  3040. 2:04:55first of all, it will install test
  3041. 2:04:56sprite CLI. Okay, it got installed. Now
  3042. 2:04:59it will do the setup. Now again execute.
  3043. 2:05:05Now you have to pass your API key. Okay,
  3044. 2:05:07now you have the API key guys. Copy your
  3045. 2:05:10API key
  3046. 2:05:12and paste it here.
  3047. 2:05:18Okay, once you have done you'll see that
  3048. 2:05:21one folder would be create created
  3049. 2:05:22called clot. Okay, say test pride
  3050. 2:05:24internally use clot. Okay, internally it
  3051. 2:05:27use clot for the testing operation. Now
  3052. 2:05:31see it got created successfully. Okay,
  3053. 2:05:33now inside that test pride onboard test
  3054. 2:05:35sprite verify. Okay, whatever utility it
  3055. 2:05:37needs it will automatically create for
  3056. 2:05:39you. Now the next thing guys what I have
  3057. 2:05:42to do we have successfully installed
  3058. 2:05:44test sprite configured the test sprite
  3059. 2:05:45we have already seted the API key
  3060. 2:05:47everything is fine now simply we'll try
  3061. 2:05:50to
  3062. 2:05:52uh run the test sprite now we'll try to
  3063. 2:05:55add
  3064. 2:05:56this project to the test sprite server
  3065. 2:05:59first of all for this this is the
  3066. 2:06:00command you have to run this command
  3067. 2:06:02guys again these are the test sprite
  3068. 2:06:04related command let me mention
  3069. 2:06:10test I'm going to share all of the
  3070. 2:06:12command guys this command will remain
  3071. 2:06:13same don't need to memorize test write
  3072. 2:06:16related command
  3073. 2:06:19test write command
  3074. 2:06:31okay
  3075. 2:06:33so first of all you have to run this
  3076. 2:06:35command So this command will register
  3077. 2:06:37your application in the test sprite
  3078. 2:06:38server. But make sure you have to give
  3079. 2:06:39your live URL here. So what is my live
  3080. 2:06:42URL? So this is my app. This is the live
  3081. 2:06:45URL. Copy that
  3082. 2:06:47and
  3083. 2:06:49make sure you are giving the URL here.
  3084. 2:06:52Once you have given the URL, copy this
  3085. 2:06:53entire command.
  3086. 2:06:57Okay. Open up your terminal.
  3087. 2:07:00Clear and just write execute.
  3088. 2:07:08Okay, if you do that, it will give you a
  3089. 2:07:10project ID. Now, let's copy this project
  3090. 2:07:12ID and keep it somewhere saved. Okay, so
  3091. 2:07:15let's say I'll keep it here. This is my
  3092. 2:07:17project ID. So, don't lose this project
  3093. 2:07:20ID. Okay, this is required. Now, you can
  3094. 2:07:22go to the test sprite website. Close it.
  3095. 2:07:26Go to the home. Now, see, look at
  3096. 2:07:29project created. Okay, see automatically
  3097. 2:07:32this project got registered in the
  3098. 2:07:33testpite website. Okay, now you can see
  3099. 2:07:36there is nothing right now because we
  3100. 2:07:38haven't run any test of test cases.
  3101. 2:07:40Okay, so previously I also created some
  3102. 2:07:42test cases that's why it's showing but
  3103. 2:07:43for you it would be completely working
  3104. 2:07:45project. Okay, you can even delete the
  3105. 2:07:47previous project as well. So now the
  3106. 2:07:49next thing guys I have to execute
  3107. 2:07:52uh after
  3108. 2:07:54uh after uh registering my application I
  3109. 2:07:57have to generate the test plan. Okay.
  3110. 2:07:59Now to generate the test plan guys, this
  3111. 2:08:01is the second command you have to
  3112. 2:08:02execute. Now you have to copy this ID,
  3113. 2:08:06the project ID you have copied and here
  3114. 2:08:10after project underscore you have to
  3115. 2:08:12replace it.
  3116. 2:08:14Okay. Now copy the entire command,
  3117. 2:08:18open up your terminal and execute.
  3118. 2:08:22So it will generate a plan for me. Now
  3119. 2:08:25you can see it has created a test sprite
  3120. 2:08:26plans folder. I'll open it up. inside
  3121. 2:08:29that one JSON file is created. Now if I
  3122. 2:08:31open this JSON file now see whatever
  3123. 2:08:33action it should perform whatever test
  3124. 2:08:36cases it should perform it has
  3125. 2:08:37automatically created by reading my
  3126. 2:08:39project. Now you can see this is the
  3127. 2:08:41plan step action. Open the loop homepage
  3128. 2:08:44and confirm the card subtotal is
  3129. 2:08:47$100.
  3130. 2:08:49Enter save 20 in the capon code field
  3131. 2:08:52and click apply capon. Verify the p
  3132. 2:08:55confirms the save capon was applied.
  3133. 2:08:57Verify the discount is 20. Okay. Verify
  3134. 2:09:01shipping fee and final cost is $80. Now
  3135. 2:09:04see automatically test sprite listed
  3136. 2:09:08down what are the test it should run in
  3137. 2:09:09the application. This is the beauty of
  3138. 2:09:11test sprite. Now tell me if you are a
  3139. 2:09:13human for you it would be uh it would be
  3140. 2:09:17easy for you to find out these are the
  3141. 2:09:19step at the very first time of your
  3142. 2:09:20application if you are running your own
  3143. 2:09:23test cases. Tell me guys no right but if
  3144. 2:09:26you're using test sprite see easily in
  3145. 2:09:28just a one command automatically I got
  3146. 2:09:30whatever test cases I have to run even
  3147. 2:09:32you don't need to run okay manually test
  3148. 2:09:33sprite will automatically run let me
  3149. 2:09:35show you now what I'll do guys here
  3150. 2:09:38project ID just try to remove this
  3151. 2:09:40project ID this part just try to remove
  3152. 2:09:43okay this is not required right now save
  3153. 2:09:45it now let's go to the next command now
  3154. 2:09:49after generating plan you have to run
  3155. 2:09:50the first test sprite test okay so for
  3156. 2:09:52this this is the command command. Now
  3157. 2:09:55here you have to
  3158. 2:09:57uh you have to copy this command.
  3159. 2:10:02Okay, you have to copy this command. Now
  3160. 2:10:04this command what it does, it will open
  3161. 2:10:07the test sprite.plans folder. It will
  3162. 2:10:09take the JSON file as you can see save
  3163. 2:10:11JSON file. Okay, it will take this JSON
  3164. 2:10:13file. This JSON file and it will run the
  3165. 2:10:15test cases over the test sprite server
  3166. 2:10:18and it will find out the bugs. Okay,
  3167. 2:10:20after that it will launch all of the
  3168. 2:10:21information in the test prite server.
  3169. 2:10:25Yeah. So this is the okay we are using.
  3170. 2:10:28Now I'll copy this command. Open up the
  3171. 2:10:31terminal. Execute. Now see the magic.
  3172. 2:10:36It will take some time because it will
  3173. 2:10:37run all the test cases. Okay. We'll
  3174. 2:10:39wait. And the beauty is that you can see
  3175. 2:10:42even the video. Okay. It is
  3176. 2:10:44automatically going to your website
  3177. 2:10:46clicking on that button giving the u
  3178. 2:10:49couple code. It will even get that
  3179. 2:10:52video. Okay, I'll show you.
  3180. 2:10:55First of all, let's complete that.
  3181. 2:11:01And definitely you will be getting one
  3182. 2:11:03failed message. Okay, because your
  3183. 2:11:05application has a box. Okay, it will
  3184. 2:11:07give you one failed message. I'll show
  3185. 2:11:09you show you.
  3186. 2:11:12Yeah, this is for production only. Okay,
  3187. 2:11:14this is not a demo purpose. You can use
  3188. 2:11:16it for the production. People are using
  3189. 2:11:18that.
  3190. 2:11:28Everything is happening over your live
  3191. 2:11:30server. Okay, this is the beauty.
  3192. 2:11:44This is the application level verifier
  3193. 2:11:46and previous example was the code level
  3194. 2:11:48verifier
  3195. 2:11:49custom verifier we created. Now see we
  3196. 2:11:52got the execution result. One thing you
  3197. 2:11:54have to copy which is test ID. Okay just
  3198. 2:11:56try to copy this test ID and save it
  3199. 2:12:00here. Okay this thing I need. This is
  3200. 2:12:02your test ID. Okay
  3201. 2:12:04fine. Now you can see I got a failed
  3202. 2:12:07message error message. Now see okay what
  3203. 2:12:09is the error I got. Now I'll go to the
  3204. 2:12:10test sprite server. Now see it has run
  3205. 2:12:13the test but it got failed. Okay. Now
  3206. 2:12:15I'll see what what is what was the
  3207. 2:12:17problem. I'll click here. Now it will
  3208. 2:12:19give me the user interface for you. See
  3209. 2:12:21it failed. Save 20 applies. This
  3210. 2:12:24discount got failed. Okay. I'll open it
  3211. 2:12:26up. Now see guys, you can see the
  3212. 2:12:29preview as well. Now if I play this
  3213. 2:12:30preview now see automatically it saved
  3214. 2:12:3520. Save 20 applied and it was 89. Okay,
  3215. 2:12:39that's how see it has executed all the
  3216. 2:12:42step whenever it it was applied the
  3217. 2:12:45capun code that time my application got
  3218. 2:12:47failed even it has also captured the
  3219. 2:12:48screen record
  3220. 2:12:51how how was this uh process guys tell me
  3221. 2:12:53good
  3222. 2:12:55no I haven't given this recording it has
  3223. 2:12:59already recorded this screen
  3224. 2:13:02sir did you provide whole recording of
  3225. 2:13:05the webinar to us huh it would be
  3226. 2:13:06available over the krishnak.in main
  3227. 2:13:08website. Okay, see that's how as a
  3228. 2:13:11developer now you can understand. Okay,
  3229. 2:13:13I got the mistake here. Now I can I have
  3230. 2:13:16to fix it here. You don't even need to
  3231. 2:13:17fix it. Your AI will fix that. Let me
  3232. 2:13:19show you. Okay, now let's say even you
  3233. 2:13:22can see the code level understanding
  3234. 2:13:24preview. Okay, but we don't see that. We
  3235. 2:13:26only see this error. Okay, now what I
  3236. 2:13:28will do? I will ask test sprite to
  3237. 2:13:32download that evidence for me. Let's say
  3238. 2:13:34whatever error it figured out, right? I
  3239. 2:13:36have to download that as a evidence. So
  3240. 2:13:38for this now uh what I'm going to do I'm
  3241. 2:13:41going to download the evidence. To
  3242. 2:13:43download the evidence this is the code a
  3243. 2:13:44command you have to run but here you
  3244. 2:13:46have to give the test ID. Now I'll copy
  3245. 2:13:47this test ID. I copied and paste it
  3246. 2:13:50here. Okay. But before that you have to
  3247. 2:13:53create one folder. The folder name is
  3248. 2:13:56test sprite failure. So I'll open up my
  3249. 2:13:58terminal.
  3250. 2:14:01Clear. M K D I R
  3251. 2:14:05this is the folder you have to create
  3252. 2:14:07okay test sprite uh /f failer
  3253. 2:14:12so I already created I think
  3254. 2:14:16syntax command failed
  3255. 2:14:22okay
  3256. 2:14:24I'll only give test sprite
  3257. 2:14:28okay now it created test sprite folder
  3258. 2:14:30got created Okay.
  3259. 2:14:33Now, what I'm going to do, I'm going to
  3260. 2:14:35copy the entire command
  3261. 2:14:37and I'm going to download the evidence.
  3262. 2:14:52See my evidence got downloaded. Now, if
  3263. 2:14:55I open the test sprite folder inside
  3264. 2:14:58that all of the evidence got saved.
  3265. 2:15:00Okay, even that video also, the video
  3266. 2:15:03you saw right here, this video also got
  3267. 2:15:05downloaded.
  3268. 2:15:07This video also got downloaded and
  3269. 2:15:09whatever error message. Okay, whatever
  3270. 2:15:11cause fix everything has downloaded
  3271. 2:15:14here. Just a minute. I opened
  3272. 2:15:18closed my Yeah,
  3273. 2:15:21just a minute guys. Let me
  3274. 2:15:26Yeah. Can you can you see my screen
  3275. 2:15:27guys? Can you see the browser? I think
  3276. 2:15:29it was uh closed.
  3277. 2:15:32Can you see that?
  3278. 2:15:37Okay. Now see my evidence got
  3279. 2:15:39downloaded. Okay. Failure meta result
  3280. 2:15:43all the analysis all the error all the
  3281. 2:15:45bugs it found. Okay. It has given all of
  3282. 2:15:47this thing as evidence. Okay. Now this
  3283. 2:15:49evidence I'll be using to fix my
  3284. 2:15:51problem. Okay. Now see how how what I
  3285. 2:15:54will do simply I'm going to
  3286. 2:15:58ask my agent to fix that.
  3287. 2:16:00Let me show you.
  3288. 2:16:11Okay. Now I'll ask my agent to fix that.
  3289. 2:16:18So I'll give a prompt to my agent right
  3290. 2:16:20now.
  3291. 2:16:27Now I'll open my agent that means your
  3292. 2:16:29coding agent whatever coding agent you
  3293. 2:16:31are using just try to open and here give
  3294. 2:16:34this prompt
  3295. 2:16:38read every file inside test sprite
  3296. 2:16:40failure folder explain why save 20
  3297. 2:16:44verification failed. Fix only the root
  3298. 2:16:47cause. Do not change weaken the test
  3299. 2:16:50requirement. Save 20 must apply 20%
  3300. 2:16:53discount and
  3301. 2:16:55$200 subtotal. Resulting $20 discount
  3302. 2:16:59$80 should should be after fixing it.
  3303. 2:17:02Show show me the exactly what you
  3304. 2:17:05changed. Okay. Now this is the prompt I
  3305. 2:17:07have given to my coding agent and I'm
  3306. 2:17:09telling just try to refer this evidence
  3307. 2:17:11as a reference why you did the mistake.
  3308. 2:17:14Why do you have to fix that? Now see if
  3309. 2:17:16I give this prompt now my agent will
  3310. 2:17:19automatically fix it for me. Now I'll
  3311. 2:17:21allow it. Now you just need to
  3312. 2:17:25take a cup of coffee and you have to
  3313. 2:17:27wait. Okay. Now see that
  3314. 2:17:34that's how you can solve any kinds of
  3315. 2:17:36big big problem. Okay. See as of now I'm
  3316. 2:17:38showing you a simple project but in
  3317. 2:17:40reality we'll be creating a very complex
  3318. 2:17:42agent that time or complex project that
  3319. 2:17:44time it's required so manual testing
  3320. 2:17:47that time won't work okay it will take
  3321. 2:17:49of time that time you can use this test
  3322. 2:17:52bite as a verifier even though your
  3323. 2:17:54agent is doing mistake you can still
  3324. 2:17:55verify
  3325. 2:18:06Yes. Now see it has already fixed inside
  3326. 2:18:09my pricing dojs file. I'll keep that
  3327. 2:18:11changes. I'll skip it. It's not
  3328. 2:18:14required.
  3329. 2:18:20I'll also skip it.
  3330. 2:18:43Okay. Now you can see previously inside
  3331. 2:18:46pricing.js
  3332. 2:18:47it was 0.2
  3333. 2:18:50uh 02 that means 2%. Okay. So it has
  3334. 2:18:53changed to 0.2 that means 20%. So that
  3335. 2:18:57was the problem in my pricing.js file.
  3336. 2:19:00Okay. Now it got fixed. Okay. Now we'll
  3337. 2:19:03redeploy this application. So again I
  3338. 2:19:05will redeploy. To redeploy it you have
  3339. 2:19:07to run this command npm run build. Okay
  3340. 2:19:11you have to build. Then you have to
  3341. 2:19:12again redeploy. You just need to run
  3342. 2:19:17prompt.
  3343. 2:19:25Now deployed again. I'll go to my live
  3344. 2:19:27app. Refresh.
  3345. 2:19:30Now let's test. I'll copy this save 20
  3346. 2:19:34coupon code. Now apply this coupon code.
  3347. 2:19:36Now tell me guys, is it correct? Is it
  3348. 2:19:39correct? Yes or no?
  3349. 2:19:42Now I'm getting the correct answer.
  3350. 2:19:46Okay. Now again I don't trust my
  3351. 2:19:49application. Again I trust my agent.
  3352. 2:19:51Okay. Again I'll try verification. Okay.
  3353. 2:19:54What I will do again? I'll open up my
  3354. 2:19:56terminal. I'll again ask my test sprite
  3355. 2:19:58to test that everything. Okay. Now to
  3356. 2:20:00again what I will do
  3357. 2:20:03uh again I'll copy my test ID.
  3358. 2:20:08I'll paste it here.
  3359. 2:20:14I'll copy this.
  3360. 2:20:21Okay. And I'll run the test again.
  3361. 2:20:27Again you have to wait for some times.
  3362. 2:20:28Again it will uh check everything
  3363. 2:20:34then it will give you the final
  3364. 2:20:37uh conclusion.
  3365. 2:20:57So that's how you have to test your
  3366. 2:20:58application guys before going for the
  3367. 2:21:00production there are lots of test case
  3368. 2:21:03you have to run then you have to uh you
  3369. 2:21:07have to let's say confirm your
  3370. 2:21:08application is completely good that time
  3371. 2:21:10you will be productionize your
  3372. 2:21:11application this is so important so if
  3373. 2:21:14this kinds of uh uh case you get in the
  3374. 2:21:18production right so definitely that
  3375. 2:21:20should be problem so people will get
  3376. 2:21:24let's say you have given 2% discount
  3377. 2:21:28your agent is making it as let's say
  3378. 2:21:32200% discount that time no p price is
  3379. 2:21:35needed people will purchase your course
  3380. 2:21:37freely it's not good right
  3381. 2:21:43okay now see execution is complete there
  3382. 2:21:46is no field message okay now I'll go to
  3383. 2:21:48the server again my test flight server
  3384. 2:21:52go to the home
  3385. 2:21:56Now see the latest test case got passed.
  3386. 2:21:59Okay. Now you can see there is no error.
  3387. 2:22:01I'll open it up. Uh
  3388. 2:22:04even see this is pass also. I'll open it
  3389. 2:22:06up. Now even you can see the preview.
  3390. 2:22:13See I'm getting $80.
  3391. 2:22:15Okay. Now this is completely working
  3392. 2:22:17fine. There is no error with that. Now I
  3393. 2:22:20can finalize this application. Okay. Now
  3394. 2:22:23I don't need to run this loop anymore.
  3395. 2:22:26Uh today's it's all about harness
  3396. 2:22:29engineering in agentic AI and uh after
  3397. 2:22:34learning this particular concept we'll
  3398. 2:22:36be also implementing uh multi- aent
  3399. 2:22:38system and we'll try to understand like
  3400. 2:22:42how this engineering works. Okay. Each
  3401. 2:22:44and everything we'll try to see in this
  3402. 2:22:46session.
  3403. 2:22:48Perfect. So first of all guys uh what
  3404. 2:22:51I'm going to do I'm going to uh clarify
  3405. 2:22:54about this harness engineering um in
  3406. 2:22:57detail I mean in the theoretical
  3407. 2:22:58understanding. So after understanding
  3408. 2:23:00this theoretical uh concept we'll try to
  3409. 2:23:03start with the practical development as
  3410. 2:23:04well. Okay. So here I'm expecting one
  3411. 2:23:08thing uh one prerequisite should be
  3412. 2:23:09there for this particular session which
  3413. 2:23:12is uh that you should familiar with AI
  3414. 2:23:15agents implementation at least with
  3415. 2:23:17langraph. Yeah. So I am expecting guys
  3416. 2:23:19you are familiar with agentic AI at
  3417. 2:23:21least agentic means uh here we create a
  3418. 2:23:23different different AI agents okay and
  3419. 2:23:25what is AI agents AI agents is nothing
  3420. 2:23:27but it's a kinds of applications there
  3421. 2:23:29we try to automate the workflows okay
  3422. 2:23:32including some tools okay and uh some
  3423. 2:23:35other uh let's say services like
  3424. 2:23:37memories database okay these are the
  3425. 2:23:38thing we'll try to integrate and we'll
  3426. 2:23:40try to automate our workflow now let's
  3427. 2:23:43try to understand what is hardness
  3428. 2:23:44engineering then okay so see harness
  3429. 2:23:47engineering is nothing but it's a part
  3430. 2:23:48of the agents. Okay, it's a part of the
  3431. 2:23:50agents. Why I'm telling it it's it's a
  3432. 2:23:52part of the agents. See whenever I'm
  3433. 2:23:54talking talking about it's part of the
  3434. 2:23:56agents that means harness engine is
  3435. 2:23:58nothing but it is your AI agents only.
  3436. 2:24:00Okay. Whatever tools and technology we
  3437. 2:24:03use uh for creating these kinds of AI
  3438. 2:24:05agents this is called actually harness
  3439. 2:24:08engineering. Okay. Now I think first
  3440. 2:24:09time this sounds would be a little bit
  3441. 2:24:11confusing for you but I'm going to
  3442. 2:24:12clarify. So as you can see in this high
  3443. 2:24:14level diagram we have the LLM and
  3444. 2:24:17definitely every agents has the LLM for
  3445. 2:24:19the reasoning operation for the uh main
  3446. 2:24:22brain okay then it has the harness
  3447. 2:24:24harness means it's a controlling system
  3448. 2:24:27because agents will have the uh agents
  3449. 2:24:30will have some of the component okay and
  3450. 2:24:33you know about the component like tools
  3451. 2:24:34memory database right with the it
  3452. 2:24:38controls something so let's say whenever
  3453. 2:24:39you are assigning any kinds of task to
  3454. 2:24:41the agents so this particular the task
  3455. 2:24:43it will take as a goal and it will divi
  3456. 2:24:45it will divide that goal as a multiple
  3457. 2:24:47task and this task would be done by this
  3458. 2:24:50kinds of controlling component. Okay,
  3459. 2:24:52let's say you are telling your agents to
  3460. 2:24:53generate an email and send it to the
  3461. 2:24:55customer. So what it will do it will
  3462. 2:24:57first of all generate the email. It will
  3463. 2:24:59verify whether this email is fine or not
  3464. 2:25:01based on the user topic. Then it will
  3465. 2:25:03automatically use your email tool and
  3466. 2:25:05send the email over the customer. So
  3467. 2:25:08each and everything is is being
  3468. 2:25:09automated here. Okay, we are creating
  3469. 2:25:11the automated pipeline and the entire
  3470. 2:25:13system we call it as a production app.
  3471. 2:25:15Okay, entire system we call it as a
  3472. 2:25:17production app. Now see guys here what
  3473. 2:25:20are the things we're going to learn in
  3474. 2:25:21this particular session. First of all,
  3475. 2:25:22we'll see what is harness engineering
  3476. 2:25:24means AI agent. Why a good prompt is not
  3477. 2:25:27enough for uh production. Okay, how
  3478. 2:25:29routing state guardrails and validation
  3479. 2:25:32works. How a harness controls multiple
  3480. 2:25:34specialized agents. how Langra fits into
  3481. 2:25:36the harness and how to think about
  3482. 2:25:39production reliability. Okay. So see
  3483. 2:25:42guys first of all let's try to
  3484. 2:25:44understand the problem and LLM uh call
  3485. 2:25:47is not a production system. Okay. I
  3486. 2:25:49think those who have already studied
  3487. 2:25:51about generate I think you would know
  3488. 2:25:52that uh previously the application we
  3489. 2:25:55used to create we call it as a prompting
  3490. 2:25:57based application. There we had a uh
  3491. 2:25:59single large language model and user
  3492. 2:26:01will send some kinds of prompt and he
  3493. 2:26:03will be getting some kinds of direct
  3494. 2:26:04response. Okay. But what was the missing
  3495. 2:26:07in this particular area? That means the
  3496. 2:26:09first missing um component was the
  3497. 2:26:11safety then routing validation uh then
  3498. 2:26:14permission and observability. Okay.
  3499. 2:26:15Production system needs software around
  3500. 2:26:17the model to decide what uh what's
  3501. 2:26:19happening before, during and after the
  3502. 2:26:21agents run. Okay. Now we can see what is
  3503. 2:26:25harness engineering. Then harness
  3504. 2:26:26engineering is the design of the control
  3505. 2:26:28layer around AI agents. Okay, that means
  3506. 2:26:31whenever we are developing an AI agents
  3507. 2:26:33that AI agents need needs some of the
  3508. 2:26:35component. First of all, routing is
  3509. 2:26:37required. Routing means uh who should do
  3510. 2:26:40what kinds of work. Let's say we are
  3511. 2:26:41creating a multi- aent system. Okay. And
  3512. 2:26:44multi- aent system means there would be
  3513. 2:26:45multiple agents. Now whenever I'm
  3514. 2:26:47getting a task from the user, we have to
  3515. 2:26:49decide which task should be performed by
  3516. 2:26:53uh which particular agents. So this is
  3517. 2:26:56called routing. So agents will have this
  3518. 2:26:58routing uh features so that agent can
  3519. 2:27:00automatically route the task. Let's say
  3520. 2:27:02you are creating a uh you are creating a
  3521. 2:27:04customer support agents that can solve
  3522. 2:27:06technical query, general query as well
  3523. 2:27:08as the let's say any kinds of uh any
  3524. 2:27:12kinds of let's say financial query. Now
  3525. 2:27:14whenever a user is giving a prompt,
  3526. 2:27:16let's say user is giving I'm having some
  3527. 2:27:17problem with my software X. Now can you
  3528. 2:27:20tell me what kinds of uh what kinds of
  3529. 2:27:22question it is? whether it is technical,
  3530. 2:27:24financial or general. Tell me guys,
  3531. 2:27:27let's say user is having a problem. I'm
  3532. 2:27:30having a problem with my software X.
  3533. 2:27:32Now, this is the this is related for
  3534. 2:27:34what? Definitely technical. Okay. Now,
  3535. 2:27:37if I'm sending this request to my
  3536. 2:27:39financial agents, so will it be able to
  3537. 2:27:42generate the response in a correct
  3538. 2:27:44manner? No, definitely. Right. So,
  3539. 2:27:46that's why we have to use the routing.
  3540. 2:27:48Routing means it will automatically
  3541. 2:27:49decide the questions we are getting the
  3542. 2:27:52task we are getting from the user which
  3543. 2:27:54agent should I route it right so this is
  3544. 2:27:57called routing and this component should
  3545. 2:27:59be available in every AI agents if you
  3546. 2:28:01especially whenever you're creating the
  3547. 2:28:03multi- aent system guys okay then the
  3548. 2:28:05second thing is the state okay state
  3549. 2:28:07means what do we know that means
  3550. 2:28:09whenever we are having the multiple
  3551. 2:28:11agents let's say agents Agents B agent C
  3552. 2:28:13agent D so let's say the first agent is
  3553. 2:28:16working
  3554. 2:28:18and it will have some kinds of input and
  3555. 2:28:20it will also give some kinds of output.
  3556. 2:28:22So this is called actually state data
  3557. 2:28:24and this state data we have to save
  3558. 2:28:26somewhere. For this we use some kinds of
  3559. 2:28:28state memory. Okay. This is another
  3560. 2:28:30component of a AI agents. Then you have
  3561. 2:28:32the guardrails. Okay. Guardils means
  3562. 2:28:34this is the safety features. That means
  3563. 2:28:36what kinds of input you should allow
  3564. 2:28:38kinds of [snorts] input you should not
  3565. 2:28:40allow. What kinds of output you should
  3566. 2:28:42allow? What kinds of output you should
  3567. 2:28:43not allow from your AI agents. Okay.
  3568. 2:28:45That means if anyone is asking any kinds
  3569. 2:28:48of violation related prompt, if anyone
  3570. 2:28:50is asking any kinds of let's say harmful
  3571. 2:28:52or sexual content definitely you have to
  3572. 2:28:54block that particular request and how
  3573. 2:28:56you will be doing that with the help of
  3574. 2:28:57guardrails you can do that okay so
  3575. 2:28:59guardrails is also part of an AI agents
  3576. 2:29:01okay then you have the validation
  3577. 2:29:04validation is also part of a guardrails
  3578. 2:29:05but here we just try to validate the
  3579. 2:29:08output okay output means let's say we
  3580. 2:29:10are generating a content from the agents
  3581. 2:29:12let's say we are generating a technical
  3582. 2:29:13block before publishing this blog first
  3583. 2:29:16of all I want to validate that whether
  3584. 2:29:17this particular blog is correct or not
  3585. 2:29:20whether the code I'm having it is
  3586. 2:29:21correct or not okay we perform this
  3587. 2:29:23validation now most of the people here
  3588. 2:29:26they can recall the concept we have
  3589. 2:29:27learned in our previous webinar guys can
  3590. 2:29:29you tell me what we do inside this
  3591. 2:29:31validation can anybody tell me here if
  3592. 2:29:33you have joined my previous webinar guys
  3593. 2:29:38what we perform inside validation
  3594. 2:29:43loop engineering concept
  3595. 2:29:45What is loop loop engineering does? Loop
  3596. 2:29:47engineering means no loop engineering
  3597. 2:29:49means it will take the output then it
  3598. 2:29:52will verify it will verify that. Okay,
  3599. 2:29:54it will verify and give the feedback
  3600. 2:29:56whether this particular output is good
  3601. 2:29:57or not. If not output if if it is not
  3602. 2:30:00good then it will send the feedback to
  3603. 2:30:02the agents. Agents will again generate
  3604. 2:30:04something again it will do the
  3605. 2:30:05validation. That's how this loop will be
  3606. 2:30:07running. Okay. And there would be some
  3607. 2:30:09termination condition unless and until
  3608. 2:30:12this particular output is not good or it
  3609. 2:30:14is matching with our maximum threshold
  3610. 2:30:16this loop will continuously run. Okay,
  3611. 2:30:17this is called loop engineering. We have
  3612. 2:30:19already studied in our previous webinar
  3613. 2:30:21guys.
  3614. 2:30:23Did it then the tracing. Okay, tracing
  3615. 2:30:25is also important. You have to also
  3616. 2:30:26trace each and every execution. Either
  3617. 2:30:28you can use any kinds of uh tracing
  3618. 2:30:31platform like lang okay or langfuse or
  3619. 2:30:34you can also use any kinds of um um
  3620. 2:30:36memory for that. Okay. But you have to
  3621. 2:30:38trace your what is happening inside
  3622. 2:30:40every nodes. Okay. This is what your uh
  3623. 2:30:42uh I mean all of the components whenever
  3624. 2:30:44we are developing any kinds of agentic
  3625. 2:30:46AI applications. Okay. Now if you
  3626. 2:30:48combine all of them and if you create
  3627. 2:30:50one applications we call it as a harness
  3628. 2:30:52engineering. That means see to implement
  3629. 2:30:54the agents. Okay. We only don't need the
  3630. 2:30:57large language model. Apart from large
  3631. 2:30:59language model we need some additional
  3632. 2:31:00component. We need some additional
  3633. 2:31:02controlling component like tools can be
  3634. 2:31:04there, routing can be there, state can
  3635. 2:31:06be there, guards can be there, validator
  3636. 2:31:08can be there, tracing can be there. If
  3637. 2:31:10we combine all of them together, this is
  3638. 2:31:12called harness engineering. Okay, that
  3639. 2:31:15means harness engineering nothing but
  3640. 2:31:16the controlling workflow. Okay, to
  3641. 2:31:18operate an agents, what are the
  3642. 2:31:20controlling tools are required? We call
  3643. 2:31:22it as a harness engineering guys. Is it
  3644. 2:31:24clear all of you? Let me know. Is it
  3645. 2:31:26clear guys? to implement an AI agents.
  3646. 2:31:30Whatever controlling component we need,
  3647. 2:31:32this is called harness engineering. That
  3648. 2:31:34means harness engineing is a part of
  3649. 2:31:36your AI agents. This is a not this is
  3650. 2:31:38not a separate field guys. That means
  3651. 2:31:40whatever agents we create so far. Okay,
  3652. 2:31:42we we used to know that about harness
  3653. 2:31:44engineering but we are not sure about
  3654. 2:31:46this is called harness engineering. Now
  3655. 2:31:48we are pretty much clear about that. So
  3656. 2:31:49the model decides intelligently and
  3657. 2:31:51harness decide operationally. Okay, that
  3658. 2:31:53mean I told you a a and a will have two
  3659. 2:31:57component. One is the large language
  3660. 2:31:58model another would be the controlling
  3661. 2:31:59layer. So uh model decides the
  3662. 2:32:02intelligence okay uh about the what but
  3663. 2:32:05decides the operational that means to
  3664. 2:32:07perform the kinds uh this complete
  3665. 2:32:10automation it needs to perform some
  3666. 2:32:12operations okay this is how your harness
  3667. 2:32:14engineering helps us it will use tooling
  3668. 2:32:17state guard validator tracing each and
  3669. 2:32:19everything here so harness is not a
  3670. 2:32:21making it powerful around the agents
  3671. 2:32:23make the most of llm yeah harness
  3672. 2:32:26actually making your agents powerful at
  3673. 2:32:28the end right because without routing
  3674. 2:32:30state guard validation tools how your
  3675. 2:32:32agents should be powerful okay how it
  3676. 2:32:34should be automated okay Krishna I think
  3677. 2:32:36you are getting my point okay with a
  3678. 2:32:38simple language model also you can
  3679. 2:32:40create the agents but this should not be
  3680. 2:32:42a perfect agent to create the perfect
  3681. 2:32:44agent we need all of these component and
  3682. 2:32:47this is the part of harness engineering
  3683. 2:32:48is
  3684. 2:32:50okay now let's try to um understand from
  3685. 2:32:54a real world analogy okay so the analogy
  3686. 2:32:57is engine and car okay so Let's say you
  3687. 2:33:00are driving a car and you know inside a
  3688. 2:33:03car there should be some kinds of engine
  3689. 2:33:05right whether you are driving Toyota,
  3690. 2:33:08Nissan or any other like brand. Each of
  3691. 2:33:12the car will have a engine. So just try
  3692. 2:33:13to consider engine is nothing but the
  3693. 2:33:15LLM. And what is harness? Harness is
  3694. 2:33:18nothing but the car controlling system.
  3695. 2:33:20Let's take an example. Let's say
  3696. 2:33:21staring. Staring means let's say this is
  3697. 2:33:24called routing. That means with the help
  3698. 2:33:25of steering you can change the route.
  3699. 2:33:27Then brakes. This is called guardrails
  3700. 2:33:29like where uh you want to break the car.
  3701. 2:33:32Okay. You have the entire let's say
  3702. 2:33:34blocking se sector here. Okay. In the
  3703. 2:33:36brakes. Then dashboard. Dashboard is
  3704. 2:33:38nothing but your observability
  3705. 2:33:40transmission. This is your workflow.
  3706. 2:33:41Seat belt. This is your permission.
  3707. 2:33:43Okay. So that's how you can compare your
  3708. 2:33:45harness with the real world analogy. Now
  3709. 2:33:47I think you are pretty much clear guys.
  3710. 2:33:49What is harness? That means LM is the
  3711. 2:33:52engine and harness is the component of a
  3712. 2:33:54car. Get it?
  3713. 2:33:59It will be available over the website
  3714. 2:34:00itself. Okay. Deep. [snorts]
  3715. 2:34:09Okay. So this is the simplest
  3716. 2:34:10explanation we uh I can give you about
  3717. 2:34:13this harness engineering. This is
  3718. 2:34:14nothing. This is the part of AI agents
  3719. 2:34:16only. Okay. But harness means we are
  3720. 2:34:20adding some other contouring layer to
  3721. 2:34:22the agents. Okay. So that our agents can
  3722. 2:34:23be more powerful because the single LM
  3723. 2:34:27based agents can't automate the process.
  3724. 2:34:30For this it needs some controlling
  3725. 2:34:32tools. Okay. And this controlling tools
  3726. 2:34:35we call it as a harness engineering.
  3727. 2:34:37This is called harness. Adding harness
  3728. 2:34:39to the agents. That's it.
  3729. 2:34:49Yeah. Now let's try to understand um
  3730. 2:34:52some application concept like prompt
  3731. 2:34:54based application context based
  3732. 2:34:56application agents versus versus
  3733. 2:34:57harness. Now see in prompt based
  3734. 2:35:01engineering or application development
  3735. 2:35:03we used to use a prompt let's say we are
  3736. 2:35:05having a single large language model and
  3737. 2:35:07here we are sending a prompt uh what
  3738. 2:35:09should I tell the model okay so this is
  3739. 2:35:11our goal then we had something called
  3740. 2:35:14context engineering this is also called
  3741. 2:35:15rag
  3742. 2:35:17ret augmented generation there the main
  3743. 2:35:20goal is is that what information should
  3744. 2:35:23it see that means the large language
  3745. 2:35:25model we're using we also provide some
  3746. 2:35:27additional context from the knowledge
  3747. 2:35:29base. This is called context engineering
  3748. 2:35:31or make based solutions. Okay. Then we
  3749. 2:35:33had something called agent engineering.
  3750. 2:35:35Okay. So basically here we just try to
  3751. 2:35:37assign the role tools should it have
  3752. 2:35:40right and to make it completely
  3753. 2:35:42automated. Okay. Working controlling
  3754. 2:35:44agents we at the harness engineering
  3755. 2:35:46that means how should whole system
  3756. 2:35:49operates okay to perform a task how it
  3757. 2:35:51should operate all of the component this
  3758. 2:35:54is called harness engineering. So this
  3759. 2:35:56is the difference between your prompt
  3760. 2:35:57engineering, context engineering, agent
  3761. 2:35:59engineering and harness engineering. I
  3762. 2:36:01hope you get it. And loop engineering is
  3763. 2:36:03the part of harness engineering. Okay?
  3764. 2:36:05Because inside harness engineering only
  3765. 2:36:07you are having that validator section
  3766. 2:36:09and inside validate you perform the loop
  3767. 2:36:10engineering. Get it
  3768. 2:36:17h.
  3769. 2:36:20Now let's try to understand why we use
  3770. 2:36:23multiple agents. Okay? Why not single
  3771. 2:36:24agents? Especially nowadays if you are
  3772. 2:36:27developing any kinds of agent
  3773. 2:36:28application or if you are seeing any
  3774. 2:36:30kinds of agent applications, you'll see
  3775. 2:36:32that people are creating multi- aents.
  3776. 2:36:34Okay? Instead of single agents because
  3777. 2:36:36one giant agent cannot handle all of
  3778. 2:36:39these I mean let's say billing, tech,
  3779. 2:36:43sales, refund everything. This would be
  3780. 2:36:45a little bit difficult for one agents.
  3781. 2:36:47Okay. So harder to control, test, debug,
  3782. 2:36:49secure and improve uh independently.
  3783. 2:36:52Okay. But if you're creating a
  3784. 2:36:54specialized agents that means multi-
  3785. 2:36:55aents you can divide the task. Let's say
  3786. 2:36:58for technical query you can create a
  3787. 2:36:59technical agents. For billing related
  3788. 2:37:02query you can create a billing agents.
  3789. 2:37:03Okay. For general question and answer
  3790. 2:37:05you create a general question answer
  3791. 2:37:07agent. So whenever you are getting some
  3792. 2:37:09kinds of output from the users you can
  3793. 2:37:11divide the task. So for technical query
  3794. 2:37:13you can pass this task to the technical
  3795. 2:37:15agents. For bling related query you can
  3796. 2:37:17pass this to the bling bling agents.
  3797. 2:37:18Okay. For general question answer you
  3798. 2:37:20can pass this task to the general
  3799. 2:37:21question answer agents. That's how you
  3800. 2:37:23can create a specialized essence. So in
  3801. 2:37:25our real life also people are not
  3802. 2:37:27actually perfect with all of the work we
  3803. 2:37:29are having in this world right. So every
  3804. 2:37:32human being is having some kinds of
  3805. 2:37:34specialized let's say someone is very
  3806. 2:37:36good at computer vision someone is very
  3807. 2:37:38good at let's say machine learning
  3808. 2:37:40someone is like very good at AI agents
  3809. 2:37:42development they're specialized things
  3810. 2:37:44right and every company is having this
  3811. 2:37:46kinds of specialized engineer so they
  3812. 2:37:48are not going to hire someone who knows
  3813. 2:37:50everything okay because in a company you
  3814. 2:37:52will see that that would be uh a
  3815. 2:37:54separate HR there would be separate CEO
  3816. 2:37:56there would be separate uh let's say
  3817. 2:37:58manager there would be separate engineer
  3818. 2:38:00okay each And everyone is a specialized
  3819. 2:38:02agents there. They're working uh
  3820. 2:38:04together. They're working I mean uh as a
  3821. 2:38:08team okay and they're solving a very
  3822. 2:38:10complex problem and they're growing the
  3823. 2:38:12company. So things are same here. We are
  3824. 2:38:15creating a specialized agents okay
  3825. 2:38:16multiple agents and we are giving some
  3826. 2:38:18special task to them and whenever we're
  3827. 2:38:20getting these kinds of task we're
  3828. 2:38:21dividing the task between them and
  3829. 2:38:24they're working together and they're
  3830. 2:38:25solving a big problem here. This is what
  3831. 2:38:27our multiple agents does, right?
  3832. 2:38:34>> But expensive utilizing multi- aents.
  3833. 2:38:36Yeah, definitely to create a multi-
  3834. 2:38:38aents it should be a little bit
  3835. 2:38:40expensive but at the end the agency will
  3836. 2:38:42be developing this should be more
  3837. 2:38:43robust. Okay. Right now in industry
  3838. 2:38:45people are more worried about the
  3839. 2:38:47robustness. Okay. instead of the cost
  3840. 2:38:49because if you're not getting a robust
  3841. 2:38:51agents so what is the mean of that
  3842. 2:38:53particular application if it is not
  3843. 2:38:54solving the real world use case I hope
  3844. 2:38:56you get it
  3845. 2:39:00no no it will forget because it will
  3846. 2:39:03have a state memory okay yeah this thing
  3847. 2:39:05we have to learn inside AI agents
  3848. 2:39:07development guys that's why I told you
  3849. 2:39:08AI agents knowledge are required okay
  3850. 2:39:10and then we'll be learning something
  3851. 2:39:11called lang graph and state memory okay
  3852. 2:39:14we create a permanent memory for each
  3853. 2:39:16and every agents there is a concept
  3854. 2:39:18Subgraph. Okay. So with of subgraph you
  3855. 2:39:20can create this multi-agent concept
  3856. 2:39:22inside lang graph. Have you studied
  3857. 2:39:24subgraph before anyone?
  3858. 2:39:27Subgraph. Subgraph in lang graph. Okay.
  3859. 2:39:29This is the best way to create the
  3860. 2:39:31multi- aent system.
  3861. 2:39:35Yeah.
  3862. 2:39:37No state graph is a different thing.
  3863. 2:39:39Subgraph is a different thing. Okay. If
  3864. 2:39:41you don't know, you can check my YouTube
  3865. 2:39:42channel TS with BP. There I already have
  3866. 2:39:44the tutorials. You can understand about
  3867. 2:39:46the subgraph.
  3868. 2:39:48Yep.
  3869. 2:39:52Okay. That's why lang graph is like
  3870. 2:39:54veryful and most demanding framework
  3871. 2:39:57nowadays especially in industry for the
  3872. 2:39:59agents development instead of any other
  3873. 2:40:00framework like crewi autogen okay people
  3874. 2:40:04are more focusing on the langraph
  3875. 2:40:06development especially whenever you're
  3876. 2:40:08getting your custom agents okay so try
  3877. 2:40:10to master lang graph that would be
  3878. 2:40:12pretty much beneficial for you
  3879. 2:40:20H
  3880. 2:40:26no this is just a simple uh I mean react
  3881. 2:40:29agent okay go create agent this is a
  3882. 2:40:32simple uh react agent inside langen so
  3883. 2:40:35that at least whenever you are learning
  3884. 2:40:36something you can use that and create a
  3885. 2:40:39simple basic uh basic agentic
  3886. 2:40:41application okay we don't use this
  3887. 2:40:44create agent in real
  3888. 2:40:52your YouTube channel name and LinkedIn
  3889. 2:40:53profile.
  3890. 2:40:55DS with BPI. Okay. DS with BPI my
  3891. 2:40:58YouTube channel and Bhammed Bi is my
  3892. 2:41:01LinkedIn profile.
  3893. 2:41:09Yeah, let me show you. So, this is my
  3894. 2:41:11LinkedIn profile. Okay. And
  3895. 2:41:15This is my channel.
  3896. 2:41:20This is my channel
  3897. 2:41:28H.
  3898. 2:41:30Okay. Now let's try to see a
  3899. 2:41:33[clears throat] example of this harness
  3900. 2:41:36uh harness engineering that means the
  3901. 2:41:38harness agent. Uh we'll also create this
  3902. 2:41:41thing in a practical. Okay. First of
  3903. 2:41:42all, let me show you the highle diagram.
  3904. 2:41:45So here we're going to uh going to
  3905. 2:41:46create a multi- aent system guys and
  3906. 2:41:49this is going to be a AI customer
  3907. 2:41:51support agents. So user will give some
  3908. 2:41:53question uh I mean questions okay or
  3909. 2:41:56let's say any kinds of customer related
  3910. 2:41:57query. First of all we'll try to pass
  3911. 2:41:59through the guards layer. Okay. So
  3912. 2:42:01definitely guard should be the component
  3913. 2:42:02of the AI agents. First of all we'll try
  3914. 2:42:04to check whether the questions we are
  3915. 2:42:06getting it is having any kinds of
  3916. 2:42:07violation. It is having any kinds of
  3917. 2:42:10let's say harmful content or not. if it
  3918. 2:42:12is having we'll try to block the request
  3919. 2:42:13okay otherwise we'll try to send it over
  3920. 2:42:16the router okay what router will decide
  3921. 2:42:18the questions we are getting let's say
  3922. 2:42:20people are asking about uh let's say I'm
  3923. 2:42:22having a I'm having a error inside my
  3924. 2:42:25python program now can you tell me what
  3925. 2:42:27kinds of question it is it's a technical
  3926. 2:42:30billing or general tell me
  3927. 2:42:32I'm having a problem with my python file
  3928. 2:42:35let's say this is the question technical
  3929. 2:42:37so what router will do it will
  3930. 2:42:39automatically understand the user
  3931. 2:42:43question. Okay. And based on that it
  3932. 2:42:45will route that particular questions to
  3933. 2:42:47the specialized agent. So here
  3934. 2:42:49specialized agents should be my
  3935. 2:42:50technical agents and technical agents
  3936. 2:42:52will try to u I mean generate something
  3937. 2:42:55okay uh based on the user query and it
  3938. 2:42:58will pass to the reviewer. See before
  3939. 2:42:59passing to the u user we will do the
  3940. 2:43:03review operation. Okay. We'll try to see
  3941. 2:43:04whether this uh I mean answer it has
  3942. 2:43:08generated this is perfect for this query
  3943. 2:43:09or not. If it is perfect then we'll try
  3944. 2:43:11to show otherwise we'll not show. Okay.
  3945. 2:43:14So that's how if user is passing any
  3946. 2:43:16kinds of billing related questions we'll
  3947. 2:43:18try to send it over the billing agents
  3948. 2:43:20and billing agents will uh give it to
  3949. 2:43:22the reviewer agents. Reviewer agents
  3950. 2:43:23will try to review then we'll try to
  3951. 2:43:25show similar goes to general question
  3952. 2:43:27and answer. Okay. So here we'll try to
  3953. 2:43:28create a three agents and each of the
  3954. 2:43:30agents will have different
  3955. 2:43:31responsibilities. Okay. That's how we
  3956. 2:43:33will create a multi- aent system. And to
  3957. 2:43:35create this multi- aent system guys you
  3958. 2:43:37can see I'm using all of this hardness
  3959. 2:43:39concept. Okay, harnessed component and
  3960. 2:43:42this is what your harness engineering
  3961. 2:43:43is. That means the simple AI
  3962. 2:43:45implementation only but we are using all
  3963. 2:43:47of the component. Apart from that there
  3964. 2:43:48are some other components are also
  3965. 2:43:50available like memory then you have
  3966. 2:43:52database. Okay but in this particular
  3967. 2:43:54demo I'm not going to use all of them
  3968. 2:43:55because if I'm using that it would be
  3969. 2:43:57very long session that time it would be
  3970. 2:43:59very big project maybe in future we'll
  3971. 2:44:01try to see the complete end to end
  3972. 2:44:02implementation but at least just to show
  3973. 2:44:03you the demo purpose I'm going to create
  3974. 2:44:05this particular agents. Okay with these
  3975. 2:44:07are the component. I hope this part is
  3976. 2:44:08clear to all of you.
  3977. 2:44:12Okay. Exactly the control is happening.
  3978. 2:44:15So here is the control happening right.
  3979. 2:44:17So whenever user is passing something,
  3980. 2:44:19right? Uh let's say user is passing a
  3981. 2:44:21questions about technical. So this
  3982. 2:44:23routing is automatically decide it will
  3983. 2:44:25hit the technical agents and it will
  3984. 2:44:28send it to the reviewer. So here this
  3985. 2:44:29controlling is happening here. We are
  3986. 2:44:31not controlling right here our agent is
  3987. 2:44:33deciding where it should go. Okay. In
  3988. 2:44:36real world also let's say if you're
  3989. 2:44:37creating a automated agents that time
  3990. 2:44:39let's say you are uh you are handling
  3991. 2:44:41the email let's say regular basis
  3992. 2:44:42whatever email you are getting from your
  3993. 2:44:44customer first of all you are checking
  3994. 2:44:46to the guardrails then you are giving to
  3995. 2:44:48the router then router is deciding what
  3996. 2:44:50kinds of email it is based on that it
  3997. 2:44:51will trigger that particular agents then
  3998. 2:44:54it will generate the response it will
  3999. 2:44:56pass to the reviewer and reviewer after
  4000. 2:44:57reviewing you are send uh it will send
  4001. 2:44:59this particular uh let's say message to
  4002. 2:45:01the sender okay sender agent and sender
  4003. 2:45:04agent will try to again resend a
  4004. 2:45:06particular email to that customer. Okay,
  4005. 2:45:08that's how we can automate the process.
  4006. 2:45:09But right now we are not adding too much
  4007. 2:45:11layer in this particular development.
  4008. 2:45:13Get it?
  4009. 2:45:17If I remove the guards then it will be
  4010. 2:45:20multi- aents like it will be similar to
  4011. 2:45:22multi- aents. See if you also remove the
  4012. 2:45:24guardrails. Yeah, this would be multi-
  4013. 2:45:26aent definitely.
  4014. 2:45:28This will not have the harness concept
  4015. 2:45:30that time because you are losing one
  4016. 2:45:32harness one of harness which is guardil
  4017. 2:45:34and guard is super important right now
  4018. 2:45:36inside agents okay otherwise people can
  4019. 2:45:39ask I want to hack your I want to hack
  4020. 2:45:42your platform okay give me the give me
  4021. 2:45:45the let's say um we point of platform
  4022. 2:45:49okay that time there is a possibility
  4023. 2:45:50your agent may give that particular
  4024. 2:45:52weakest point and people will hack your
  4025. 2:45:54system right so that's why guard is
  4026. 2:45:56important
  4027. 2:45:57If you look in charge and if you ask uh
  4028. 2:46:00how to make bomb or how to hack let's
  4029. 2:46:02say Google server just see whether
  4030. 2:46:05charge gives the answer or not
  4031. 2:46:08try uh just anyone try from here let me
  4032. 2:46:11know
  4033. 2:46:15the entire guard is equal to is equal to
  4034. 2:46:18harness harness means the entire inter
  4035. 2:46:20component okay component guard router
  4036. 2:46:25okay memory tools everything if you
  4037. 2:46:28include everything then it will become a
  4038. 2:46:30hardness nazer okay
  4039. 2:46:35so have you tried guys with charg how to
  4040. 2:46:38make a how to hack google server you'll
  4041. 2:46:41see that it will not give you the answer
  4042. 2:46:42why because it has the guardrails layer
  4043. 2:46:45so every input you are giving to charge
  4044. 2:46:47right let me show you so if I open up my
  4045. 2:46:49chart gpt and if I'm asking let's say
  4046. 2:46:53how to
  4047. 2:46:56hack Google
  4048. 2:47:00server.
  4049. 2:47:04See, I can't provide the instruction for
  4050. 2:47:06hacking the Google server. This contrast
  4051. 2:47:08cannot be shown. Okay? Because this is
  4052. 2:47:11not matching with their okay policy.
  4053. 2:47:13This is a violation. Okay? That's why it
  4054. 2:47:15is blocking your request.
  4055. 2:47:17Get it?
  4056. 2:47:19So that's why every real world
  4057. 2:47:21application is having this guard
  4058. 2:47:23concept. Okay? Without guards definitely
  4059. 2:47:26you don't need to create any kinds of
  4060. 2:47:27application
  4061. 2:47:29otherwise there is a possibility your
  4062. 2:47:30application can be used in a okay
  4063. 2:47:33different manner
  4064. 2:47:38h
  4065. 2:47:43so here this is the flow guys the entire
  4066. 2:47:46system flow first of all user will give
  4067. 2:47:49the questions I have an API login added
  4068. 2:47:52uh it will go to the guardrails and
  4069. 2:47:54guardrails will um either decide whether
  4070. 2:47:57it has to block or not. Then it will go
  4071. 2:47:59to the router nodes, motor nodes. It
  4072. 2:48:02automatically detects like it is a
  4073. 2:48:03technical query. Then it will prepare
  4074. 2:48:06something draft. Okay. Then this draft
  4075. 2:48:08would be uh shown to the reviewer.
  4076. 2:48:11Reviewer will generate the final answer.
  4077. 2:48:12Then it will trace and you will show the
  4078. 2:48:14user. Okay. So here one thing you have
  4079. 2:48:17to important uh which is that don't use
  4080. 2:48:21an LLM for every decisions. Okay.
  4081. 2:48:22Sometimes for some example you can use
  4082. 2:48:25deterministic code for some kinds of
  4083. 2:48:27decision you can use LM decisions. Let's
  4084. 2:48:30say for any kinds of low-level task
  4085. 2:48:32let's say you want to see whether any
  4086. 2:48:35refundable message you are getting from
  4087. 2:48:38the user or not. Let's say if user is
  4088. 2:48:39asking for the refund. Okay. So that
  4089. 2:48:42time you can simply write the
  4090. 2:48:44deterministic code like you can simply
  4091. 2:48:46use the if else condition to handle this
  4092. 2:48:49kinds of scenario. If refund it is
  4093. 2:48:51available in the questions then try to
  4094. 2:48:54uh route should be the billing. Okay.
  4095. 2:48:56They're asking for the refund of the
  4096. 2:48:59billing. Okay. But if their question is
  4097. 2:49:01having some complexity let's say
  4098. 2:49:03classify this request into technical
  4099. 2:49:05billing or general that time actually
  4100. 2:49:07you can't use this deterministic code
  4101. 2:49:09that time definitely you have to use the
  4102. 2:49:11LM decisions. Okay. So it's your design
  4103. 2:49:14pattern always. You don't need to use
  4104. 2:49:16large language model every sort of task.
  4105. 2:49:19Sometimes deterministic code will work.
  4106. 2:49:21So if you're adding the deterministic
  4107. 2:49:23code, you can reduce the cost of your
  4108. 2:49:26agents. Okay, that's how you have to
  4109. 2:49:28think about. If you are having a
  4110. 2:49:29low-level task, low-level let's say
  4111. 2:49:32conditions, that time use the
  4112. 2:49:33deterministic code. And if you are
  4113. 2:49:35having a highle task and needs some more
  4114. 2:49:38reasoning to understand this particular
  4115. 2:49:39content, that time use LM decisions
  4116. 2:49:42making. Okay, I hope you get it guys.
  4117. 2:49:45That's how you can reduce the cost of
  4118. 2:49:46your multi- aent system.
  4119. 2:49:51H
  4120. 2:49:53so guard is the entirely man. No guard
  4121. 2:49:55is not managed by the provider. Okay.
  4122. 2:49:58Llm provider it would be managed by you
  4123. 2:50:01especially inside your applications.
  4124. 2:50:03Okay.
  4125. 2:50:05Yeah. But right now whatever LLM
  4126. 2:50:07provider we use okay they also have some
  4127. 2:50:09kinds of guardrails integration in the
  4128. 2:50:11model when they train the model right.
  4129. 2:50:14But again whenever we are creating our
  4130. 2:50:16custom application that time we have to
  4131. 2:50:18use our own gad uh logic there Nathan
  4132. 2:50:35[clears throat]
  4133. 2:50:40now this is the guard control workflow.
  4134. 2:50:42So incoming request first of all we'll
  4135. 2:50:44apply the guardrails if this is matching
  4136. 2:50:47uh with our requirement we'll try to
  4137. 2:50:49allow it otherwise we'll try to block it
  4138. 2:50:51okay then specialized agent so it will
  4139. 2:50:54basically draft an answer then we'll
  4140. 2:50:56pass to the reviewer reviewer will
  4141. 2:50:58generate the final answer for that okay
  4142. 2:51:01so yes uh this is how actually we'll try
  4143. 2:51:03to create the entire system guys and
  4144. 2:51:05this is the highle architecture I
  4145. 2:51:07created for you there are some live demo
  4146. 2:51:09like u I will ask some of the questions
  4147. 2:51:12questions and based on the questions it
  4148. 2:51:13will automatically route the questions
  4149. 2:51:15to different different specialized
  4150. 2:51:17agents. Okay. So yes uh now let's try to
  4151. 2:51:20see the practical demo guys. Okay.
  4152. 2:51:24Okay. Now guys we'll try to start with
  4153. 2:51:27the practical. So let's do one thing.
  4154. 2:51:31I'll open up my
  4155. 2:51:34local folder and here let's open up our
  4156. 2:51:36VS code.
  4157. 2:51:42So I think everyone is having VS code in
  4158. 2:51:44their system. Yes or no?
  4159. 2:51:47VS code anonda. This is installed right?
  4160. 2:51:49Yeah. Great. So let's open up our VS
  4161. 2:51:52code.
  4162. 2:51:57[clears throat]
  4163. 2:51:59Okay.
  4164. 2:52:11Okay, the first thing guys uh you have
  4165. 2:52:13to set up the environment and you know
  4166. 2:52:15how to create the cond environment and
  4167. 2:52:17all but again I'm giving you all of the
  4168. 2:52:18command.
  4169. 2:52:20So to create the environment you have to
  4170. 2:52:22execute this command create you can also
  4171. 2:52:24use u package manager this is also fine
  4172. 2:52:26okay but I'm going to use cond create
  4173. 2:52:29hyphen in you can give the name of the
  4174. 2:52:31environment let's say I'll give demo and
  4175. 2:52:33then python version so let's say python
  4176. 2:52:35is equal to 3 11 okay y that means I'm
  4177. 2:52:40giving the yes permission then you have
  4178. 2:52:43to activate the environment so to
  4179. 2:52:44activate you just need to write activate
  4180. 2:52:47okay
  4181. 2:52:49activate create demo. Then after that
  4182. 2:52:52you have to install the requirement. So
  4183. 2:52:53pip install
  4184. 2:52:58install
  4185. 2:52:59hyphen rer requirement dot
  4186. 2:53:04requirement.
  4187. 2:53:09txt. Okay. So you can copy all of this
  4188. 2:53:12command one by one and execute in your
  4189. 2:53:14terminal. So for me I already have the
  4190. 2:53:16environment. I'm going to directly
  4191. 2:53:18activate that.
  4192. 2:53:20See you can also use VS code terminal at
  4193. 2:53:22the end both are same. So I'm using
  4194. 2:53:23separate terminal uh because I like to
  4195. 2:53:26use that. If you open the VS code
  4196. 2:53:27terminal see what will happen. Let's say
  4197. 2:53:29if I open the terminal. So it will
  4198. 2:53:32occupy extra space here. Okay. So this
  4199. 2:53:34code readability is not good here. So
  4200. 2:53:36that's why what I do I use this separate
  4201. 2:53:38terminal section. So I can anytime
  4202. 2:53:41minimize it. I can anytime launch it.
  4203. 2:53:42Okay. That's why
  4204. 2:53:45you can use anything. Okay. No need to
  4205. 2:53:47worry. Yeah. So now let's create an
  4206. 2:53:49GitHub uh GitHub um repo. I think that
  4207. 2:53:51I'm going to commit all of the code. I
  4208. 2:53:53think that would be amazing. So I'm
  4209. 2:53:55going to create a GitHub repo.
  4210. 2:53:58So what I can do I can let's say
  4211. 2:54:02um
  4212. 2:54:05I can create a new repo
  4213. 2:54:14H. [clears throat]
  4214. 2:54:16So here I can name it as
  4215. 2:54:23harness engineering
  4216. 2:54:28and let's copy from here.
  4217. 2:54:36I'll copy this name.
  4218. 2:54:41Yeah, harness engineering uh in agent
  4219. 2:54:47uh multi- aent demo
  4220. 2:54:52and it's engineering multi- aent demo
  4221. 2:54:59multi- aent
  4222. 2:55:03demo.
  4223. 2:55:09[clears throat]
  4224. 2:55:10Now let's keep uh keep it as a public
  4225. 2:55:12visibility and I'll take the readmi file
  4226. 2:55:16or readmi I'm already having
  4227. 2:55:19uh let's take the g ignore I'm using
  4228. 2:55:23python programming so let's select the
  4229. 2:55:24python
  4230. 2:55:31python
  4231. 2:55:34okay why python is not coming
  4232. 2:55:39Now it's coming. Now give the name
  4233. 2:55:43um license. You can take any license.
  4234. 2:55:45That's I'll take Apache license and
  4235. 2:55:47create the repo.
  4236. 2:55:51After that I will clone this repository
  4237. 2:55:53guys. Click on code. Copy this link
  4238. 2:55:55address. Open up your folder and in the
  4239. 2:55:58terminal just write
  4240. 2:56:01get clone.
  4241. 2:56:04Paste this URL.
  4242. 2:56:10Okay. Now, let's clear. And uh what I'm
  4243. 2:56:14going to do, I'm going to
  4244. 2:56:16um
  4245. 2:56:18copy all of this file
  4246. 2:56:22and paste it here. And I'm going to
  4247. 2:56:26remove it. H. [clears throat] Now, let's
  4248. 2:56:28open up my V port again. Yeah. So, now
  4249. 2:56:32my uh repository is available. Okay.
  4250. 2:56:35Now, I can commit the changes anytime.
  4251. 2:56:36Okay, but before that let me just
  4252. 2:56:38activate my environment. I already
  4253. 2:56:40activated. Now let's install the
  4254. 2:56:42requirements. Okay, so let me mention
  4255. 2:56:44all of the requirements you need here.
  4256. 2:56:47So first in let me create a file.
  4257. 2:56:54I'm going to name it as
  4258. 2:56:56requirements.txt.
  4259. 2:57:02And uh here I need fast API.
  4260. 2:57:07Okay. Why am I uh I'll be using fast
  4261. 2:57:08API? Because I also want to create a
  4262. 2:57:10backend uh API and with a user interface
  4263. 2:57:14user interface that's
  4264. 2:57:17to run this
  4265. 2:57:19first API server you need u
  4266. 2:57:23okay let us start uh started. Okay.
  4267. 2:57:25Yeah. So yeah these are the package guys
  4268. 2:57:27we'll be installing. Uh let's install.
  4269. 2:57:29So I'll open up my terminal and uh
  4270. 2:57:31execute this command.
  4271. 2:57:38Okay, for me it is telling requirement
  4272. 2:57:40is already satisfied because I already
  4273. 2:57:41installed previously. Okay, but for you
  4274. 2:57:43it may take some time and it's a good
  4275. 2:57:45practice uh whatever package you are
  4276. 2:57:47installing right just try to get the
  4277. 2:57:50version and mention it here. Why this is
  4278. 2:57:53required? Because if you are running
  4279. 2:57:54this project after one to one or two
  4280. 2:57:57month uh if there is any package update
  4281. 2:57:59you won't be having any kinds of
  4282. 2:58:00problem. Okay. So let's first of all
  4283. 2:58:03mention the first API version.
  4284. 2:58:06Yeah this is the requirement. Okay.
  4285. 2:58:08Don't worry I'm going to commit the
  4286. 2:58:09changes. Okay. So this is my GitHub.
  4287. 2:58:11Here I'm going to commit. Let me show
  4288. 2:58:12you the GitHub link.
  4289. 2:58:15So this is my GitHub link guys. Here I'm
  4290. 2:58:17going to commit my changes. First of all
  4291. 2:58:19let me complete. Okay,
  4292. 2:58:26ginger basically helps to load the HTML
  4293. 2:58:28CSS uh page code. Okay, Krishna in first
  4294. 2:58:32API.
  4295. 2:58:34So fast API, what is the package of uh
  4296. 2:58:37version of fast API? It's 0.141.1.
  4297. 2:58:41Okay, let's copy that and mention it
  4298. 2:58:43here.
  4299. 2:58:45Then uvicon. So what is the uon version?
  4300. 2:58:49UV corn UV corn
  4301. 2:58:52UV UV corn this one. Copy that
  4302. 2:58:57and mention it here.
  4303. 2:59:01Then ginger 2.
  4304. 2:59:14This is the version.
  4305. 2:59:17mention
  4306. 2:59:19it here.
  4307. 2:59:22Then python.v NV
  4308. 2:59:31then lang graph
  4309. 2:59:37lang graph this one
  4310. 2:59:42and langen gro because we'll be using
  4311. 2:59:45grock provider to access the grom
  4312. 2:59:48langen gro this
  4313. 2:59:55Yeah, I can do you with the help of Pphr
  4314. 2:59:57freeze. But if you do pay phrase, right,
  4315. 3:00:00it will save all of the dependency
  4316. 3:00:01package. Let me show you. See all of the
  4317. 3:00:04package. Okay, all of the package. Uh so
  4318. 3:00:08I feel like okay this is like more uh
  4319. 3:00:10confusing because at the end these are
  4320. 3:00:12the package are required but these are
  4321. 3:00:14the also dependency package. Okay,
  4322. 3:00:15that's why I don't need to install it
  4323. 3:00:17again. So if you mention that it will
  4324. 3:00:19automatically install its dependency
  4325. 3:00:21package. It's like more clean way to
  4326. 3:00:23understand. Okay. Yeah. Otherwise people
  4327. 3:00:25will ask sir what is uh this marks uh
  4328. 3:00:28markup safe? What is light lm? Okay.
  4329. 3:00:30These are the thing people may ask you.
  4330. 3:00:32But again these are the package
  4331. 3:00:35installed from this package only. Get
  4332. 3:00:37it? That's why
  4333. 3:00:40this is more clean way to understand.
  4334. 3:00:43Okay. Now requirements is already added.
  4335. 3:00:45We created the environment. Everything
  4336. 3:00:46is ready. Now first of all here we'll be
  4337. 3:00:50collecting the API key. So let's create
  4338. 3:00:52a file. I'm going to name it as env. And
  4339. 3:00:55inside that I'm going to collect my gro
  4340. 3:00:57API key. Okay. Gro API key because I
  4341. 3:01:00told you we'll be using grock class
  4342. 3:01:02model. Sorry it should be equal sign.
  4343. 3:01:07Okay. Now how to get the Gro API key
  4344. 3:01:10guys? Simply you just need to visit
  4345. 3:01:12Grock playground. Okay. Rock
  4346. 3:01:17playground.
  4347. 3:01:19Make sure you are creating one account
  4348. 3:01:21if you don't have the account. I already
  4349. 3:01:23have the account, guys. I'll just try to
  4350. 3:01:25login with my account.
  4351. 3:01:32[snorts]
  4352. 3:01:35Okay. After login, uh there you have the
  4353. 3:01:38API key section. But here you can see
  4354. 3:01:39there are different different models you
  4355. 3:01:41can access. Okay. I'll go to the API key
  4356. 3:01:43section and here you can create a new
  4357. 3:01:45API key. For me, I already created an
  4358. 3:01:47API key called demo and this API key I'm
  4359. 3:01:50going to save it inside my file and
  4360. 3:01:53don't use my API key guys. Okay?
  4361. 3:01:55Otherwise, let me create a new one so
  4362. 3:01:56that I can remove it after this session.
  4363. 3:01:58Okay? So, I'm going to name it as
  4364. 3:02:00hardness demo.
  4365. 3:02:05Make sure you are selecting no
  4366. 3:02:06expiration and verify
  4367. 3:02:10and submit.
  4368. 3:02:18What model are free in GR?
  4369. 3:02:23I'll tell you copy that
  4370. 3:02:26and mention it here. Okay.
  4371. 3:02:31Yeah. See, you can access you can access
  4372. 3:02:34almost all the models. Okay.
  4373. 3:02:37uh as free but there are some uh limit
  4374. 3:02:40limit uh limit you will get okay that
  4375. 3:02:42means the request limit that means in a
  4376. 3:02:45single day let's say that much token
  4377. 3:02:49input and output you can spend okay once
  4378. 3:02:51it is done you are not eligible for the
  4379. 3:02:54free tire again you have to try next day
  4380. 3:02:57okay but if you want to uh hit unlimited
  4381. 3:03:00request that time you have to take their
  4382. 3:03:02premium subscription get it Krishna so
  4383. 3:03:05almost all the model you can access from
  4384. 3:03:06here.
  4385. 3:03:11H so grock API we have collected. Now
  4386. 3:03:14let's create a file
  4387. 3:03:16called agent.py.
  4388. 3:03:23Okay. Then I'm also going to create
  4389. 3:03:25app.py.
  4390. 3:03:28I'm also going to create
  4391. 3:03:30graphpy.
  4392. 3:03:34Okay. And again I'm not going to explain
  4393. 3:03:36guys about the langraph uh what are the
  4394. 3:03:39things where available inside lang
  4395. 3:03:41graph. I'm expecting you are already
  4396. 3:03:42familiar with lang graph. You don't know
  4397. 3:03:44please try to complete the lang graph
  4398. 3:03:45first of all. Okay. But here I'm
  4399. 3:03:47expecting you are familiar with the uh
  4400. 3:03:49this uh langraph concept. Okay. So here
  4401. 3:03:51I'm not going to write the code from
  4402. 3:03:52scratch. Okay. Because then if you
  4403. 3:03:55understand the langraph component you
  4404. 3:03:57can easily write the code. Okay. Most of
  4405. 3:03:59the code uh readyto use code you can use
  4406. 3:04:02it as it is.
  4407. 3:04:05Okay. Now the first thing guys, we'll be
  4408. 3:04:07developing the agents because if I show
  4409. 3:04:08you my architecture. So this is the
  4410. 3:04:11architecture.
  4411. 3:04:16Yeah, here is the architecture guys.
  4412. 3:04:18First of all, here we'll try to create
  4413. 3:04:19all of the agent that means our
  4414. 3:04:20technical agent, billing agent, general
  4415. 3:04:23agent. Okay, let's create that. Then
  4416. 3:04:25we'll try to combine them all together.
  4417. 3:04:27We'll add the guards, router, reviewer,
  4418. 3:04:29each and everything we'll try to create.
  4419. 3:04:31So let's create the agent now.
  4420. 3:04:35H. So to create the agent first of all
  4421. 3:04:37you have to import some necessary
  4422. 3:04:38library
  4423. 3:04:40like I need operating system.
  4424. 3:04:43You also need to import block. So from
  4425. 3:04:46lang
  4426. 3:04:48gro
  4427. 3:04:50import
  4428. 3:04:52chat block
  4429. 3:04:54and we'll be using one model.
  4430. 3:04:58The model name is
  4431. 3:05:04Um 3.17
  4432. 3:05:07llama 3.1
  4433. 3:05:11llama llama llama
  4434. 3:05:2138B
  4435. 3:05:25llama there I think llama is there right
  4436. 3:05:27this llama promg guard this model
  4437. 3:05:30available model.
  4438. 3:05:34Okay, no need to worry. Maybe I can use
  4439. 3:05:36this model.
  4440. 3:05:39This this model I can use. Open a GPT O
  4441. 3:05:44O SS20p. Okay, this model I can use. And
  4442. 3:05:47if you want to use this model, this is
  4443. 3:05:49the model ID. You can copy
  4444. 3:05:52and you can mention it here.
  4445. 3:05:55Okay, this is the model.
  4446. 3:05:58Then after that you have to
  4447. 3:06:04one thing I want to verify
  4448. 3:06:11this is fine
  4449. 3:06:14H now uh what I will do guys I'll load
  4450. 3:06:17this model okay for this let's create a
  4451. 3:06:18function def get lm
  4452. 3:06:26uh olden llama model maybe they have
  4453. 3:06:27removed Okay. Yeah. Get lm and we'll
  4454. 3:06:31just try to return
  4455. 3:06:36um chat gro object that means our model
  4456. 3:06:40object. Okay. Model endpoint.
  4457. 3:06:44So model is equal to model name.
  4458. 3:06:57Okay. Then you have to mention the
  4459. 3:06:58temperature if you want. Now can you
  4460. 3:07:01anybody tell me what is temperature?
  4461. 3:07:04You know about temperature in LM right?
  4462. 3:07:07That means this is the creativity
  4463. 3:07:08parameter. Okay. API key is equal to OS
  4464. 3:07:12dot get
  4465. 3:07:16env.
  4466. 3:07:17And I'm going to load the brock API key.
  4467. 3:07:27So this is the APA key. Okay.
  4468. 3:07:30Then after that let's test this model.
  4469. 3:07:33Okay. Whether it works or not. So simply
  4470. 3:07:35I'm going to call this function lm is
  4471. 3:07:38equal to
  4472. 3:07:41get lm
  4473. 3:07:45and we'll do the invoke operation. lm
  4474. 3:07:48dot invoke
  4475. 3:07:53I'll give hello.
  4476. 3:07:55Let's see whether it works or not. And
  4477. 3:07:57the response I'm going to get, I'm going
  4478. 3:08:00to print it here.
  4479. 3:08:08So, I'll open up my terminal.
  4480. 3:08:12Clear
  4481. 3:08:14python
  4482. 3:08:16agent.py.
  4483. 3:08:18Okay. one error I'm getting which is
  4484. 3:08:20that gro
  4485. 3:08:23API key to the client plus gro API key
  4486. 3:08:25in environment variable. Oh okay. Can
  4487. 3:08:27anybody tell me the problem? Problem is
  4488. 3:08:30that here I haven't loaded the env right
  4489. 3:08:34from
  4490. 3:08:36env
  4491. 3:08:39load env. Okay. Now you have to load the
  4492. 3:08:41environment variable. Now it should
  4493. 3:08:43work. Let's see.
  4494. 3:08:50Mhm. So you can see hello how I can
  4495. 3:08:52assist assist you today. If you want to
  4496. 3:08:54only get the content simply you can
  4497. 3:08:56write r dot content. Okay.
  4498. 3:09:05So it's working fine. Okay. So simply uh
  4499. 3:09:08we are able to make the connection with
  4500. 3:09:11our uh group provider. Okay. And we're
  4501. 3:09:13able to access the large language model
  4502. 3:09:15completely free. Okay, free of cost.
  4503. 3:09:18Okay, now let's try to create our uh
  4504. 3:09:21agent. So the first agent guys I'm going
  4505. 3:09:23to create called technical agent. Okay,
  4506. 3:09:25that means this agent
  4507. 3:09:27technical agent and what technical agent
  4508. 3:09:30will do it will handle the technical
  4509. 3:09:31related query. Okay, so I already
  4510. 3:09:33created one technical agent function.
  4511. 3:09:35Let me show you very simple.
  4512. 3:09:39So this is the technical agent function
  4513. 3:09:42guys just try to see. Okay, what I have
  4514. 3:09:43done, I created a function called
  4515. 3:09:45technical agent. This takes the user
  4516. 3:09:47question. Okay, and it calls the LLM.
  4517. 3:09:50Okay, it calls the LLM and this is the
  4518. 3:09:52LLM object. And here we are preparing
  4519. 3:09:54the prompt, entire prompt for the
  4520. 3:09:56technical question handling. So we are
  4521. 3:09:58telling you are a technical support
  4522. 3:10:00agent. Your job is to help with the
  4523. 3:10:02login problem, API error, installation
  4524. 3:10:04problem, bugs, technical setup. Explain
  4525. 3:10:06the solution in very simple step. Never
  4526. 3:10:08invent account specific information. If
  4527. 3:10:11important information is missing,
  4528. 3:10:13carefully say what the user should
  4529. 3:10:15check. Okay. And customer question, this
  4530. 3:10:18is the question and return only the
  4531. 3:10:20helpful answer. Then we invoking the LLM
  4532. 3:10:23with the prompt and taking the content
  4533. 3:10:24and returning it. So guys, are you clear
  4534. 3:10:26till here? Yes or no?
  4535. 3:10:29Yes or no? Clear guys?
  4536. 3:10:35Great. Now let me define the next agent
  4537. 3:10:39which is billing agent. Okay. Billing
  4538. 3:10:41then general then also reviewer. Okay.
  4539. 3:10:44These are the agent we'll try to create
  4540. 3:10:46one by one. H now again I prepared
  4541. 3:10:49another agent called billing agent.
  4542. 3:10:53This is what your billing agent. Okay.
  4543. 3:10:55So again you can see the name of the
  4544. 3:10:57function is billing agent. Takes the
  4545. 3:10:59question calling the LLM. And this is
  4546. 3:11:01the entire prompt. You are a billing
  4547. 3:11:03support agent. Demo company policy.
  4548. 3:11:05Start uh starter plan $10 per month. Pro
  4549. 3:11:09plan $25 per month. Refund request must
  4550. 3:11:11be reviewed by the billing team. Never
  4551. 3:11:14claim that the refund has already been
  4552. 3:11:16approved. Never asked for full card
  4553. 3:11:18numbers or passwords. Customer
  4554. 3:11:20questions. Always clear and safe safety
  4555. 3:11:23uh safely using only the policy above.
  4556. 3:11:25Okay. Then we invoking the LM returning
  4557. 3:11:28the content. So in the prompt there is a
  4558. 3:11:30constraint and oneshot example. Yeah,
  4559. 3:11:33you can add the oneshot example. There
  4560. 3:11:35is a constraint. You can also add the
  4561. 3:11:36example. Okay. This is completely your
  4562. 3:11:38designing. Okay. If you want to add this
  4563. 3:11:40kinds of prompt, you can do that. The
  4564. 3:11:42way I'm writing it's not necessary to
  4565. 3:11:44write I mean you can also write the same
  4566. 3:11:46thing. You can change it. Now uh bling
  4567. 3:11:49agent is also ready. Now I'll try to
  4568. 3:11:50prepare the general agent. Okay. Let's
  4569. 3:11:53open the code again. And this is the
  4570. 3:11:56general agent. So basically this will
  4571. 3:11:58handle the general general question and
  4572. 3:12:00answer. So this is the general question
  4573. 3:12:02and answer. Again we are writing a
  4574. 3:12:03detailed prompt about the general
  4575. 3:12:05question and answer. we are returning
  4576. 3:12:06the output. Okay. Then once we have
  4577. 3:12:08created all three agents, okay, then
  4578. 3:12:10we'll also create the reviewer agent.
  4579. 3:12:11And what reviewer agent will do? It will
  4580. 3:12:14review the output given from each and
  4581. 3:12:16every agent. Okay. So again here I'll
  4582. 3:12:19try to create a separate agent for that
  4583. 3:12:21for reviewer agent it will take the
  4584. 3:12:22questions as well as the draft. Okay.
  4585. 3:12:24What draft? Each and agent every agent
  4586. 3:12:26whatever draft it will return. Okay. It
  4587. 3:12:29will take that draft and it will verify
  4588. 3:12:31whether this question and this draft is
  4589. 3:12:33looks good or not. So for this it will
  4590. 3:12:36call the LLM and this is the entire
  4591. 3:12:37prompt. You are the quality review agent
  4592. 3:12:39in a production customer support system.
  4593. 3:12:41Check the draft for uh draft answer for
  4594. 3:12:45uh clarity relevance unsafe request or
  4595. 3:12:47password card number unsupported uh
  4596. 3:12:49guarantees unnecessary complexity. Uh
  4597. 3:12:52rewrite the answer if needed. Okay. Keep
  4598. 3:12:54the final answer concise and beginner
  4599. 3:12:56friendly original uh customer question.
  4600. 3:12:59And this is the draft answer we got from
  4601. 3:13:00the agents and return only improved
  4602. 3:13:03final answer. Okay. Okay. And we are
  4603. 3:13:04invoking the LM again. Okay. So this is
  4604. 3:13:06our our reviewer agent is that means all
  4605. 3:13:10of the agents we have created
  4606. 3:13:11successfully. Now we'll try to create
  4607. 3:13:13the graph. Okay. Because in lang graph
  4608. 3:13:16the graph object is the main object we
  4609. 3:13:18create. Now I'll try to define the graph
  4610. 3:13:20here.
  4611. 3:13:22Yeah. Let's commit the code code guys
  4612. 3:13:23till here. So what I'm going to do I'm
  4613. 3:13:25going to commit the code. So, get add
  4614. 3:13:28space dot G
  4615. 3:13:32commit
  4616. 3:13:34n
  4617. 3:13:39um
  4618. 3:13:41agents added
  4619. 3:13:46name get push
  4620. 3:13:49origin
  4621. 3:13:54meth
  4622. 3:14:00So code is pushed. Now if I show you my
  4623. 3:14:02GitHub.
  4624. 3:14:05So code is available now. Okay. You can
  4625. 3:14:07test. You can check my GitHub guys.
  4626. 3:14:25Okay, now we'll try to create the graph
  4627. 3:14:27guys. Okay,
  4628. 3:14:29so this graph is everything inside lang
  4629. 3:14:31graph. So let's try to import some
  4630. 3:14:34necessary library. I need
  4631. 3:14:37this
  4632. 3:14:39type dict and literal from typing. Then
  4633. 3:14:42from lang graph I need state graph start
  4634. 3:14:44and end. Again don't ask me where we are
  4635. 3:14:47importing that because again I told you
  4636. 3:14:49this is the concept of lang graph and to
  4637. 3:14:51create the lang graph graph guys I need
  4638. 3:14:53this at the libraries okay for this you
  4639. 3:14:55have to please study about lang graph
  4640. 3:14:56okay this is the requirement now
  4641. 3:14:59whatever agents we have created guys
  4642. 3:15:01inside our agents file we'll also import
  4643. 3:15:04that one by one so import first of all
  4644. 3:15:07we'll import the technical agents then
  4645. 3:15:11billing agent
  4646. 3:15:13Then
  4647. 3:15:15we have general agent. Then we have
  4648. 3:15:19review our agent. Okay, we'll import all
  4649. 3:15:22of the agents. After that we'll try to
  4650. 3:15:24create a state memory. Okay, I told you
  4651. 3:15:26state memory is also part of a harness.
  4652. 3:15:29Right. So in lang graph we create a
  4653. 3:15:30state memory like that. We just write a
  4654. 3:15:33custom class for that. Let's say the
  4655. 3:15:35class name is support state and this is
  4656. 3:15:37inherited with a type dict. Okay.
  4657. 3:15:38Because type dict is a type. This will
  4658. 3:15:40store your data as a dictionary. And you
  4659. 3:15:43can also store this dictionary in a
  4660. 3:15:45permanent database. If you want, you can
  4661. 3:15:47also intrigate a database. We call it as
  4662. 3:15:50a state memory database. Again, this is
  4663. 3:15:53a concept of langraph. Uh you have to
  4664. 3:15:55study about. Okay. You can either use
  4665. 3:15:57postgraq, either you can use SQLite, any
  4666. 3:16:00kinds of database you can integrate
  4667. 3:16:01here. Okay. But as of now, I'll try to
  4668. 3:16:03save everything in the memory. That
  4669. 3:16:05means my RAM. So here I have taken some
  4670. 3:16:08variable in this memory guys. The first
  4671. 3:16:10uh variable is the questions that means
  4672. 3:16:12whatever question user will ask it will
  4673. 3:16:14save inside the question variable then
  4674. 3:16:16route okay route means let's say here
  4675. 3:16:20so let's say the question user is asking
  4676. 3:16:24and router is deciding what kinds of
  4677. 3:16:27agent should be running let's say for
  4678. 3:16:28technical question technical agent
  4679. 3:16:31should be calling from the router so
  4680. 3:16:34this information will save inside the
  4681. 3:16:36router variable guys okay route then
  4682. 3:16:38draft Draft draft means each and every
  4683. 3:16:40agents will generate some draft. This
  4684. 3:16:42draft result will try to save inside
  4685. 3:16:45this variable. Okay. And final answer.
  4686. 3:16:47Final answer means your reviewer agent
  4687. 3:16:49if it generates any kinds of final
  4688. 3:16:51answer after reviewing it, we'll try to
  4689. 3:16:54save it here inside the final answer.
  4690. 3:16:56Then block. Block means if your guards
  4691. 3:16:59blocked some kinds of request, okay, or
  4692. 3:17:01if accepts, we'll try to save inside
  4693. 3:17:03this particular variable. And trace.
  4694. 3:17:05Stress means all of the execution we'll
  4695. 3:17:07be doing right whatever things are
  4696. 3:17:08happening in in between each and every
  4697. 3:17:10node we'll try to save that information
  4698. 3:17:12in the tra and this is going to be a
  4699. 3:17:13list type data okay that means inside
  4700. 3:17:16the list we'll try to continuously add
  4701. 3:17:18on the u execution trace okay this is
  4702. 3:17:22how our uh uh state look like okay
  4703. 3:17:27can you use neo4j as a memory uh neoforj
  4704. 3:17:30is not recommended in langraph but you
  4705. 3:17:32can use postgress this is the most used
  4706. 3:17:35one another because here graph database
  4707. 3:17:38is not required. Okay, because this is
  4708. 3:17:40statewise uh I mean memory
  4709. 3:17:44we need.
  4710. 3:17:49Okay, now successfully we have created
  4711. 3:17:51the state. Now we have to create the
  4712. 3:17:53guardrails guys because guardrails is
  4713. 3:17:55also a harness inside a agent. Now let's
  4714. 3:17:58create this harness function. I'll write
  4715. 3:18:01a custom function for this harness.
  4716. 3:18:03Sorry uh this one um guardrails.
  4717. 3:18:08So this is the custom function I have
  4718. 3:18:10created guys
  4719. 3:18:13node. So this takes the state state
  4720. 3:18:16memory and uh what it does this is a
  4721. 3:18:20simple deterministic safety layers. It
  4722. 3:18:21in real uh system this can be included
  4723. 3:18:24uh moderation p detection okay parition
  4724. 3:18:27and policy checks. Again I told you
  4725. 3:18:29guard itself is a big topic you have to
  4726. 3:18:31understand it separately for this I
  4727. 3:18:33already have a tutorial you can check it
  4728. 3:18:35out. So first of all we are checking the
  4729. 3:18:37uh questions user questions and this is
  4730. 3:18:40the deterministic one and what does
  4731. 3:18:42deterministic means? Deterministic means
  4732. 3:18:44that means it is a conditional based
  4733. 3:18:46guardness. Okay if you want you can also
  4734. 3:18:48use LLM based guardness but for LLM you
  4735. 3:18:50have to take one LM here and you have to
  4736. 3:18:53give a prompt whether the user question
  4737. 3:18:55having any kinds of uh let's say harmful
  4738. 3:18:58violation sexual content or not. Okay,
  4739. 3:19:00if it is having just try to block
  4740. 3:19:02otherwise don't block and here we are
  4741. 3:19:04using the u this one actually
  4742. 3:19:06deterministic one that's why we are
  4743. 3:19:07taking a list inside list we have taken
  4744. 3:19:10some sentence like give me your password
  4745. 3:19:12steal password full credit card number
  4746. 3:19:15if these are the information is
  4747. 3:19:16available just try to block it okay and
  4748. 3:19:19save the trace in my trace state okay so
  4749. 3:19:23you can see if blocked just return this
  4750. 3:19:25particular output to the customer or
  4751. 3:19:28user I can't help you with this request
  4752. 3:19:29just involving the password, stolen
  4753. 3:19:31credential or full payment informations.
  4754. 3:19:34Otherwise, just try to make this block
  4755. 3:19:36as false. Okay, that means if my content
  4756. 3:19:39is having any kinds of sexual harassment
  4757. 3:19:41violation content, it will block. That
  4758. 3:19:43means block parameter would be true. If
  4759. 3:19:45it is true, that means we'll just stop
  4760. 3:19:47the execution of the workflow and we'll
  4761. 3:19:49show the user we can't help you with
  4762. 3:19:51that. If doesn't if it doesn't have the
  4763. 3:19:54violation that time, we'll just try to
  4764. 3:19:55make it as true. Okay, then we'll just
  4765. 3:19:57try to execute the remaining workflow.
  4766. 3:19:59That means we'll try to execute our
  4767. 3:20:01router, our technical agent, billing
  4768. 3:20:03agent, okay, reviewer agents, everything
  4769. 3:20:05we'll try to execute. So this is what
  4770. 3:20:07your guards function is guys. Okay. And
  4771. 3:20:09this is a custom function you can use
  4772. 3:20:10either as it is. Guards is a part of
  4773. 3:20:14governance. Yeah, you can consider it's
  4774. 3:20:16a part of also governance. Okay. Now
  4775. 3:20:18this is another function I have written.
  4776. 3:20:20After guards, what will happen? That
  4777. 3:20:22means if my state is blocked that means
  4778. 3:20:24directly my node will go to the end node
  4779. 3:20:27that means my execution will end
  4780. 3:20:28otherwise it will go to the router node
  4781. 3:20:30that means router node will decide. See
  4782. 3:20:32what is happening if your guard checks
  4783. 3:20:35any kinds of input which is having
  4784. 3:20:37violation it will go to the directly end
  4785. 3:20:39nodes that means execution is over no
  4786. 3:20:41more execution but if it is if it
  4787. 3:20:43doesn't have the violation that time it
  4788. 3:20:46will return this user input to the
  4789. 3:20:48router. So this is the function it will
  4790. 3:20:50do. So till here guys everything is
  4791. 3:20:52clear all of you and again I'm telling
  4792. 3:20:55you if you know about langraph this
  4793. 3:20:57would be easy for you to understand but
  4794. 3:20:59if you don't know it would be a little
  4795. 3:21:01bit harder for you get it yeah
  4796. 3:21:06now we'll try to create this router node
  4797. 3:21:08guys okay now router will decide based
  4798. 3:21:10on the user question where it should
  4799. 3:21:11send the request whether it should
  4800. 3:21:13should send a request to technical agent
  4801. 3:21:15billing agent or general agent okay so
  4802. 3:21:17let's try to define that particular
  4803. 3:21:19function so here what I'm going to do
  4804. 3:21:22guys I'm going to
  4805. 3:21:25I'm going to just create a function
  4806. 3:21:30this is the function guys actually two
  4807. 3:21:33function I have created
  4808. 3:21:37now here we have created this router
  4809. 3:21:38nodes guys so what router node does
  4810. 3:21:40based on the user question first of all
  4811. 3:21:42it will check the technical words okay
  4812. 3:21:44now see again I'm using the
  4813. 3:21:46deterministic approach just to show you
  4814. 3:21:47the demo but in real world you have to
  4815. 3:21:49use some kinds of large language model
  4816. 3:21:51to understand the user intent or user
  4817. 3:21:53questions whether this is technical
  4818. 3:21:55whether this is billing or whether this
  4819. 3:21:56is any kinds of general question answer
  4820. 3:21:59so here I created a list for the
  4821. 3:22:00technical question answer if this
  4822. 3:22:03question is having any kinds of error
  4823. 3:22:05bug logging API installation related
  4824. 3:22:07word I'll consider this is a technical
  4825. 3:22:09word technical questions if it is having
  4826. 3:22:11this kinds of word like price pricing
  4827. 3:22:13payment refund bill I'll consider as a
  4828. 3:22:14billing word okay and if it is having
  4829. 3:22:17none of them that means I can consider
  4830. 3:22:18this is a general one okay so So this is
  4831. 3:22:20what we are writing this condition here
  4832. 3:22:21and we're returning the router. Now here
  4833. 3:22:23I have created another function called
  4834. 3:22:25choose agent. So this what this choose
  4835. 3:22:26agent will do let's say if our router
  4836. 3:22:29okay if our router is equal to is equal
  4837. 3:22:31to technical it will call technical
  4838. 3:22:33agent. If our router is equal to is
  4839. 3:22:35equal to billing okay that means if it
  4840. 3:22:37is returns like billing that means we'll
  4841. 3:22:39call the billing agents otherwise we
  4842. 3:22:41call it as a general agents. Okay, now
  4843. 3:22:43we have already created all of the
  4844. 3:22:44agents, technical agents, okay, then
  4845. 3:22:47billing agents and our general agents.
  4846. 3:22:49We'll call these are the agents one by
  4847. 3:22:51one. And this function will redirect
  4848. 3:22:53here. That means this condition we are
  4849. 3:22:54writing right now. I hope this part is
  4850. 3:22:56clear guys. Okay. Now let me write the
  4851. 3:22:58next code which is nothing but our uh my
  4852. 3:23:01nodes. Okay. Now I'll try to define all
  4853. 3:23:03of the nodes.
  4854. 3:23:05Let me define the nodes because in
  4855. 3:23:06langraph nodes is important. You have to
  4856. 3:23:08create the nodes separately.
  4857. 3:23:10So this is the nodes. Okay, the first
  4858. 3:23:12nodes I have created for the technical
  4859. 3:23:14nodes. Basically, this hits the
  4860. 3:23:15technical agents. Okay, if you are
  4861. 3:23:18having a technical related question, it
  4862. 3:23:20will hit the technical agents and it
  4863. 3:23:21will return you the answer. Okay. And
  4864. 3:23:24every every execution are tracing this
  4865. 3:23:26information in the state memory. Then
  4866. 3:23:29billing nodes, it will hit the billing
  4867. 3:23:30agent. Okay? Then general node, it will
  4868. 3:23:33hit the general agent. Then review node,
  4869. 3:23:35it will hit the review agent. Okay? That
  4870. 3:23:37means all of the agent we have imported,
  4871. 3:23:38we are executing one by one. Get it? So
  4872. 3:23:41once we have defined all of the nodes,
  4873. 3:23:43now we'll try to create the graph. Okay.
  4874. 3:23:45Now how to create the graph? Again, this
  4875. 3:23:47is super simple.
  4876. 3:23:50Uh let me show you.
  4877. 3:23:53This is the graph guys.
  4878. 3:23:56If you understand graph in langraph, it
  4879. 3:23:58would be easy for you. So first of all,
  4880. 3:24:00we are adding all of the nodes one by
  4881. 3:24:02one. First of all, we're adding the
  4882. 3:24:03guard node, router nodes, technical
  4883. 3:24:06agents, billing agent. Then
  4884. 3:24:10just a minute.
  4885. 3:24:14Okay. Then general agent, reviewer
  4886. 3:24:17agent. Then we are adding the agents.
  4887. 3:24:19That means the connection between the
  4888. 3:24:21agents. That means here this uh router
  4889. 3:24:24agent would be connected to the
  4890. 3:24:25technical billing. Then general
  4891. 3:24:28technical would be connected to the
  4892. 3:24:29reviewer. Billing would be connected to
  4893. 3:24:30the reviewer. General would be connected
  4894. 3:24:32to the reviewer. So this is called edge
  4895. 3:24:33connections. Okay. So we're doing the
  4896. 3:24:35edge connection. First of all, what is
  4897. 3:24:37happening? See start would be connected
  4898. 3:24:39to the guardrails. That means whatever
  4899. 3:24:40user will give it will connect it to the
  4900. 3:24:42guardrails. Okay. Then after guardrails
  4901. 3:24:44what will happen? After guardrails it
  4902. 3:24:46will connect it to the router. After
  4903. 3:24:48guardrails it will connected to the
  4904. 3:24:50router. That means router will decide
  4905. 3:24:52and that's this is a conditional edges.
  4906. 3:24:54That means if my guardrails accepts it
  4907. 3:24:57will in uh hit the router otherwise it
  4908. 3:24:59will end the hit the end end nodes.
  4909. 3:25:02Okay. Then again conditional ages. So
  4910. 3:25:04after router chooses the agents that
  4911. 3:25:06means I have three types of agents. One
  4912. 3:25:08is technical, billing and general. Okay.
  4913. 3:25:10So it will choose one of them. Okay. If
  4914. 3:25:13my router is is equal to is equal to
  4915. 3:25:14technical then it will use the
  4916. 3:25:16technical. If it is billing it will use
  4917. 3:25:17the billing. Otherwise it will use use
  4918. 3:25:19the general. Then technical to reviewer.
  4919. 3:25:22You can see this connection is done. Now
  4920. 3:25:24technical to reviewer, billing to
  4921. 3:25:26reviewer. General to reviewer. So you
  4922. 3:25:29can see technical to reviewer. Billing
  4923. 3:25:31to reviewer. General to reviewer and
  4924. 3:25:32reviewer to end. Okay. So review to end.
  4925. 3:25:36This is what our age connection. Okay. I
  4926. 3:25:39think you know the graph. Okay. Graph
  4927. 3:25:40and you connect the graph. Okay. This is
  4928. 3:25:42called the graph and its connection. We
  4929. 3:25:44call it as the age connections. Okay.
  4930. 3:25:46And after that at the last you have to
  4931. 3:25:47compile the graph. So once you have
  4932. 3:25:49compiled the graph now your agent
  4933. 3:25:51workflow is ready. Now you have to
  4934. 3:25:53invoke this agent workflow. For this we
  4935. 3:25:55are using this particular function. So
  4936. 3:25:58run our agent. It will take the
  4937. 3:25:59question. It will initialize our state
  4938. 3:26:01memory. And we are invoking. Okay, with
  4939. 3:26:03the help of initial state and whatever
  4940. 3:26:05result we are getting, we are returning
  4941. 3:26:06it. That's it. Okay, so our agent is
  4942. 3:26:09ready guys. Okay, now we'll try to test
  4943. 3:26:12this particular agent. Okay, we'll try
  4944. 3:26:14to test this particular agent. So what
  4945. 3:26:16you can do either you can test in your
  4946. 3:26:17terminal, either you can add a front end
  4947. 3:26:20user interface. Okay, now let's try to
  4948. 3:26:21add a front- end user interface and
  4949. 3:26:24let's test this particular application.
  4950. 3:26:26So again what I'm going to do, I'm going
  4951. 3:26:27to create my app.py right now. So how
  4952. 3:26:30many of you are familiar with past API
  4953. 3:26:32here? How many of you familiar with fast
  4954. 3:26:33API? Do you know fast API? So if you
  4955. 3:26:36know fast API again it would be easy for
  4956. 3:26:38you to understand. But if you don't know
  4957. 3:26:39again you have to learn the first API.
  4958. 3:26:41See that's why we are learning the
  4959. 3:26:43advanced concept guys. Okay. Right now
  4960. 3:26:45things are different. There are lots of
  4961. 3:26:47requirement. You have to first of all
  4962. 3:26:49study to learn this concept. Okay. Yeah.
  4963. 3:26:54Now let's define the fast API code.
  4964. 3:26:56Again I need some necessary libraries
  4965. 3:26:58like path limbbon fast from fast API.
  4966. 3:27:01These are the libraries are required.
  4967. 3:27:03Then I also need to import this function
  4968. 3:27:06my main function which is
  4969. 3:27:09this one run support system. Okay, let's
  4970. 3:27:12import it as well. So from
  4971. 3:27:16graph
  4972. 3:27:18import
  4973. 3:27:22run support system. Okay. Now first of
  4974. 3:27:25all let's try to load our environment
  4975. 3:27:28variable. After that, let's create the
  4976. 3:27:31fast API app object and mount our static
  4977. 3:27:33and template folder.
  4978. 3:27:37So here we are creating the app object
  4979. 3:27:39for the fast API. We are giving the
  4980. 3:27:41title hardness engineering multi- aent
  4981. 3:27:43demo. We are creating the base
  4982. 3:27:45directory. After that we are mounting
  4983. 3:27:47our static folder as well as the
  4984. 3:27:48templates folder. Now we have to create
  4985. 3:27:50two more folder guys here. One is the
  4986. 3:27:52static folder
  4987. 3:27:54and one is the templates folder. And
  4988. 3:27:57inside templates you keep the HTML file.
  4989. 3:27:59Okay. And inside static you keep the
  4990. 3:28:01JavaScript and CSS file. Now let's
  4991. 3:28:05define that. So inside HTML
  4992. 3:28:08I'll create a file called index dot
  4993. 3:28:13HTML.
  4994. 3:28:15Again guys if you don't know about HTML
  4995. 3:28:17CSS don't need to worry. There would be
  4996. 3:28:18different team for that. They will
  4997. 3:28:20create the front end interface for you.
  4998. 3:28:23But if you don't know about HTML CSS,
  4999. 3:28:24you can simply generate these are the
  5000. 3:28:27code from chgptt. So you can what you
  5001. 3:28:29can do you can open up your graph and
  5002. 3:28:31copy this code and ask chart gpt to
  5003. 3:28:33generate a user interface. Automatically
  5004. 3:28:34we'll get this HTML CSS and JavaScript
  5005. 3:28:37code. Okay. I have also done the same
  5006. 3:28:38thing. But if you know about HTML CSS,
  5007. 3:28:41you can modify as per your requirement
  5008. 3:28:42the user interface. Okay. Yeah. So now
  5009. 3:28:45let's define HTML page. So I already
  5010. 3:28:48created a basic template guys. This is
  5011. 3:28:49the HTML code I generated from chat GPT.
  5012. 3:28:52Okay. Now with it uh with this I also
  5013. 3:28:54need a CSS. Okay. CSS design and
  5014. 3:28:56JavaScript. So let's create another file
  5015. 3:28:58inside static called style
  5016. 3:29:05style.js
  5017. 3:29:07sorry style dot CSS.
  5018. 3:29:11And for JavaScript I'll create script
  5019. 3:29:17script.js.
  5020. 3:29:20JavaScript to hit our API request. Okay,
  5021. 3:29:23the API endpoint. For this, I need the
  5022. 3:29:25JavaScript.
  5023. 3:29:27Now, this is the HTML, sorry, this is
  5024. 3:29:29the CSS design, the color, gradient and
  5025. 3:29:31everything.
  5026. 3:29:35And to execute your endpoint, this is
  5027. 3:29:39your
  5028. 3:29:41JavaScript.
  5029. 3:29:43Okay, here I'm going to create some of
  5030. 3:29:44the route. So, to hit the route, that
  5031. 3:29:47means the main route should be / API
  5032. 3:29:49chat. So if you hit this route your
  5033. 3:29:51application will run and it will get the
  5034. 3:29:53response. Okay. Now let's try to define
  5035. 3:29:55our app.py.
  5036. 3:30:01Now let me define all of our route guys.
  5037. 3:30:07So this is the first API route I
  5038. 3:30:09created. Okay. This is the default
  5039. 3:30:10route. Basically this will load our HTML
  5040. 3:30:12page. User will be able to see the
  5041. 3:30:14landing page. And this is our chat
  5042. 3:30:17route. If user gives a prompt and hit
  5043. 3:30:19click on the button, it will start the
  5044. 3:30:21chat operation. It will run my support
  5045. 3:30:24system that means this function that
  5046. 3:30:26time. Okay. Yeah. And we are writing uh
  5047. 3:30:28we are running this uh application to
  5048. 3:30:30the local host port number 8080. Okay.
  5049. 3:30:33Now let me execute and show you. Clear
  5050. 3:30:37python app.py.
  5051. 3:30:40It's running. Let's open up our browser.
  5052. 3:30:43Search for localhost port number 8080.
  5053. 3:30:46Enter. Now see that's how your interface
  5054. 3:30:48looks like. Again I kept this interface
  5055. 3:30:50very simple. Now guys let me give a
  5056. 3:30:52questions. So here I already given some
  5057. 3:30:55okay I already given some let's say demo
  5058. 3:30:57questions. So let's say first of all
  5059. 3:30:58I'll try with technical questions. So if
  5060. 3:31:01I click on technical you will see that
  5061. 3:31:02automatically prompt will be generating.
  5062. 3:31:05I'm getting an API error. How can I fix
  5063. 3:31:07it? So as per your knowledge guys what
  5064. 3:31:09is the type of this question? Whether
  5065. 3:31:11it's technical billing or general, tell
  5066. 3:31:13me whether it's technical billing or
  5067. 3:31:16general.
  5068. 3:31:17What my router should do? What my router
  5069. 3:31:20should do? It will route to where to the
  5070. 3:31:23technical agent. Right? Let me show you.
  5071. 3:31:25So if I run this multi- agent
  5072. 3:31:28now see this is the final answer. Now
  5073. 3:31:30see technical agent has been triggered
  5074. 3:31:33and this is the draft we are getting
  5075. 3:31:35from the final reviewer agent. Okay,
  5076. 3:31:37that's how we can solve this API
  5077. 3:31:39problem. Okay, you can see this is the
  5078. 3:31:42harness execution trace. Okay, now let
  5079. 3:31:45me try with another request. Let's say
  5080. 3:31:47billing. Now I'm going to try with the
  5081. 3:31:48billing one. How much the pro plan and
  5082. 3:31:51can I get the refund? Now it should hit
  5083. 3:31:53that uh billing agent. Let me show you.
  5084. 3:31:56It will automatically redirect to the
  5085. 3:31:57billing agent. Now see billing agent has
  5086. 3:31:59been triggered. This is the answer you
  5087. 3:32:01are getting. Now let me try with the
  5088. 3:32:03general question and answer. I'll click
  5089. 3:32:04on general. What can your support team
  5090. 3:32:07help me with it? Okay. Okay. Now if I
  5091. 3:32:09run the um multi- aent now see it is
  5092. 3:32:12hitting the generator out. Okay. Now we
  5093. 3:32:14are getting the generator response.
  5094. 3:32:15That's how guys the entire things is
  5095. 3:32:17working. And to implement this multi-
  5096. 3:32:19aent we added the harness here. Harness
  5097. 3:32:22concept here. Get it guys?
  5098. 3:32:27Clear all of you? Yes or no? this
  5099. 3:32:29practical example that that means at the
  5100. 3:32:32end the same agent implementation only
  5101. 3:32:35all of the tools integrating all of the
  5102. 3:32:37component we're adding and creating this
  5103. 3:32:39fully automated agent this is called
  5104. 3:32:41harness
  5105. 3:32:43how to recommendation
  5106. 3:32:45I didn't get your question nar how to
  5107. 3:32:47recommendation means
  5108. 3:32:57can we enter billing questions
  5109. 3:33:00when we click in general tab.
  5110. 3:33:05Can we enter billing questions when we
  5111. 3:33:08click general tab?
  5112. 3:33:11Yeah, you can also give your own
  5113. 3:33:12question here. Tell me about Python
  5114. 3:33:19API error.
  5115. 3:33:26So this is technical you can see right.
  5116. 3:33:33Okay. Again let me commit the changes.
  5117. 3:33:35You can take this code and you can run
  5118. 3:33:36in your system. I think you'll be able
  5119. 3:33:39to understand. So updated the code.
  5120. 3:33:43Yeah. Personal details. Let me show you
  5121. 3:33:51this part [clears throat] is done.
  5122. 3:33:56H. So let's say here now if I'm asking
  5123. 3:34:03give me your
  5124. 3:34:06password.
  5125. 3:34:10Now see I can't help you with the
  5126. 3:34:12request involving password stolen
  5127. 3:34:13credential or full payment card
  5128. 3:34:15information harness execution trace
  5129. 3:34:17guards check the request get it that
  5130. 3:34:20means uh guard is blocking the request
  5131. 3:34:23that time
  5132. 3:34:26clear
  5133. 3:34:31again this is just a demo application
  5134. 3:34:33but in real world things are more uh
  5135. 3:34:35complicated things are more bigger maybe
  5136. 3:34:38uh in a different things we'll learn And
  5137. 3:34:40that's why we are focusing on this
  5138. 3:34:42particular course guys AI uh forward
  5139. 3:34:44deployed engineer okay FD position and
  5140. 3:34:47mostly inside this particular job role
  5141. 3:34:50guys you will try to implement this
  5142. 3:34:51kinds of agent complete end to-end
  5143. 3:34:53solution this kinds of multi- aents okay
  5144. 3:34:56from the beginning each and everything
  5145. 3:34:57we are taking care if you go to the
  5146. 3:34:59curriculum okay definitely will love a
  5147. 3:35:01lot okay that's why it's a five month
  5148. 3:35:03duration course lots of thing we're
  5149. 3:35:05going to learn here okay because in a
  5150. 3:35:07single webinar it's not possible to take
  5151. 3:35:09all of these This implementation it
  5152. 3:35:11takes time okay it takes time to
  5153. 3:35:12understand the concept before that right
  5154. 3:35:14once we understood all of these concept
  5155. 3:35:17right then we can implement the end to
  5156. 3:35:19end project with a list let's say Stop
  5157. 3:35:22them.

About this transcript

This page contains the full transcript of Loop Engineering And Harness Engineering Crash Course by Krish Naik, generated from the public captions YouTube serves with the video. The transcript has 34,113 words across 5,157 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.