YouTube2Text

Google’s Free 2-Hour AI Agent Course: Master Harness, Loops & Graph Engineering (0% to 100%) — Transcript

by frugle 1.7M · 16,191 words · 2,219 segments · language en · Watch on YouTube

Full transcript

  1. 0:00There are three popular ways to evaluate
  2. 0:02your AI agent. First, LM as a judge. It
  3. 0:05is basically using another model to
  4. 0:07evaluate the system. You can give
  5. 0:09another model the agent's response, the
  6. 0:11fact it should use, and your evaluation
  7. 0:13criteria. And then it ask questions like
  8. 0:16was the answer clear? Was it accurate?
  9. 0:18Was it supported by the facts? The model
  10. 0:21can then return a score or simple pass
  11. 0:24or fail result. And second,
  12. 0:26deterministic evaluation. This is when
  13. 0:28code checks a fixed rule. For example,
  14. 0:30ADK's built-in two trajectory average
  15. 0:32score checks if agents court exact tools
  16. 0:35in exact order you expected. In this
  17. 0:38customer refund agent example, this
  18. 0:41deterministic evaluation two to three
  19. 0:44average score can check whether the
  20. 0:46agent looks up the order before issuing
  21. 0:49the refund. It will compare the actual
  22. 0:52result with a golden data set using
  23. 0:56exact match because we are using exact
  24. 0:58match to compare. The rule is fixed. The
  25. 1:01same input will always give you the same
  26. 1:03result every single time. However,
  27. 1:05building ways are not enough. We need
  28. 1:07more flexible way to evaluate our
  29. 1:10system. And that brings us to the third
  30. 1:12point, a custom function. In this
  31. 1:15customer refund example, if you want to
  32. 1:17check whether the agent refunded more
  33. 1:20money than the customer actually paid,
  34. 1:22you can write your own function to check
  35. 1:24that. And this type of customer check
  36. 1:26can also be deterministic. But of
  37. 1:29course, it can be non-deterministic if
  38. 1:31you wrap an LM inside your custom
  39. 1:33function. And that's our three ways of
  40. 1:35doing agent eval. We have LM as a judge,
  41. 1:38deterministic evaluation, and custom
  42. 1:40function. You can use one approach or a
  43. 1:43combination of them based on your system
  44. 1:46needs. With those evaluation steps, you
  45. 1:48can ensure your AI agents are reliable
  46. 1:51and production ready. Let's talk about
  47. 1:54three layers of memory that your AI
  48. 1:56agent has. Those layers are state,
  49. 1:58sessions, and long-term memory. So,
  50. 2:01let's use a travel planning agent as an
  51. 2:03example. First, state. You can think of
  52. 2:06state as agents working memory. It keeps
  53. 2:08information the agent needs right now
  54. 2:10like remaining budget for your trip or
  55. 2:12current travel plan. It is like a
  56. 2:14scratch note that you can put important
  57. 2:16information on it and pass it among
  58. 2:17different components in your system and
  59. 2:20as a plan changes the state gets updated
  60. 2:23too. And second sessions a session keeps
  61. 2:26context of one conversation thread. It
  62. 2:29includes everything in the conversation
  63. 2:31transcript like messages to calls to
  64. 2:34results and state. a session service
  65. 2:36manager saving and loading that
  66. 2:38information. You could use an in-memory
  67. 2:40backend for example run for quick and
  68. 2:43easy context or you can add a persistent
  69. 2:45database so the session can survive
  70. 2:48server restarts and continue later. This
  71. 2:51is really important in the long running
  72. 2:53process. Third, long-term memory.
  73. 2:56Long-term memory carries useful
  74. 2:58information across conversations. In
  75. 3:00ADK, we have session service to manage
  76. 3:03all the sessions and memory service to
  77. 3:06manage the memory across the sessions.
  78. 3:08To use them in this trip example, you
  79. 3:10could told the agent that you prefer
  80. 3:12quiet neighborhoods. A session service
  81. 3:14can store all the conversations you ever
  82. 3:16talk to the agent. A memory service
  83. 3:18source and retrieves that information
  84. 3:20and then brings relevant memories into
  85. 3:22the context so you can plan it next
  86. 3:25trip. So memory service can help us
  87. 3:27manage cross session context. To
  88. 3:30summarize, each layer has a different
  89. 3:32job. State is what this agent is working
  90. 3:35with right now. Sessions preserve the
  91. 3:37current conversation and long-term
  92. 3:39memory carries useful information into
  93. 3:42the future. And now your AI is context
  94. 3:45aware and ready for production.
  95. 3:53Yeah. So today's session uh we are going
  96. 3:56to talk about how do you book a ticket
  97. 3:58at a concert you know um you like so
  98. 4:02this the context is um there's a band
  99. 4:06called Midnight Signal and you really
  100. 4:09want to go to this concert uh so both
  101. 4:11you and your friend Sam you want to go
  102. 4:13to there to buy a ticket however there's
  103. 4:15a super long line super long queue so
  104. 4:19you want to like use an agent to help
  105. 4:21you get a ticket but this agent is you
  106. 4:23had to wait in the super long queue. It
  107. 4:25has to like continuously checking, okay,
  108. 4:28is it my turn, is it my turn? And then
  109. 4:29when is your turn? The agent is able to
  110. 4:32help you, you know, uh, select a seat
  111. 4:34and then book the ticket for you. And
  112. 4:36the agent also need to remember your
  113. 4:38preference such as, oh, Sam only can
  114. 4:40only go on the weekend, but you prefer
  115. 4:42to avoid different type of seats. So it
  116. 4:45need to understand your preference need
  117. 4:47to remember all your contacts and also
  118. 4:49it's able to wait in the queue to book
  119. 4:51the ticket for you and even you refresh
  120. 4:53the server even you're waiting for like
  121. 4:56you know days or weeks is it will still
  122. 4:58like be there waiting for you it's
  123. 5:00remember uh it's it's a resumable
  124. 5:03process over there. So that's the uh
  125. 5:06that is the agent we're trying to build
  126. 5:07for today and um uh so today um so this
  127. 5:12is going to be fun. I'm going to play
  128. 5:13this concert music really soon. But
  129. 5:16yeah, uh this is not to encourage you to
  130. 5:19build a bot for your ticket. This is
  131. 5:22just a a use case, you know, we just
  132. 5:25want to demonstrate, you know, how to
  133. 5:26create a longunning uh agent and then
  134. 5:30how do we have the resumable state, how
  135. 5:32do we have the human in the loop so that
  136. 5:34you can configure your budget when you
  137. 5:36buy the ticket. So this is more like for
  138. 5:37the learning purpose. It's not for you
  139. 5:39to create an actual you know bot for you
  140. 5:41to get get a ticket but like um just
  141. 5:43want to have that claim at the very
  142. 5:45beginning but yeah I hope that you're
  143. 5:47gonna having fun you know learning how
  144. 5:50to creating this agent and also learn
  145. 5:51all the concept. So we're gonna uh break
  146. 5:54down our session into uh six pieces
  147. 5:57today. So we will learn first of all how
  148. 5:59do we create a single agent to create a
  149. 6:01ticket and then we're going to say okay
  150. 6:03once you want the agent to uh to just
  151. 6:07send uh to wake up the agent from the
  152. 6:09sleep to wake up the agent and actually
  153. 6:11checking the sitting process you will
  154. 6:13realize that you need a trigger you need
  155. 6:15to like have a trigger like how do you
  156. 6:17configure the trigger to uh checking the
  157. 6:20sitting processing and then uh next
  158. 6:22we're going to learn all the manage like
  159. 6:24a state management for the long running
  160. 6:25things so that even the service Even you
  161. 6:28restart a server, you will still
  162. 6:29remember where you are. And then we're
  163. 6:31going to try uh to pause and restart and
  164. 6:33resume to actually see how the long
  165. 6:35running workflow work. And after that,
  166. 6:37uh we will learn, you know, when when
  167. 6:39it's actually your turn to purchase the
  168. 6:41ticket. What if the seat you selected
  169. 6:43earlier is already gone like uh how do
  170. 6:47you uh like like even you have a great
  171. 6:50memory update, but in the imagine like
  172. 6:52uh many people are going to purchase
  173. 6:54this ticket at the same time, right? So
  174. 6:57uh when it's your turn uh the t the seed
  175. 7:00you selecting might be how do you handle
  176. 7:01that scenario when you're scaling the
  177. 7:03system and also how do you avoid
  178. 7:06purchasing twice when you are uh when
  179. 7:08you p like when multiple people choosing
  180. 7:10the same seed and then you are fail to
  181. 7:12purchase it and then you have to
  182. 7:13purchase again how do you avoid purchase
  183. 7:15it twice how do you basically it's a
  184. 7:18little bit about system design that how
  185. 7:19do you uh manage this long running
  186. 7:22workflow but multip multi people uh need
  187. 7:24to purchase the ticket for the system
  188. 7:26and lastly we're going to learn uh we're
  189. 7:28going to deploy all the way to cloud
  190. 7:29run. So yeah it's going to be um so
  191. 7:33we're going to um it's we're going to
  192. 7:34cover every single process of you know
  193. 7:37ma memory management state management
  194. 7:39longunning workflow and even like
  195. 7:41multiple purchasing how do we handle the
  196. 7:43state update how do you how do we using
  197. 7:46the callback to help prevent uh how
  198. 7:49making sure updating the seat selection
  199. 7:51and also uh prevent the mode uh
  200. 7:53purchasing twice. Yeah. So, it's a lot.
  201. 7:56We're going to cover a lot and and then
  202. 7:57hope that you're learning so much by the
  203. 8:00end of the session. So, that being said,
  204. 8:02I'm going to start sharing my screen to
  205. 8:03help you um set things up and I'm going
  206. 8:06to share my link to the chat. Making
  207. 8:09sure you have all the link with me.
  208. 8:12So, the lab is
  209. 8:16this is the link and also this is the
  210. 8:18credits.
  211. 8:19Hope that you already know all the
  212. 8:20credits.
  213. 8:23Okay. So this is the credit uh I'm going
  214. 8:26to use. And this is the uh lab. I'm
  215. 8:29gonna stop sharing and uh start sharing
  216. 8:32my uh screen for the lab.
  217. 8:37Okay. Yeah. So this is the link that I
  218. 8:41need to claim the credit. So for those
  219. 8:42of you who are familiar with the
  220. 8:43process, making sure you're using the
  221. 8:45Gmail account, not using a university or
  222. 8:47organization account. And when you claim
  223. 8:49the credit, you need to have a recapture
  224. 8:52installed on your phone. So once you
  225. 8:54open it, you need to verify you're human
  226. 8:56with the uh
  227. 8:59scan the QR code and then open the app
  228. 9:02on my phone to claim the uh credits.
  229. 9:08So once I claim the credits, I will open
  230. 9:11today's lab. So uh if you go to this
  231. 9:14link, this is the lab for today's link.
  232. 9:16As always, we already migrating all the
  233. 9:19lab to this uh interactive app uh format
  234. 9:22so that you only need to worry about the
  235. 9:24setup stage. Uh so once you set things
  236. 9:26up, everything going to be in the one
  237. 9:28interactive app and we will have all the
  238. 9:29concept. You have all the theory, all
  239. 9:31the diagram and all the deep dive and
  240. 9:34also all the uh testing in one place. So
  241. 9:37you do not have to you know you check
  242. 9:39back and forth and then you will learn
  243. 9:41everything in one place and uh um so you
  244. 9:44can review them even after the session.
  245. 9:47So to start all you need to do is just
  246. 9:49uh clone the ripple and run the setup
  247. 9:51script. So to clone the ripple again you
  248. 9:53can clone this uh in your local
  249. 9:55environment but today as always if
  250. 9:58you're if you're familiar with the
  251. 10:00session we are using Google cloud
  252. 10:01console. This is the VM on cloud. So
  253. 10:04that is a control environment and to
  254. 10:06open the to open the uh to open this
  255. 10:08environment you need to go to the
  256. 10:09console.cloud.google.com
  257. 10:11and on the top right we have activate
  258. 10:13cloud shell. So we are going to do
  259. 10:15everything in the cloud shell today to
  260. 10:16have a control environment for everyone
  261. 10:18but feel free to do it uh in your own
  262. 10:22local environment if you have UV and
  263. 10:24everything configured.
  264. 10:25So now I have I clone this repo and the
  265. 10:29next thing is I have the seta script. So
  266. 10:31the set has script probably going to run
  267. 10:33for like two to three minutes. What it
  268. 10:35does behind the scene is first it will
  269. 10:37checking does I redeem the credits and
  270. 10:39then you will create a Google cloud
  271. 10:41project for me and then you will link
  272. 10:43the credit to the project and after that
  273. 10:45you will configure all the API and then
  274. 10:47you will configure all the environment
  275. 10:49download the uh dependency and
  276. 10:51everything because in this lab you're
  277. 10:53using a lot of different state
  278. 10:54management including using the cloud SQL
  279. 10:56for the persistent data management. So
  280. 10:58we need to making sure you know um we
  281. 11:01have this Postgress instance running in
  282. 11:02the background and also we will need to
  283. 11:07uh deploy our so we will do like a
  284. 11:10deployment in the background I think and
  285. 11:12then and then we also need to configure
  286. 11:15some uh permissions so that later on we
  287. 11:18are able to using uh cloud run to for
  288. 11:22the deployment and more. So those one
  289. 11:24setup script uh is doing all the
  290. 11:26configuration for this lab
  291. 11:29and it usually take around
  292. 11:322 minute or so and then after that we
  293. 11:34just need to run the verify to configure
  294. 11:36to making sure uh things are verified
  295. 11:38and then run the script making sure um
  296. 11:43it's loading our solution and then just
  297. 11:46uh run the workbench script just so that
  298. 11:48we kick off the workbench and then
  299. 11:50that's all and then we will going to
  300. 11:52start work on this workbench.
  301. 11:53start from um the setup. So, oh okay.
  302. 11:57So, I need to create a project ID.
  303. 12:01So,
  304. 12:05it's like creating a So, I just press
  305. 12:07enter and then it will create a new
  306. 12:09project ID for me and then it will link
  307. 12:11to it.
  308. 12:13Oh, oh my gosh, I removed this. Sorry
  309. 12:15about that.
  310. 12:18Thank you so much for for uh reminding
  311. 12:20me. almost made the same mistake as last
  312. 12:23time. Thank you so much.
  313. 12:28Yeah, claim easily.
  314. 12:41[snorts]
  315. 12:41Oh, so this step probably take a little
  316. 12:43little while. So, I want to show you the
  317. 12:45uh the music we're playing for today.
  318. 12:48Um, let me see. I can show it in another
  319. 12:52screen so that we can listen to the
  320. 12:54concert while we're waiting for while
  321. 12:56waiting for this. Let me open one.
  322. 13:06Oh, okay. I guess another window doesn't
  323. 13:11Oh, okay. This is working. Let me share
  324. 13:13my screen for another one because this
  325. 13:15one is still loading. I have another one
  326. 13:17that uh I'm already tried it earlier. So
  327. 13:21I'm going to share this one. Yeah. So
  328. 13:24this is like what you're going to see
  329. 13:25later on when you uh spin up this
  330. 13:27workbench. You will have a multiple
  331. 13:29step. Um you'll have this multiple step
  332. 13:32and then we have everything in one
  333. 13:33place. So this is the ticket master. Uh
  334. 13:37the ticket monster [laughter]
  335. 13:40we're gonna work on. So this ticket
  336. 13:43monster is a is a app that we want to uh
  337. 13:45use the agent to book the ticket for us.
  338. 13:48Uh and then you will like waiting in the
  339. 13:49queue and then checking whether we at
  340. 13:51the front of the queue and then book the
  341. 13:52ticket for us. And this is a concert
  342. 13:55we're going to we will we will see.
  343. 13:59First I want to making sure I share the
  344. 14:01screen with music because last time I
  345. 14:03didn't share the screen with music so
  346. 14:05you guys couldn't hear my voice. Not
  347. 14:08making sure. Okay. Share the screen with
  348. 14:11music. Cool. I'm going to play this.
  349. 14:13This is the
  350. 14:15So, we're going to jam is this music
  351. 14:19this
  352. 14:25[music]
  353. 14:29[singing]
  354. 14:31[music]
  355. 14:34>> midnight signal. Midnight signal. Yeah,
  356. 14:36we're burning through a spectral
  357. 14:37current. Searching for you. No fear in
  358. 14:39the shadow. No heat in the wire. Jessica
  359. 14:41[music]
  360. 14:42fire with a high static in the air.
  361. 14:46>> Okay, I'm gonna stop playing. Uh yeah,
  362. 14:49so this is also generated by AI from
  363. 14:51Google's lyrics model. Uh this whole
  364. 14:54band music. [laughter]
  365. 14:56Yeah,
  366. 14:57gems. Yeah, thank you. So Christina
  367. 14:59generated this uh uh this this music. So
  368. 15:01this whole lab is actually kudo to
  369. 15:03Christina that she created the lab and I
  370. 15:05re I rework on her lab and then she has
  371. 15:08some conflict today unfortunately. So I
  372. 15:10have to like I will deliver the slap for
  373. 15:11her. Um but yeah this is like a fun
  374. 15:14energy from the concert and uh yeah so
  375. 15:18this is the whole uh interface you're
  376. 15:20going to work on and this is the band
  377. 15:22you want to watch the concert you want
  378. 15:24to go and you want to purchase the
  379. 15:25ticket for this concert and this the
  380. 15:27whole story. So let me switch back the
  381. 15:29screen for my setup screen. U making
  382. 15:31sure I have successfully set up
  383. 15:33everything. just uh share the screen and
  384. 15:36um
  385. 15:39share my screen for another one.
  386. 15:44Okay. Yeah, as you can see this is still
  387. 15:47loading. Oh, cool.
  388. 15:50Right. So, uh once you see something
  389. 15:52like this, it should work on 4800
  390. 16:004,800 but uh 4,800.
  391. 16:03But just to double check. So here is a
  392. 16:05venue. So this venue is the uh is the
  393. 16:07ticket monster you're you're going to
  394. 16:10have. So we deploy this one for you when
  395. 16:11we run the setup script. So if you want
  396. 16:13to play the music, you can play the
  397. 16:15music here. And um
  398. 16:18over here uh it says uh verify
  399. 16:21everything. But I just want to making
  400. 16:22sure I follow the step to
  401. 16:26just configure everything. So I will
  402. 16:28making sure I run this your solution so
  403. 16:31that it can have loading all the
  404. 16:32solution for me so that I don't have to
  405. 16:34do the uh change during the during the
  406. 16:39lab and then and then next step is to
  407. 16:42load this with 4 4800
  408. 16:45and then run this um workbench script
  409. 16:47again it's already uh on 4800. So
  410. 16:51everyone now need to focus on this is
  411. 16:54the final step for us to open this app.
  412. 16:58So the to open this app is making sure
  413. 17:01uh there's a web preview. So there's a
  414. 17:03button called web preview and then uh
  415. 17:06okay just emphasize it twice. There's a
  416. 17:09button called web preview. So click the
  417. 17:10web preview and then change the port to
  418. 17:13um 4800 and then do the change and
  419. 17:16preview so that you will go to the
  420. 17:184,800. But if you're in your local host,
  421. 17:20you should be able to open it in your
  422. 17:22local host. But if you're on cloud cloud
  423. 17:24shell, you can preview this on this
  424. 17:264,800 port. It is on back preview button
  425. 17:28like it's on the top right back preview
  426. 17:31button. And then change the port to
  427. 17:324,800. And then you'll be able to see
  428. 17:34the things over here. And I feel like uh
  429. 17:37light mode today. So [laughter]
  430. 17:39on the top right, you have the light
  431. 17:40mode. And here we successfully open up
  432. 17:43our app for today. And this is a
  433. 17:45midnight signal I just played over
  434. 17:47there.
  435. 17:49And um as uh if so we have all the stab
  436. 17:53over there. So now we do not need to
  437. 17:55have this uh collab. This collab is
  438. 17:57mostly just explaining certain things.
  439. 17:59Um you can just stay in this uh 4800 uh
  440. 18:03preview and then we have all the step
  441. 18:05over there. So to go through all the
  442. 18:07step uh we can first help you get
  443. 18:09familiar with this uh workbench. So uh
  444. 18:13at the so step one a mission is just
  445. 18:16making sure you know explaining things
  446. 18:18we will learn you will learn how do we
  447. 18:20uh queue in the system and how do we um
  448. 18:23what we will learn and then if you click
  449. 18:26those button if you click this button it
  450. 18:27will show left hand side and then for
  451. 18:29the workplace um we we will work in ADK
  452. 18:33web UI
  453. 18:35so every every stage we will show you
  454. 18:38the source code and we will highlight
  455. 18:40the important on because you know
  456. 18:42nowadays almost everyone we are coding
  457. 18:44is AI but we still it's still important
  458. 18:47to know the fundamental know the concept
  459. 18:50know what's know the important uh line
  460. 18:53in the code because you still need to
  461. 18:55review a lot of uh code do a lot of code
  462. 18:57review right so um we do not need you to
  463. 19:00do any copy and paste we just uh the
  464. 19:03whole purpose for this app is just to
  465. 19:05show you the theory show you the concept
  466. 19:07show the fundamental and you'll also
  467. 19:08know the corresponding key uh code so
  468. 19:11that you will connect the dot with the
  469. 19:13theory and the corresponding code
  470. 19:17and we also do for each step we will do
  471. 19:20things in ADK web UI. So with ADK web UI
  472. 19:22we have in the top right so if you click
  473. 19:25top right button ADK web UI you will
  474. 19:27able to see the ADK web UI going to
  475. 19:30start in this uh side panel and you can
  476. 19:32directly interact with it we're going to
  477. 19:34show you soon. So if you go to step uh
  478. 19:37step two like on the top left we have V
  479. 19:40and this is basically the very first
  480. 19:41step to help you get familiar with uh
  481. 19:44the system. So [snorts] this is uh to
  482. 19:47first give a try with the agent and then
  483. 19:50and then you can test it with ADK web UI
  484. 19:53and at each stage you will have you will
  485. 19:55see this notification uh just making
  486. 19:58sure it helps you to uh check
  487. 20:00everything's ready for this section so
  488. 20:02that you can testing things
  489. 20:03understanding things. So just making
  490. 20:05sure go to the every session you can run
  491. 20:07you can click this button this button is
  492. 20:09at yeah load the step so that you will
  493. 20:11basically it will configure all the step
  494. 20:13for you for this this lab. So once you
  495. 20:15click this button you will see all the
  496. 20:17step over there and you will have the uh
  497. 20:20ADK web UI directly open up here and you
  498. 20:22can talk to ADK web UI you can open ADK
  499. 20:24web UI in the new page and you can see
  500. 20:26all the instruction over here. Yeah. So
  501. 20:29this whole thing is it's it's containing
  502. 20:32you know the corresponding key code uh
  503. 20:34and also the theory explanation and also
  504. 20:37the app is on always on the left hand
  505. 20:39side and ADK web UI is always in the
  506. 20:41side panel. So this is how we are
  507. 20:43designing this uh this whole experience.
  508. 20:46So while um like you're exploring this
  509. 20:48app I'm going to switch back to my slide
  510. 20:50just to explain more about the theory so
  511. 20:53that later on we can uh you know switch
  512. 20:55back to this workbench to play around
  513. 20:57it. in a pause. Yeah, I hope you like
  514. 21:00it.
  515. 21:04Yeah, thank you for the feedback. Yeah,
  516. 21:06we really want to uh help, you know,
  517. 21:08trying to simplify trying to simplify
  518. 21:11things at the same time, you know,
  519. 21:12putting as much concept as possible in
  520. 21:15one lab. That's the that's that's the
  521. 21:18hope. Hope that um reached the goal. Yo,
  522. 21:20okay. So, James, you like dark mode.
  523. 21:22Okay, I like light mode for my app. I
  524. 21:26don't know.
  525. 21:28made with our organ. Oh yeah, it's made
  526. 21:32with uh anti-gravity.
  527. 21:36Let me stop the screen and start to
  528. 21:39share the slide.
  529. 21:44Okay. So we explaining the uh the this
  530. 21:48is a lab layout. So I'm going to you
  531. 21:50will have that app with you. So you can
  532. 21:52play the music, you can just play around
  533. 21:53with with the app and you will you can
  534. 21:56do the reading yourself. You can do this
  535. 21:57at your own pace but at the same time I
  536. 21:59can explain you know uh what are what is
  537. 22:02the longunning agent we're trying to
  538. 22:04create for today. So to create a
  539. 22:07longunning agent for you know to help
  540. 22:10you purchase a ticket but to get start
  541. 22:12let's first talk about what is uh the
  542. 22:15simple agent you can create to purchase
  543. 22:17a ticket. Um again we are using Google's
  544. 22:20agent development kit ADK to build the
  545. 22:22agent. And then as you can see that uh a
  546. 22:25quick recap for the agent. I know
  547. 22:26everyone most of you are coming from
  548. 22:28agent 101 but for those of you who
  549. 22:30haven't been to the live stream before a
  550. 22:32quick concept for the agent is vention
  551. 22:34have the model at the brain has an
  552. 22:35instruction so that the model will
  553. 22:37follow the instruction and then we have
  554. 22:39the tools to connect into external uh
  555. 22:41world and connecting some API to do
  556. 22:43things for you and then for this agent
  557. 22:46to create a simple agent we can have
  558. 22:48like uh one agent with a model as a
  559. 22:51brain and then one tool is to ask the
  560. 22:55seller which concerts exist to search
  561. 22:58the events. Another like get scene map
  562. 23:00is to ask okay which section has it and
  563. 23:03what they cost and then we have the
  564. 23:05purchase is later we can use the tool to
  565. 23:07purchase a ticket to make the actual
  566. 23:09request and then um the model going to
  567. 23:14like do the reasoning based on the
  568. 23:15request and then going to picking the
  569. 23:17corresponding tool to do things for you.
  570. 23:19So the first thing is I want to try to
  571. 23:23uh tell this a so because right now I
  572. 23:26want to do the purchase right um I'm
  573. 23:29actually in the middle of the line for
  574. 23:31example if I have a thousand people or
  575. 23:33like 10,000 people or 100 thousand
  576. 23:35people like what if like we have like a
  577. 23:37lot of people for for example Tyler
  578. 23:39Vifter's uh concert and then I'm like
  579. 23:41really in the in the line but so uh I I
  580. 23:44just I want to keep tracking you know uh
  581. 23:46so while I'm checking the the the queue
  582. 23:49status stat u maybe I'm not at the
  583. 23:51frontter uh status right so I need to
  584. 23:54like come back and check okay what is
  585. 23:56the status right now can I do the
  586. 23:57purchase right now so we want to tell
  587. 23:59the monster uh the sticky monster to say
  588. 24:02oh suppose suppose we're still in the
  589. 24:04queue or suppose the sale hasn't opened
  590. 24:06yet in all the scenario we want to tell
  591. 24:09the ticking monster to say okay can you
  592. 24:11check again in 10 seconds and then the
  593. 24:13agent it might reply to say sure I will
  594. 24:15keep watching and then uh so for example
  595. 24:18in this current version if you leave the
  596. 24:20service running I look for another check
  597. 24:22even though it is telling you okay I
  598. 24:24will keep watching but it's not set up
  599. 24:26the timer and the second check will not
  600. 24:30start automatically even though the
  601. 24:32reply it reply sounds helpful but it
  602. 24:35didn't actually arrange a future work
  603. 24:38even though we are telling like very
  604. 24:40detailed instruction you can in the
  605. 24:41instruction of the to the agent you can
  606. 24:44just tell like you can be very specific
  607. 24:46about you know like run every 10 in 10
  608. 24:49seconds or check in 5 seconds or or
  609. 24:51anything but um it doesn't work that
  610. 24:55way. So that that so that bring us uh
  611. 24:58this point that we really need a
  612. 25:00trigger. So we need a trigger that event
  613. 25:02can start the agent uh next piece of
  614. 25:05work. So we need some something to
  615. 25:07trigger that I mean and then we need to
  616. 25:09like actually do the check on okay what
  617. 25:11is the current status what is the sales
  618. 25:13uh status and what are status in the
  619. 25:15queue. So um with a single agent if
  620. 25:19you're telling the in the instruction to
  621. 25:22uh telling the agent to check in the 10
  622. 25:23seconds in it's not even though it's
  623. 25:26giving the answer it's not working. So
  624. 25:27here is how we want to set things up. So
  625. 25:30we want to have uh two part one is a
  626. 25:33trigger one is a trigger. [laughter]
  627. 25:36So uh the trigger part is we want to it
  628. 25:40could be in this scenario if you um
  629. 25:43follow this uh this arrow. So after 10
  630. 25:45seconds you want to have a clock. So
  631. 25:48it's a timer right it's a 10 seconds
  632. 25:50timer and then it send a request to our
  633. 25:52application and then it will arrive at
  634. 25:54the some like v in this specific
  635. 25:56application we have this endpoint uh
  636. 25:58called vake endpoint. So it will arrive
  637. 26:01at this end uh end vake endpoint. So
  638. 26:06this endpoint how it works behind the
  639. 26:08scene is it will call the runner and
  640. 26:11then it will start executing things. So
  641. 26:15uh for those of you who are I'm not sure
  642. 26:17how many of you are first time building
  643. 26:19with ADK
  644. 26:21um if you're first time building with
  645. 26:22ADK ADK is agent development kit it's a
  646. 26:26free open-source framework that you can
  647. 26:28build in agent so for ADK we have some
  648. 26:32component that called runner uh runner
  649. 26:35is basically the event executor it's
  650. 26:38powering up it's like a engine for your
  651. 26:40agent it's powering up the whole system
  652. 26:42for example when you have the user have
  653. 26:44the uh request and then it's like do the
  654. 26:47reasoning it's picking the different
  655. 26:48tools all through the request and then
  656. 26:50we have the runner that's the event
  657. 26:51executor to power up the whole thing so
  658. 26:53that we have this event loop and then
  659. 26:55you can uh the agent can start doing uh
  660. 26:58executing things. So uh in this scenario
  661. 27:02we are we have this clock uh it's
  662. 27:04trigger this uh trigger this uh to to to
  663. 27:09uh send the request and then you will uh
  664. 27:11call this V endpoint and then the the
  665. 27:15endpoint calls the runner and the runner
  666. 27:16is like going to executing things. So it
  667. 27:20will so for example if it fire the clock
  668. 27:22once you say okay check uh check things
  669. 27:24in the 10 seconds and follow that
  670. 27:26request uh and then it will check okay
  671. 27:28uh did the clock send the things did the
  672. 27:30things arrive uh did the v uh receive
  673. 27:33the request and then it will did the
  674. 27:35runner start and things and then it will
  675. 27:36start to uh and it will start to follow
  676. 27:39this order to see whether we have uh
  677. 27:42successfully
  678. 27:43uh activate this trigger. So uh we will
  679. 27:47soon in our web app to see how we can
  680. 27:50try things with uh single agent this
  681. 27:53doesn't work and then later on we're
  682. 27:55going to see how do we create this uh v
  683. 27:57endpoint to see how it actually modify
  684. 28:00things and then we will see how do we
  685. 28:02send this 10-minut uh trigger so that it
  686. 28:05will trigger this uh v thing and then so
  687. 28:08you know in a real life example when you
  688. 28:11actually want to check the things you
  689. 28:12probably you you might want to do the
  690. 28:13crown job you might want to
  691. 28:15uh do the checking things regularly but
  692. 28:18to get start you first you want to
  693. 28:19making sure this one trigger work. So
  694. 28:22once the one trigger work u you can set
  695. 28:24the schedule job or you can check
  696. 28:26regularly to making sure things work. So
  697. 28:28this is the to uh this is to set the
  698. 28:30stage for later on we can check things
  699. 28:32uh regularly. So let's uh switch back to
  700. 28:35the web app to to test uh the server and
  701. 28:40clock this trigger and to get to connect
  702. 28:42the data about how ADK runner can
  703. 28:44executing things and how we can um how
  704. 28:47the how the trigger work and okay so I'm
  705. 28:50going to switch back to my screen stop
  706. 28:53sharing
  707. 28:56and uh
  708. 28:59oh you don't see the trigger in the
  709. 29:01slide uh you will see this in the in the
  710. 29:03web app.
  711. 29:06Let me share the screen.
  712. 29:09Hope this is the right one.
  713. 29:14[snorts] Oh, it's nice to see you.
  714. 29:19Yeah, it's like watching things. But uh
  715. 29:22yeah, so right now I am at uh section
  716. 29:26two uh at the vake part. So the first
  717. 29:29part to a prompt is the example that you
  718. 29:31can keep telling the agent to say oh can
  719. 29:34you check things so you will ask example
  720. 29:36and then you will you will see things
  721. 29:38work and then you can give a try or can
  722. 29:40you try things uh in
  723. 29:44let's first just uh get familiar with
  724. 29:46our very first agent and then later on
  725. 29:48we will learn um how do we have this
  726. 29:50trigger so to at the 2A prompt if you go
  727. 29:54to ADK web UI if you click you can easil
  728. 29:58click this button or on the top right
  729. 30:00you can activate this. So we have all
  730. 30:02the step on the on the panel and uh ADK
  731. 30:06web UI for those of you who start ADK at
  732. 30:08the first time uh you know ADK is to a
  733. 30:11framework to building the agent AD web
  734. 30:12UI is a way you can directly
  735. 30:14troubleshooting and talking to your
  736. 30:16agent so you can verifying testing
  737. 30:18troubleshooting and then um you can see
  738. 30:20the tracing and everything so it's a
  739. 30:22development tool for you to easily um
  740. 30:24interacting with your the agent you
  741. 30:26created and over here we putting the ATM
  742. 30:28UI in this uh interactive app uh in your
  743. 30:32own development you can start adv is uh
  744. 30:35by typing ADK web in your command line.
  745. 30:38So over here if I go to this command
  746. 30:40line I can start a new session. So on
  747. 30:42the top right I will start a new
  748. 30:44session. I will tell this agent to see
  749. 30:46um uh which which one have the seats for
  750. 30:50me and send and then you need to keep
  751. 30:52checking to tell me if things work.
  752. 30:56So what it does okay will do some recall
  753. 30:58on the uh on the current uh context. So
  754. 31:02you will check the current context and
  755. 31:04then you will see okay those are things
  756. 31:06it's finding and it will search the
  757. 31:08event getting the seat map and then
  758. 31:10basically it is using the uh those tools
  759. 31:13we just created and then to get more
  760. 31:16information to the user. However, um
  761. 31:19when it's trying to when you are trying
  762. 31:21to ask this agent to keep checking and
  763. 31:24tell me if anything change, you pretty
  764. 31:26much want the agent to continuously uh
  765. 31:28monitor and checking things. But if you
  766. 31:30don't have things configured, uh you
  767. 31:32simply just tell the agent to do that.
  768. 31:34Um if you just have a really good
  769. 31:36instruction to say continuous checking,
  770. 31:38uh it may not work. So we will we will
  771. 31:41explain how to set up the trigger for
  772. 31:43things connecting with runner. So the
  773. 31:46whole uh 2A prompt is just to get you
  774. 31:48familiar with this first uh agent we're
  775. 31:50creating and uh over here we have we
  776. 31:54basically highlighted the important
  777. 31:56instruction for the agent and this is
  778. 31:58the root agent we have over here we have
  779. 32:01the instruction we have the tools with
  780. 32:02search agent get seat map and recall and
  781. 32:06then uh those are the step you just saw
  782. 32:08in the ADK web UI.
  783. 32:10So uh let's go to the second part with
  784. 32:14the uh something has to listen. So how
  785. 32:17do you set up uh trigger? This is like
  786. 32:20uh 2 a 2 b and 2 c. So so first you need
  787. 32:24to uh we need to take a look at how to
  788. 32:27have something to actually uh checking
  789. 32:30the whole status and then so basically
  790. 32:33as you take as you can take a look we
  791. 32:34have this uh we have this receiver and
  792. 32:37the caller. So over here you could pos
  793. 32:40you could trigger by set a timer or you
  794. 32:43could trigger by have a corn job or have
  795. 32:45a click on the website and over here is
  796. 32:47that you can have pops or or um some API
  797. 32:50call anything to tri to trigger things.
  798. 32:54So on the left hand side it's like uh
  799. 32:56the trigger and on the right hand side
  800. 32:57is what we call trigger because uh it is
  801. 33:00the way to start this trigger
  802. 33:04and and also just like what I mentioned
  803. 33:06before with uh ADK runner. So ADK runner
  804. 33:10is like a power app this whole thing
  805. 33:12that's why it's like has a charger
  806. 33:13connecting to the whole thing. So
  807. 33:15whenever the user uh is sending this
  808. 33:17request to say booting me a ticket and
  809. 33:20then uh runner it will power up the
  810. 33:22whole thing by start the new session ID
  811. 33:24and then it will connect this user
  812. 33:26information connect the session
  813. 33:28information and then connect this whole
  814. 33:30it will start to have the session
  815. 33:32service to store all the conversation
  816. 33:35and then you will like it you will
  817. 33:37basically uh like connecting to the
  818. 33:40session service and memory service and
  819. 33:41also uh to this corresponding user and
  820. 33:44with this corresponding session and then
  821. 33:46you will start to uh like power up the
  822. 33:49whole thing. So we will making sure have
  823. 33:51the new session ID and then you have the
  824. 33:52store session session later on we will
  825. 33:54talk about um what is session service
  826. 33:56and how do we manage all the contacts in
  827. 33:59this long running process.
  828. 34:01So making so you will attach the
  829. 34:02sessions and then it will start a work.
  830. 34:05So over here you can see we have the
  831. 34:06space we could have like multi- agent
  832. 34:08base agent sub agent or only have one
  833. 34:10agent and then you could have multiple
  834. 34:12tools. So you could like once you have
  835. 34:14the connect the session connect the sess
  836. 34:16uh connect the create a session ID
  837. 34:18connect the session and then start a
  838. 34:20work and then you will can call the to a
  839. 34:22to b and then do the loop. So uh behind
  840. 34:25the thing we have this runner to uh
  841. 34:27power up the whole thing. So we have
  842. 34:29this uh flow over here to uh to explain
  843. 34:32things. So when whenever we're using ADK
  844. 34:34web you know ADK web is a development
  845. 34:36tool. Uh so ADK web already have a
  846. 34:38built-in runner to power up the things
  847. 34:41but if you're creating your own server
  848. 34:43your own application you cannot rely on
  849. 34:45ADK web right because ADK web is a
  850. 34:47development tool uh it's not the actual
  851. 34:50you cannot directly using it so you need
  852. 34:52to uh often time configure your own
  853. 34:54runner and in your own runner you need
  854. 34:56to associate a session and everything to
  855. 34:58it and over here in the server part
  856. 35:02basically we are uh this is like a
  857. 35:04trigger we're talking about over here
  858. 35:06and uh this is the vake uh endpoint we
  859. 35:09were talking about earlier and here we
  860. 35:12have all the implementation
  861. 35:18[clears throat]
  862. 35:18and uh let's give a try. So if you want
  863. 35:21to start a questions through your own
  864. 35:23server. So once I click this start
  865. 35:25monster ticket and then you will start
  866. 35:28this application on left hand side and I
  867. 35:30can just copy this question to say uh
  868. 35:32check whether this show still has seat
  869. 35:34and tell me what you find.
  870. 35:36Uh this is like a testing for okay uh
  871. 35:40for this one check I want to check
  872. 35:42whether it still have the seat and later
  873. 35:44on what I want to do is I want to like
  874. 35:45schedule this check. uh I want to set a
  875. 35:48clock to schedule this check so that I
  876. 35:50can trigger this check so that every
  877. 35:52time it will check this whole thing and
  878. 35:53after that I want to do a schedule this
  879. 35:56check so I can check every single like
  880. 35:58every 10 minutes like I set a time
  881. 35:59interval to to check that so this is uh
  882. 36:02to start with okay how do I first have
  883. 36:04this check and then this is example of
  884. 36:07you know I'm just checking it and on
  885. 36:09this left hand side this is like a ticky
  886. 36:11monster app if I go to the console I
  887. 36:13will see how does it uh it will call the
  888. 36:16sigma app and then you will tell me the
  889. 36:18answer and then you will answer me.
  890. 36:21So this is like example of I'm using
  891. 36:25this um I wake up this server um because
  892. 36:29use I wake up the server and then I will
  893. 36:31um trigger this and and also if you want
  894. 36:34to uh
  895. 36:36if you want to uh learn more about it
  896. 36:37making sure you uh like if you review
  897. 36:40the code you will see how uh how we are
  898. 36:42doing the handler and connecting those
  899. 36:44with a runner to power up the things.
  900. 36:48So once we know how to check the seats
  901. 36:52and what's next is you want to
  902. 36:54potentially set a timer so that you can
  903. 36:56trigger this check. So once you know how
  904. 36:58to trigger this check later on you can
  905. 37:00like continually continuously watching
  906. 37:02this process. [clears throat]
  907. 37:06I'm [snorts] going to drink some water.
  908. 37:11Yeah. So if you go to uh step 2C,
  909. 37:14this is a clock that send the next
  910. 37:16request. This is a step that you want
  911. 37:18schedule [clears throat] your your
  912. 37:19ticket check. So before we just testing
  913. 37:22the server, okay, we're testing this
  914. 37:23check is working correctly. And the next
  915. 37:26thing is we want to like file once like
  916. 37:2810 seconds from now on. So I just click
  917. 37:30this five once 10 seconds from now on.
  918. 37:32And then um I was going to wait
  919. 37:36uh in the log. I'm going to wait until
  920. 37:38like from 10 seconds from now on. Um you
  921. 37:41can see that it start to trigger this in
  922. 37:44the log.
  923. 37:48And then this step is you can compare or
  924. 37:51this reply how how does a reply uh work
  925. 37:54compared to the previously uh the reply
  926. 37:57work. But the whole thing is this clock
  927. 38:00is a trigger and this direct trigger is
  928. 38:02to uh we want to trigger this uh we want
  929. 38:05to trigger this in 10 seconds but later
  930. 38:07on you can do this uh check in a
  931. 38:09different way. uh to have this to be and
  932. 38:11to see we basically connect the dot on
  933. 38:14you know how do you do this um how do
  934. 38:16you trigger this check and then how do
  935. 38:19you set a timer or uh have some action
  936. 38:22to trigger this check um so this whole
  937. 38:26process is we first learn you know if
  938. 38:28you simply putting this in the prompt
  939. 38:31putting this in the instruction uh it's
  940. 38:33not working you need to making sure
  941. 38:35understanding how the ADK runner work
  942. 38:38and having your server side uh logic and
  943. 38:41then in this case we have our endpoint
  944. 38:44to check the situation and then we
  945. 38:47configure this timer to check uh to to
  946. 38:51send this message to the vic endpoint so
  947. 38:53that it will run the agent to do the
  948. 38:55check for us.
  949. 38:57So this is the first part that we need
  950. 39:00to know about how to build this uh agent
  951. 39:03to book the ticket for us. And the
  952. 39:05second part we need to learn is how do
  953. 39:08we uh how do we manage the state because
  954. 39:11essentially our goal is we want to build
  955. 39:13a longunning agent that it will uh
  956. 39:16continuously check for us and even our
  957. 39:18service shutdown and then when we
  958. 39:21restart it will continue pick up from
  959. 39:23what we were before and then you will be
  960. 39:25able to uh always resume from where you
  961. 39:28were before. So the next step is you
  962. 39:30need to learn how do we have the
  963. 39:32persistent state management so that uh
  964. 39:35we are able to resume from where we were
  965. 39:38before and for this part we will learn
  966. 39:42uh different I think we have a diagram
  967. 39:44one here no uh maybe it's not over here
  968. 39:47let me see it's in this diagram one
  969. 39:51uh see
  970. 39:54yeah okay I guess I don't have this
  971. 39:56diagram here maybe it's in one of my
  972. 39:59previous version. Yeah. So in this part
  973. 40:02we will learn how do we uh we will learn
  974. 40:04different type of uh how do we manage
  975. 40:06the context for uh with ADK. We will
  976. 40:09learn how do we manage the session
  977. 40:11service how do we manage the memory
  978. 40:12service and also the artifact service
  979. 40:15and in this lab we will um using the
  980. 40:18persistent memory with cloud SQL and uh
  981. 40:21we will build our own memory service and
  982. 40:23we also will have the artifact ser uh we
  983. 40:26will have the artifact store to store
  984. 40:28some artifact for our system. So
  985. 40:30basically it's like uh um so we will
  986. 40:32explore the estate management for our
  987. 40:36long runninging process and the point to
  988. 40:38learn this is so that we can resume from
  989. 40:40where we were before and then we can so
  990. 40:43to connect the dot is first you know how
  991. 40:45to set a trigger and then you know how
  992. 40:47to have the persistent store and then
  993. 40:49you know how do we uh resume from a long
  994. 40:52running process and and then so that you
  995. 40:54can continuously you can build an agent
  996. 40:55that contin continuously check uh
  997. 40:58whether which what are the status is in
  998. 41:00your in the queue and what is the
  999. 41:01situation and then even you shut down
  1000. 41:04the machine you can always book the
  1001. 41:05ticket um it will always watch the
  1002. 41:08situation and book the ticket for you so
  1003. 41:10I'm going to start explaining the
  1004. 41:12context part but let me quickly check
  1005. 41:14the chat to see if you have any question
  1006. 41:17oh thanks um pun to answer the question
  1007. 41:21for me
  1008. 41:26oh runner is not like a harness so
  1009. 41:28harness is basically basically
  1010. 41:30everything around the agent. So the
  1011. 41:32concept is more uh it's it's wider. It's
  1012. 41:35basically containing everything about
  1013. 41:37context memory and context. Uh it's it's
  1014. 41:40containing uh how do we do the Q2
  1015. 41:42execution, how do we do the workflow,
  1016. 41:44it's containing how do we do the
  1017. 41:45privacy, how do we do the sandbox uh
  1018. 41:48maintenance and how do we like basically
  1019. 41:50everything around the model could be a
  1020. 41:52harness layer. But runner in ADK concept
  1021. 41:56it's just like event executor. is
  1022. 41:58powering up the whole thing to uh to
  1023. 42:00power up this event loop. So that's uh
  1024. 42:03two different concept. But that's a
  1025. 42:05really good question. [clears throat]
  1026. 42:08Hi,
  1027. 42:10I like your uh profile picture.
  1028. 42:13[laughter]
  1029. 42:14Uh what is in memory here? Yeah, we
  1030. 42:16[snorts] will explore in memory here uh
  1031. 42:18really soon.
  1032. 42:21>> [snorts]
  1033. 42:21>> Okay. So to talk about the context if
  1034. 42:24you were here at agent 101 u you
  1035. 42:26probably we we mentioned this earlier
  1036. 42:28about you know how do we manage the
  1037. 42:31memory for agentic system. We talk about
  1038. 42:33session we talk about service session
  1039. 42:35service memory service and more. So
  1040. 42:37basically when I have a conversation
  1041. 42:38with agent uh every conversation the
  1042. 42:41whole run is one session and inside the
  1043. 42:44one session we will have uh we will have
  1044. 42:47some important important stuff for
  1045. 42:50example I have like breakfast coffee and
  1046. 42:52I will put down in the note and then
  1047. 42:54that is a state will share among
  1048. 42:56different component in the system. So
  1049. 42:58state is like a uh it's like a key value
  1050. 43:01pair important scratch node from the
  1051. 43:03whole conversation uh in one session and
  1052. 43:05then we also talk about the cross
  1053. 43:07session basically if we have all the
  1054. 43:09sessions together that's a session
  1055. 43:11service that store all the conversation
  1056. 43:13here um so over here today in this lab
  1057. 43:16we're using the we're [clears throat]
  1058. 43:18using
  1059. 43:20if if you deploy everything we will
  1060. 43:21using the cloud to store everything
  1061. 43:24about our transcript and then uh So we
  1062. 43:28have like we have a storage to store all
  1063. 43:30our conversation all the transcript. So
  1064. 43:32that's session service the session
  1065. 43:34manager and then we also have memory
  1066. 43:36manager. Memory manager is basically to
  1067. 43:39distill the fact from one uh
  1068. 43:41conversation and we store in a memory
  1069. 43:43thing. So because you do not want agent
  1070. 43:46to always recall the whole conversation
  1071. 43:48you have earlier to understand what's
  1072. 43:50going on. So you want to like store some
  1073. 43:52important uh thing in memory. So here we
  1074. 43:55have the memory service so that it can
  1075. 43:57store the distill fact and then whenever
  1076. 44:00you do the recall you will recall from
  1077. 44:02the memory service so that it has a
  1078. 44:04context from the previous conversation.
  1079. 44:06So that's more like a high level picture
  1080. 44:08for this lab and the very important part
  1081. 44:11for the persistent data for for this one
  1082. 44:14is when we do the session service we
  1083. 44:16need to store them in the um in the
  1084. 44:19[clears throat] actual
  1085. 44:20uh we we need to store them in the
  1086. 44:22database. we cannot store them in the
  1087. 44:24inmemory because if we store the
  1088. 44:26everything in the inmemory when we uh
  1089. 44:28restart the reboot the machine we will
  1090. 44:30lose everything. So the whole point is
  1091. 44:33when we are doing the session service uh
  1092. 44:35over here at this point we have this
  1093. 44:38SQLite to configure to store all the all
  1094. 44:41the conversation and we have the
  1095. 44:43artifact URI to configure the to store
  1096. 44:46the files. For example, if you in your
  1097. 44:49in your talking history, you have some
  1098. 44:50image data, you can store them in the
  1099. 44:53artifact service uh URI. So the whole
  1100. 44:56point for uh this
  1101. 44:59the first part the session DB is it's
  1102. 45:01important to know that you need to store
  1103. 45:04things in the persistent database so
  1104. 45:06that um we can have this uh surviving we
  1105. 45:09can have the long running of longunning
  1106. 45:12workflow survive uh in the restart. So
  1107. 45:15I'm going to switch back to my uh slide
  1108. 45:18to talk more about the the session the
  1109. 45:23doable store and the session and state
  1110. 45:25and then we're going to continue around
  1111. 45:26the lab over here.
  1112. 45:29Let me share the screen. [snorts]
  1113. 45:41Okay. So this is the screen and um
  1114. 45:45So we have the session service and the
  1115. 45:47database. Uh basically as I mentioned
  1116. 45:50before session service manage the
  1117. 45:51session save the records and uh we have
  1118. 45:54in this slide we have SQLite to store
  1119. 45:56some of the records but then when the
  1120. 45:57deploy in the deploy stage uh we will
  1121. 45:59want to deploy them to cloud SQL. So the
  1122. 46:02session service provides a operation and
  1123. 46:05the SQLite is is a storage underneath
  1124. 46:08and then um so you you probably notice
  1125. 46:12we have the event here and we have the
  1126. 46:14state here and what does that mean and
  1127. 46:16what does the event really representing
  1128. 46:18for so in this case um it's important to
  1129. 46:22know that when we talk about our context
  1130. 46:24we have the event that record what
  1131. 46:26actually happened so for example if you
  1132. 46:28ask for uh Amsterdam and then the tour
  1133. 46:31return some shows and then the agent
  1134. 46:33will select for example select Sunday.
  1135. 46:36So we follow that sequence and we
  1136. 46:37understand the whole decision. So that
  1137. 46:39is the uh that the event will record
  1138. 46:43that how that happened and the state is
  1139. 46:46like holding the value for important
  1140. 46:48value in this conversation. For example
  1141. 46:50the party size is two. For example, the
  1142. 46:52target event ID is certain things so
  1143. 46:55that you will refer to this sticky notes
  1144. 46:59and putting things together like memory
  1145. 47:01service giving the agent to retrieve the
  1146. 47:03fact across the session from the early
  1147. 47:05conversation. And then in this lab we
  1148. 47:07have the markdown memory service that
  1149. 47:10you you imple you implement yourself.
  1150. 47:12And in my previous lab we talk about
  1151. 47:14Google has a manager service that is
  1152. 47:16Google cloud uh memory bank that is a
  1153. 47:18managed memory service. But this lab is
  1154. 47:20like a implementation that you can do it
  1155. 47:22yourself. [clears throat]
  1156. 47:24But either way whatever memory service
  1157. 47:26you're using we we usually have a recall
  1158. 47:28and uh remember. So recall uh remember
  1159. 47:32it's basically behind the scene it's
  1160. 47:34using it's doing the memory read and
  1161. 47:35memory write. So we need a way to always
  1162. 47:38read load the existing memory from the
  1163. 47:41pre-existing memory service and also we
  1164. 47:43need a way to add session to memory.
  1165. 47:45Basically we want to distill the fact
  1166. 47:46from the session and save that to the
  1167. 47:48memory. So over here we just call them
  1168. 47:50recall and remember for the memory read
  1169. 47:52and write but they're just fancy word
  1170. 47:53for the read and write. Essentially we
  1171. 47:55just want to do uh memory uh just we
  1172. 47:58want to have this dial file from the
  1173. 48:00session to do that. And you probably
  1174. 48:02also notice that over here we have this
  1175. 48:04user user pref. So user pref will stick
  1176. 48:06to the user and it will also exist
  1177. 48:09across different session
  1178. 48:12and let me share the
  1179. 48:16yeah so basically if you're putting
  1180. 48:17things together we have session service
  1181. 48:19save all the conversation and the task
  1182. 48:21progress in our SQLite database and then
  1183. 48:23we have this memory service to retrieve
  1184. 48:25the selected facts and then we have
  1185. 48:27artifact service to save and load the uh
  1186. 48:29agent load the files that agent creates
  1187. 48:31and use
  1188. 48:36And those are important uh fact uh for
  1189. 48:40the session state for our uh for our
  1190. 48:43lab. So we have some so if you can see
  1191. 48:45we have a temp value. So temp value it
  1192. 48:48just a squash data for current you know
  1193. 48:51you inovocation. It doesn't save as a
  1194. 48:52persistent it's only a temporary thing.
  1195. 48:55And then if you have the user as prefix
  1196. 48:57it will share a cross session for the
  1197. 48:59same app and user. if you have this user
  1198. 49:01prefix. Um, and also we have this memory
  1199. 49:05file as a separate storage for the
  1200. 49:07selected effects and we also have a
  1201. 49:08artifact to for the storage. And another
  1202. 49:12cool thing to know is a compaction.
  1203. 49:15I'm not sure if you notice that when you
  1204. 49:17talk to your coding agent and then when
  1205. 49:19you have a really long conversation, it
  1206. 49:20will automatically do the compact
  1207. 49:22itself. You will basically trying to
  1208. 49:24compact what you have before so that you
  1209. 49:26will have uh do the summary and compact
  1210. 49:28the previous history so that you can
  1211. 49:30continue to talk to to them in the same
  1212. 49:32conversation thread. So ADK also have
  1213. 49:34that feature. Uh we will you will see
  1214. 49:37how ADK is doing the compact by turn on
  1215. 49:40the compact um settings. So basically
  1216. 49:42you will do how how often you're going
  1217. 49:44to compact and then you how what is the
  1218. 49:46overlap so that you can have a
  1219. 49:48continuous uh summary for for all the
  1220. 49:52conversation you have and we also have
  1221. 49:54that in the in the lab for today and uh
  1222. 49:57let me share my screen for the app.
  1223. 50:02[snorts]
  1224. 50:04Here's the app. I think it's over here.
  1225. 50:11Okay. So now I am back to this uh 3B uh
  1226. 50:153A. It's a session one. So in the
  1227. 50:17session one, what I want to do with the
  1228. 50:18lab is I just uh loading the uh just
  1229. 50:21loading this. So I loading this existing
  1230. 50:24uh step three
  1231. 50:30and then I'm opening this ADK web UI. So
  1232. 50:33once I open this ADK web UI, I can
  1233. 50:35follow this uh instruction on the left
  1234. 50:37hand side. So I can start a new session.
  1235. 50:39Uh so and then I will copy this
  1236. 50:45conversation paste it to the chat to say
  1237. 50:48give uh Sam and me two tickets for the
  1238. 50:51show. So it will recall our uh previous
  1239. 50:55uh memory. So in the session state those
  1240. 50:57are existing state uh we have. So we can
  1241. 51:00see oh because uh Sam cannot do weekend
  1242. 51:03so a week night. So we cannot we won't
  1243. 51:05book one for uh for Sam for week night.
  1244. 51:12and it will search the things and then
  1245. 51:13trying to get the map over there.
  1246. 51:19And then if you um think do I
  1247. 51:24so at the session DB part we also
  1248. 51:27covered a little bit about how do you
  1249. 51:29configure the um the D SQLite DB and
  1250. 51:33also artifact DB so that you will have
  1251. 51:34the persistent data stored over here. So
  1252. 51:37if you configure the session service URL
  1253. 51:39you're pointing them to the SQLite you
  1254. 51:42have um you store everything and if you
  1255. 51:44pointing here in this lab you store this
  1256. 51:46JSON but of course you can store any
  1257. 51:48files you want and if you want to deploy
  1258. 51:50things Google has a Google Google cloud
  1259. 51:53uh storage for artifact uh storage on
  1260. 51:57cloud as well. So this is the persistent
  1261. 52:00part and for the memory part uh we have
  1262. 52:03this important uh this is like a user
  1263. 52:06level memory and then you can just uh
  1264. 52:08take a look to see how the agent is
  1265. 52:10doing the memory recall. So when they do
  1266. 52:12the memory uh remember is to do the
  1267. 52:15memory read and recall is to do the
  1268. 52:17memory uh
  1269. 52:19recall sorry remember is to memory write
  1270. 52:20and recall is memory read. So if I go to
  1271. 52:26so previous one when I ask this question
  1272. 52:28it's doing the recall recall is loading
  1273. 52:30the existing memory so that it can book
  1274. 52:32the ticket for me and then if I if I
  1275. 52:35telling this agent to say remember this
  1276. 52:36for the next time we always want this uh
  1277. 52:39type of seat so it will do the memory
  1278. 52:41read and then when I start a new session
  1279. 52:45and then I want to like book the ticket
  1280. 52:46again it's supposed to do the because I
  1281. 52:50read this I write this to the memory and
  1282. 52:51is supposed to recall this and if you
  1283. 52:54check the state
  1284. 52:57this is the previous information. So now
  1285. 53:01um it's able to give you the uh booking
  1286. 53:05more according to your situation. Yeah.
  1287. 53:08So this is just a a quick [laughter]
  1288. 53:10quick exercise for the memory one. You
  1289. 53:12probably see we have this different type
  1290. 53:14of memory service and this one we
  1291. 53:16creating our own memory service and for
  1292. 53:18the in-memory one is like uh usually
  1293. 53:21losing when you stop the process. The
  1294. 53:24memory bank one is the one we covered
  1295. 53:25earlier that you can have your um own uh
  1296. 53:29own memory bank on Google cloud. We also
  1297. 53:31have rag memory if you want to have
  1298. 53:33configure vortex AI rag memory for it.
  1299. 53:36But in this lab we have this own custom
  1300. 53:38memory that you can take a look how we
  1301. 53:40are doing that. Yeah. So that's it for
  1302. 53:42the uh the memory part. So next one is
  1303. 53:46we want to talk about how do we um
  1304. 53:50resume how do we have this long
  1305. 53:51runninging process so that we can uh so
  1306. 53:54we can like pause this we can kill them
  1307. 53:56overnight and we can continue because we
  1308. 53:58have this persistent database so that
  1309. 54:00even like we kill the process in the
  1310. 54:02middle of it uh we can still resume from
  1311. 54:05where we were before. So this is the
  1312. 54:07whole point of the things we want to
  1313. 54:09demo. So do a quick recap of the whole
  1314. 54:11thing the whole high level picture. So
  1315. 54:14over there we are using this workflow to
  1316. 54:17to configure this whole flow. So a quick
  1317. 54:21recap for workflow again and as so this
  1318. 54:24one is agent 102. So we assume that you
  1319. 54:27probably have some foundation for agent.
  1320. 54:30But in case you are first time learning
  1321. 54:32about agent concept or workflow concept,
  1322. 54:35workflow is basically a way for you to
  1323. 54:37have a making sure the system run in a
  1324. 54:40reliable and control way by drawing a
  1325. 54:42graph and then [snorts] you executing
  1326. 54:44things based on the order you draw the
  1327. 54:45graph and over here we are drawing this
  1328. 54:48oneline graph. And this graph is we have
  1329. 54:52we this is like the process. We're
  1330. 54:54trying to buy the ticket. We we open the
  1331. 54:57night. We're picking the show we want.
  1332. 54:58We're doing we're queuing up and we're
  1333. 55:00checking in the front to see okay what
  1334. 55:02is the situation whether I'm at the
  1335. 55:05front or not. And then I'm ready I'm
  1336. 55:07going to purchase the ticket. So this is
  1337. 55:09the uh the workflow for me to purchase
  1338. 55:13the ticket. And then for this whole
  1339. 55:16workflow I'm going to loading this uh
  1340. 55:18some of the process is waiting for the
  1341. 55:21human input and some of the process and
  1342. 55:23my agent is pausing there to check in
  1343. 55:25the situation. So the whole point is uh
  1344. 55:28no matter it's waiting for human input
  1345. 55:30or uh like uh or my agent is pausing
  1346. 55:34there to check okay whether how many
  1347. 55:36when when am I in the in the queue it's
  1348. 55:38able to stay in the workflow and then
  1349. 55:40even I kill the process and then restart
  1350. 55:42it will resume from where it were before
  1351. 55:44and it will continue uh having this long
  1352. 55:46running process.
  1353. 55:50So to check that I will start having
  1354. 55:54this uh new session
  1355. 55:57and
  1356. 55:59having this new session
  1357. 56:01and I'll say um give me two ticket for
  1358. 56:04this show.
  1359. 56:07So over here you can see this is the
  1360. 56:09workflow we're we're talking about. So
  1361. 56:11we have this c we have uh so the p show
  1362. 56:15is able to recall the thing search the
  1363. 56:17event um get the get the map and then
  1364. 56:19it's able to um queue up check the front
  1365. 56:22ready to buy and then and then go to the
  1366. 56:23end.
  1367. 56:30So over here you can say it's paused to
  1368. 56:32say uh you we have this long running
  1369. 56:35process over here to say okay now I am
  1370. 56:37at the queue uh well it's like very late
  1371. 56:40in the queue so it will wake me up again
  1372. 56:42I will check. So what we do over here is
  1373. 56:44you can see we are check we are waiting
  1374. 56:46in the queue and then we are in this
  1375. 56:48line and this line is it's uh it's
  1376. 56:50working but our agent going to just uh
  1377. 56:53pause here and wait to see okay um what
  1378. 56:56is my state if it's it seems I'm pretty
  1379. 56:58far away going to just still be there
  1380. 57:00and wait so remember earlier we talk
  1381. 57:02about we need to wake it up and check
  1382. 57:04the situation so here it's like we're
  1383. 57:06waiting there and then then we want to
  1384. 57:08see okay if I kill this process in the
  1385. 57:11middle of it um can I still remember the
  1386. 57:14queue situation and also remember all
  1387. 57:17the user context. So that's the whole
  1388. 57:21point we want to test. So I'm going to
  1389. 57:23continue over here. So you can see uh
  1390. 57:27you will able to see the uh this is the
  1391. 57:30ADK request state uh request input. This
  1392. 57:33is the variable request users input and
  1393. 57:35over here this is the whole um state
  1394. 57:38management for our uh agent.
  1395. 57:43And next is I want to kill the process.
  1396. 57:45So I just click kill to kill the
  1397. 57:47process. Uh if I open the ADK web app,
  1398. 57:49you can see this ADK already killed. So
  1399. 57:52we're trying to simulate a situation
  1400. 57:53that okay, I have this agent start to
  1401. 57:56waiting for help me purchase a ticket.
  1402. 57:58And you can see the queue is still
  1403. 58:00moving. But what if my service crash or
  1404. 58:02what if I reboot the service, I do the
  1405. 58:04redeployment in my actual production
  1406. 58:06environment. Um I just simulate this by
  1407. 58:08okay I killed this ADK web and then I
  1408. 58:11want to uh so and then I'm gonna restart
  1409. 58:13this I'm gonna show this again.
  1410. 58:15So when I show this again it still have
  1411. 58:18all the context I have earlier. You can
  1412. 58:19see it still remember this situation and
  1413. 58:22then um so it has all the context. So
  1414. 58:26this is the this is the uh why it was
  1415. 58:29important to talk about the resumable
  1416. 58:30state and contest management for agent.
  1417. 58:33>> [clears throat]
  1418. 58:33>> And then once I have this um I will skip
  1419. 58:36the weight. So if I skip the weight just
  1420. 58:38this is just for stimulate. Okay finally
  1421. 58:41um finally I am um at the front. So I'm
  1422. 58:45waiting for the suation I am at the
  1423. 58:46front. So I will click the resume the
  1424. 58:49current state. So hopefully that um it
  1425. 58:52will reach the front and then you will
  1426. 58:54trying to uh then trying to uh checking
  1427. 58:58things for me. So nothing has been found
  1428. 59:00uh nothing has been bobbed so far.
  1429. 59:03And then when we go to the next step uh
  1430. 59:06next step you know this is the workflow
  1431. 59:08we were talking about
  1432. 59:12I'm going to those are the uh important
  1433. 59:15step for how we are configure the
  1434. 59:17resumable workflow by the the key things
  1435. 59:19is to have that resume over there.
  1436. 59:25Uh so when we when we like so when we at
  1437. 59:29the front and you can see that um at the
  1438. 59:33state management it's already to see uh
  1439. 59:36it's it's remember all the all the
  1440. 59:39context I have it's remember the reason
  1441. 59:42uh and it's remember the things and I
  1442. 59:45think the whole thing the whole uh this
  1443. 59:47whole lab about resum uh this whole lab
  1444. 59:50this whole 4C section what we want to
  1445. 59:52share is basically um when you are
  1446. 59:55pausing for user input in this case uh
  1447. 59:59we have this request input and then you
  1448. 1:00:01will able to resume
  1449. 1:00:05from where you were before and then the
  1450. 1:00:07key thing sorry I'm looking for the
  1451. 1:00:09rerun equal to true part I think the key
  1452. 1:00:11key thing is uh if this rerun uh rerun
  1453. 1:00:15of resume is equal to uh false or true
  1454. 1:00:18so this is like the key uh line for you
  1455. 1:00:20to uh in enable whether this is uh we
  1456. 1:00:24can continue this or not. So the point
  1457. 1:00:26is a resumeumo uh a resume signal ask
  1458. 1:00:29for the test to continue and then if you
  1459. 1:00:31have the rerun on resume to be true it
  1460. 1:00:33will make the pause uh queue to verify
  1461. 1:00:35the things and it will continue. So this
  1462. 1:00:37whole la this whole section is like when
  1463. 1:00:39we pause for use input or when we pause
  1464. 1:00:42for the uh section uh we want to set
  1465. 1:00:45this to true so that uh you will can you
  1466. 1:00:48can resume from where you were before
  1467. 1:00:51and let's take a look at the section and
  1468. 1:00:57we can see the checked
  1469. 1:01:01let me see the request input. Yeah. So
  1470. 1:01:04if you go to the request input and uh
  1471. 1:01:08ready to purchase where is the checked?
  1472. 1:01:11Let me see. Ready to buy? Yeah, we have
  1473. 1:01:14the ready to buy. We have the same
  1474. 1:01:16queue. We have the ready to buy uh equal
  1475. 1:01:18to true and everything is working. So um
  1476. 1:01:23where's my agent? Here is true. Yeah. So
  1477. 1:01:27if you take a look at the uh ticket
  1478. 1:01:29monster over here, it's still uh it's
  1479. 1:01:31mentioning that you haven't bought a
  1480. 1:01:33ticket because you just simply uh we
  1481. 1:01:37haven't purchased things yet because uh
  1482. 1:01:38the purchase the actual purchase is the
  1483. 1:01:40last step but this step is basically uh
  1484. 1:01:43the agent is pausing there and waiting
  1485. 1:01:45for your inputs or it's waiting for next
  1486. 1:01:48step. Um so the whole thing is we're
  1487. 1:01:51demonstrating that we have this
  1488. 1:01:54resumable state. So uh we we have this
  1489. 1:01:56persistent state so that uh we have the
  1490. 1:01:58persistent memory and then when you have
  1491. 1:02:00this long running workflow configured
  1492. 1:02:02with a rerun equal to true and with a
  1493. 1:02:04resumable configuration it's able to
  1494. 1:02:07resume from where you were before and
  1495. 1:02:09you won't break the workflow. It won't
  1496. 1:02:10start a new workflow. we will um resume
  1497. 1:02:13from we were before um by have certain
  1498. 1:02:15configuration no matter it is the no
  1499. 1:02:19matter it is the uh pausing for you know
  1500. 1:02:21like in this situation we have this
  1501. 1:02:23agent waiting for the Q situ Q to be the
  1502. 1:02:25front or you can have the human or you
  1503. 1:02:28can have the node that waiting for the
  1504. 1:02:30human input and then can pause there for
  1505. 1:02:32human input. So whatever situation it
  1506. 1:02:33is, if you configure the resumable
  1507. 1:02:36configuration, it will always be able to
  1508. 1:02:39uh resume this process if you have this
  1509. 1:02:42persistent state configured.
  1510. 1:02:45So the next step is you want to finally
  1511. 1:02:48make the purchase because finally you're
  1512. 1:02:50at the front and then you want to uh
  1513. 1:02:52making sure you want to book this
  1514. 1:02:54ticket. However, um when you book the
  1515. 1:02:57tickets, you're not necessarily know uh
  1516. 1:03:00so let me share this script. Sorry, let
  1517. 1:03:02me share this uh presentation.
  1518. 1:03:07Um stop sharing.
  1519. 1:03:15So just [clears throat] quick recap,
  1520. 1:03:16this is a workflow we're talking about.
  1521. 1:03:18So we have this uh whole workflow
  1522. 1:03:19configured in this uh in this line and
  1523. 1:03:22we have um
  1524. 1:03:28so the seller producing the queue and
  1525. 1:03:30the next trigger arrives uh the trigger
  1526. 1:03:33is what we talk about that you will
  1527. 1:03:35check in the situation
  1528. 1:03:37uh it will check should they search
  1529. 1:03:39again or join or check the exist or
  1530. 1:03:41check if if if uh it's checking whether
  1531. 1:03:44the theater is whether the show is what
  1532. 1:03:47we want and the seat situation whether
  1533. 1:03:49we could find a seat what are situation
  1534. 1:03:50in the queue and then um you will load
  1535. 1:03:54the information choose the show and then
  1536. 1:03:56join the queue and then check the
  1537. 1:03:57situation and choose the suitable choose
  1538. 1:04:00the super show and then join the the
  1539. 1:04:02queue follow the rule
  1540. 1:04:04and this is what we had earlier is when
  1541. 1:04:06we have this uh user input or or uh when
  1542. 1:04:10we have this agent pausing there
  1543. 1:04:13basically
  1544. 1:04:14when we have this request input in the
  1545. 1:04:16so request input is one thing we we fire
  1546. 1:04:19in the uh so basically in ADK if you do
  1547. 1:04:22the request input you will pause there
  1548. 1:04:24um waiting for next step waiting for the
  1549. 1:04:27next input to resume your workflow. So
  1550. 1:04:30when you do the request input you will
  1551. 1:04:31basically pause the workflow.
  1552. 1:04:34And uh in this example
  1553. 1:04:37basically uh when we pause the so this
  1554. 1:04:42is a demonstration of how we are pause
  1555. 1:04:44the task and then when we restart a task
  1556. 1:04:46uh you will have the same session loaded
  1557. 1:04:48from the session.db. So you have all the
  1558. 1:04:50information
  1559. 1:04:53and this one is basically um talking
  1560. 1:04:57about
  1561. 1:04:59this um let me see.
  1562. 1:05:07Yeah. So this one is about when we are
  1563. 1:05:09uh so if you the session we have the
  1564. 1:05:12session uh database save the tracking
  1565. 1:05:15the test per uh test progress and also
  1566. 1:05:17our app have this resumable with the
  1567. 1:05:19resumable configuration so that ADK can
  1568. 1:05:21always have the safety record to
  1569. 1:05:23continue. So we have this uh P show and
  1570. 1:05:26Q up once they finish ADK can reuse this
  1571. 1:05:29uh recorded output from this result it
  1572. 1:05:32doesn't call this node again on this
  1573. 1:05:34resume we can just use this but the
  1574. 1:05:37check front is different because it stop
  1575. 1:05:39at the waiting point. So if you take a
  1576. 1:05:42look at the code uh in our web app it's
  1577. 1:05:45uh we have this rerun and resume setting
  1578. 1:05:47deciding how it's handling handling the
  1579. 1:05:49errors. So we have uh we have the true
  1580. 1:05:52setting uh to run the node again and we
  1581. 1:05:54have the uh false setting to use the
  1582. 1:05:57answer as a node's output. So or so uh
  1583. 1:06:00in the lab over there we have this true
  1584. 1:06:02or false to handle this correspondingly
  1585. 1:06:08and uh those are the different ways. So
  1586. 1:06:11ADK has this long running function tool
  1587. 1:06:13to wrap the tool so that it will pause
  1588. 1:06:15there and we also have this workflow
  1589. 1:06:17plus request input. Those are two
  1590. 1:06:19different way to represent the long long
  1591. 1:06:21wait. So with a long function tool and
  1592. 1:06:23also workflow plus request input,
  1593. 1:06:24they're pretty much all like pause the
  1594. 1:06:27workflow and resume from where they were
  1595. 1:06:29before.
  1596. 1:06:31Yeah. So that is the resumability from
  1597. 1:06:33the agent. And the next thing we want to
  1598. 1:06:35talk about is imagine that you already
  1599. 1:06:37reach the front and you find a two
  1600. 1:06:39ticket. But you know what if one ticket
  1601. 1:06:41is more expensive than expected? So you
  1602. 1:06:45have two ticket. One ticket is you buy
  1603. 1:06:48you have some certain budget and you
  1604. 1:06:50have two different price. How do you
  1605. 1:06:51know which one is the one you actually
  1606. 1:06:53want to buy? So it's very important to
  1607. 1:06:55have this purchase al authority um to
  1608. 1:06:58add the permission for your purchase.
  1609. 1:07:01For example, if you say I have this two
  1610. 1:07:03tickets um almost
  1611. 1:07:06$250 each. So the agent will read that
  1612. 1:07:10and waiting for for your approvement.
  1613. 1:07:14So we will so basically we want to have
  1614. 1:07:17your um we want to have your request
  1615. 1:07:20input. We want to have your input to
  1616. 1:07:22talk about okay what is your budgeting
  1617. 1:07:24what is your expectation and then we
  1618. 1:07:26want to have your input to say okay
  1619. 1:07:28whether this is correct whether we want
  1620. 1:07:31to have your conf confirmation. So this
  1621. 1:07:32is another type of uh resumable in this
  1622. 1:07:36longunning workflow. So we were talking
  1623. 1:07:38about longunning function tool and also
  1624. 1:07:40the workflow with request input. So here
  1625. 1:07:42we have this request input with the um
  1626. 1:07:46to let user input their budgeting and
  1627. 1:07:49also let the user confirm whether it is
  1628. 1:07:52what they want
  1629. 1:07:54and we will we will show that in the in
  1630. 1:07:56the example about um how do we setting
  1631. 1:07:59the budget and how do we change the
  1632. 1:08:01budget how do we confirm the budget for
  1633. 1:08:03our ticket. So think about that if you
  1634. 1:08:05purchase a ticket uh if you want to
  1635. 1:08:07purchase a ticket for your concert,
  1636. 1:08:08right? Um
  1637. 1:08:12um if you want to purchase a ticket for
  1638. 1:08:13concert, you do not want things to over
  1639. 1:08:15certain budget, right? So this is the
  1640. 1:08:17one way for you to add a permission for
  1641. 1:08:18the agent uh doing things for you. And
  1642. 1:08:21let me share the
  1643. 1:08:25let me share the
  1644. 1:08:30it's over here. Okay,
  1645. 1:08:34let me here's the plan.
  1646. 1:08:39Yeah, so uh currently I'm at 5A. So this
  1647. 1:08:42is like a way for human to add the
  1648. 1:08:43permission.
  1649. 1:08:46I'm going to load step five so that it
  1650. 1:08:48will reset everything for me.
  1651. 1:08:52And this is like uh the budget agreement
  1652. 1:08:54just like what I mentioned before it
  1653. 1:08:56will aget asking for the budget and
  1654. 1:08:59making sure it is the approve agree on
  1655. 1:09:01the budget. So I will start a new
  1656. 1:09:02session. I will [snorts] copy this and
  1657. 1:09:05paste it to say give me two ticket for
  1658. 1:09:08uh I'm sit down and then you can see it
  1659. 1:09:10will pause for waiting for the human
  1660. 1:09:11input. So here if I if I turn off the
  1661. 1:09:14machine and then start again it will
  1662. 1:09:16still pause here because again similar
  1663. 1:09:18to previous one it will resume from the
  1664. 1:09:20previous state.
  1665. 1:09:22and [clears throat] and here if I just
  1666. 1:09:24say uh I'm going to copy this to say two
  1667. 1:09:27ticket up to uh 250 each. So this is
  1668. 1:09:31like here I'm having this permission to
  1669. 1:09:33telling the agent and you can see that
  1670. 1:09:35I'm at this stage right now. So and then
  1671. 1:09:38you asking me okay uh ask my
  1672. 1:09:41confirmation
  1673. 1:09:43uh so making sure you understand
  1674. 1:09:45correctly. So I'm going to say yes,
  1675. 1:09:47that's right. And then it will start uh
  1676. 1:09:50to continue purchasing things for me. So
  1677. 1:09:53this is like for you to add a permission
  1678. 1:09:55from the user side to purchase a ticket.
  1679. 1:10:00Um so once you purchase a ticket,
  1680. 1:10:02another very important thing is when
  1681. 1:10:04it's coming to when it's your turn to uh
  1682. 1:10:08purchase things, you might not able to
  1683. 1:10:11find the uh the the right seat. Maybe
  1684. 1:10:14the seat is already being purchased by
  1685. 1:10:16someone else. But the time you
  1686. 1:10:18time you want to do the purchase, you
  1687. 1:10:21you you have the seat in your mind, but
  1688. 1:10:23at that time the seat is available. But
  1689. 1:10:25when it's your turn to purchase, maybe
  1690. 1:10:27that seat is not available because we
  1691. 1:10:28have multiple people using the system,
  1692. 1:10:31right? So how do you handle that
  1693. 1:10:32situation? Like when you are do the
  1694. 1:10:35actual purchase, what if the ticket is
  1695. 1:10:36already being purchased by someone else?
  1696. 1:10:39How do you add a guard to your system so
  1697. 1:10:41that you will add
  1698. 1:10:44ticket that uh satisfy your budget,
  1699. 1:10:47satisfy your preference at the same
  1700. 1:10:49time, it's not conflict with the ticket,
  1701. 1:10:53it's not like conflict with other
  1702. 1:10:54people. So, how do you configure that
  1703. 1:10:56for you? So, this is uh where we're
  1704. 1:10:58talking about in the 5B section that how
  1705. 1:11:00do you making sure it's not conflict
  1706. 1:11:03with other people. So, let me share my
  1707. 1:11:06screen for the slide.
  1708. 1:11:09Oh, I know this is a long one. I hope
  1709. 1:11:11that everyone's still with me or still
  1710. 1:11:13like
  1711. 1:11:20still here doing the enjoying the
  1712. 1:11:28ticket. So, let me share my slide.
  1713. 1:11:31Okay, so we're here.
  1714. 1:11:36Oh, which one is preferred before long
  1715. 1:11:37running tool and workflow and request
  1716. 1:11:40input? So, it's really depends. So,
  1717. 1:11:43usually a lot of time request input is
  1718. 1:11:45for you to um have the human input you
  1719. 1:11:49know and long running function tool
  1720. 1:11:50often time for example you do not need a
  1721. 1:11:53human input you pretty much just uh for
  1722. 1:11:56example I have a video generation and
  1723. 1:11:58the [clears throat] video generation is
  1724. 1:11:59taking a lot of time. I'm just going to
  1725. 1:12:01wrap the video generation in a long
  1726. 1:12:02runninging function tool and then I'm
  1727. 1:12:04going to just wait until it finish the
  1728. 1:12:06thing. Um
  1729. 1:12:09yeah, so that's how how I usually think
  1730. 1:12:12of it. But even with Yeah. So with
  1731. 1:12:14whatever way you're doing that, you need
  1732. 1:12:15to think about you know how do you set a
  1733. 1:12:17trigger? How do you let the system know
  1734. 1:12:20u you finish doing the things? Yeah. So
  1735. 1:12:23hope that answer your question. [gasps]
  1736. 1:12:25But thanks everyone for still um here
  1737. 1:12:28with me. I'm going to like doing this
  1738. 1:12:29last part. I think this is a very
  1739. 1:12:30important part because often time you're
  1740. 1:12:32building a system in a production. It's
  1741. 1:12:34not a a demo. It's not like you're web
  1742. 1:12:37coding a thing and it's working. You can
  1743. 1:12:38just web coding something to say okay
  1744. 1:12:40this purchase a ticket and it's working.
  1745. 1:12:41But in a real life situation the things
  1746. 1:12:44like this happen a lot like when you're
  1747. 1:12:46actually building distributed system
  1748. 1:12:48you have to worry about you know uh
  1749. 1:12:51those state change right um so I think
  1750. 1:12:54this is a very important part um for the
  1751. 1:12:56system.
  1752. 1:12:58So you know this is in this in this
  1753. 1:13:02situation is that when you booked a
  1754. 1:13:03ticket for you um the seat was still
  1755. 1:13:05available and within budget and we saved
  1756. 1:13:07that in the plan and then we v in the
  1757. 1:13:09queue.
  1758. 1:13:10So that information was correct when we
  1759. 1:13:12read it but now when it's your turn some
  1760. 1:13:16someone else probably purchased that
  1761. 1:13:18with that seat. So the this is out of
  1762. 1:13:21date. So even you are have a really good
  1763. 1:13:25um even you have a really good um memory
  1764. 1:13:28management it's still not working
  1765. 1:13:30because memory will remember the old
  1766. 1:13:31situation perfectly you have a pretty
  1767. 1:13:33good memory however it's not able to
  1768. 1:13:36help with this this situation so how do
  1769. 1:13:38you making sure the model is always
  1770. 1:13:40buying uh how do we enforce our purchase
  1771. 1:13:43so that the purchase is always buying
  1772. 1:13:45the uh valid one right so in this
  1773. 1:13:48example we're using our old friend um
  1774. 1:13:51callback back. Not sure if you're here
  1775. 1:13:53at agent 101, we talk about the call
  1776. 1:13:54back. The call back is basically we
  1777. 1:13:56intercept this whole agent life cycle.
  1778. 1:13:58The agent be so agent has a model using
  1779. 1:14:00a different tools and then before the
  1780. 1:14:02using the model before using different
  1781. 1:14:03tool after using different tool at
  1782. 1:14:05different intercept we are adding our
  1783. 1:14:06custom logic over here right. So um so
  1784. 1:14:09over here we have this before to call
  1785. 1:14:11back. So before ADK executing certain
  1786. 1:14:14tools I want to have this guard have
  1787. 1:14:16this check making sure um the model
  1788. 1:14:19proposes seed and then scar will check
  1789. 1:14:21okay I'll check the book information
  1790. 1:14:23check the quality quantity check the
  1791. 1:14:25currency check the price limit check if
  1792. 1:14:28current is available and if it's not you
  1793. 1:14:31know um if it's not available we should
  1794. 1:14:34reject this so that we trying to making
  1795. 1:14:37sure our tool is doing the right so is
  1796. 1:14:42trying to make sure whenever we purchase
  1797. 1:14:43things it's not um purchased by other
  1798. 1:14:47people right so this is like actual
  1799. 1:14:49guard to check so we have the first
  1800. 1:14:51guard is um adding user permission you
  1801. 1:14:53have to add your preference on the
  1802. 1:14:55budgeting and this is the second guard
  1803. 1:14:56is in the before call back we're making
  1804. 1:14:58sure um the old plan still work when we
  1805. 1:15:01still waiting when we're waiting for the
  1806. 1:15:03queue for so long and the next one is
  1807. 1:15:09even when you purchase things maybe
  1808. 1:15:11someone like at the very last minute
  1809. 1:15:13they purchasing. So when you do the tool
  1810. 1:15:15check it's still working but when you
  1811. 1:15:17are do the actual purchase maybe you
  1812. 1:15:19another person purchase you at the same
  1813. 1:15:21time. So you could still have uh like a
  1814. 1:15:25arrow like four five or three arrow or
  1815. 1:15:27some other issues that when you do the
  1816. 1:15:29purchase you might have the arrow. So
  1817. 1:15:31when you have the arrow you might want
  1818. 1:15:32to um like do purchase again. So in the
  1819. 1:15:36real-time system it's potentially that
  1820. 1:15:38you do the purchase twice and you cost
  1821. 1:15:40you uh money again. So in this situation
  1822. 1:15:43what we want to do is we want to have
  1823. 1:15:44the uh item potency key to enforce that
  1824. 1:15:47we only have one intented purchase
  1825. 1:15:49across the repeated requests so that it
  1826. 1:15:52won't keep charging you at the same
  1827. 1:15:53time. So the whole lab is um we're going
  1828. 1:15:56to learn how do we making sure it's not
  1829. 1:15:58charging you twice and also how do we
  1830. 1:16:00add the guard in the before two call
  1831. 1:16:02back so that you will actually reject
  1832. 1:16:04the request when they are when the seat
  1833. 1:16:07is not up to date.
  1834. 1:16:10I know I'm a little bit over time. I'm
  1835. 1:16:12not sure below you still have time after
  1836. 1:16:14this. Okay, you still have time. I'm
  1837. 1:16:17gonna wrap up soon because um sorry for
  1838. 1:16:20going a little bit over time. just
  1839. 1:16:21really quick to wrap up this guard part.
  1840. 1:16:24Um, so I'm gonna I'm at currently at 5B
  1841. 1:16:28and uh [clears throat]
  1842. 1:16:31and over here is a before call back. Oh,
  1843. 1:16:34it's not before call back. Yeah, those
  1844. 1:16:36are not before callback. Sorry. Yeah, so
  1845. 1:16:39those are some logic to check uh the
  1846. 1:16:41available to check the to check uh the
  1847. 1:16:44uh the available tickets. So if I open
  1848. 1:16:48the
  1849. 1:16:51if I open this so basically it's like if
  1850. 1:16:54I open this order and when I do the
  1851. 1:16:56purchase what it does behind the scene
  1852. 1:16:58is before I do the purchase it will
  1853. 1:17:00actually do the check first and once the
  1854. 1:17:02if the check refuse then the purchase uh
  1855. 1:17:05won't go through. So basically we'll
  1856. 1:17:07have another attempt for a different
  1857. 1:17:09ticket number. So uh the whole thing is
  1858. 1:17:11we want to learn like making sure when
  1859. 1:17:13you are doing this uh purchase and after
  1860. 1:17:17the long wait the seat is still
  1861. 1:17:19available. So we need to add this actual
  1862. 1:17:21guard making sure that u we still have
  1863. 1:17:23the valid purchase. And then this one is
  1864. 1:17:25making sure that um it's not
  1865. 1:17:29it's not purchasing twice. So it won't
  1866. 1:17:31charge you even you like do the
  1867. 1:17:33different attempt we will have the item
  1868. 1:17:35opponents and key to uh making sure it's
  1869. 1:17:38uh it's only uh charge you one one time
  1870. 1:17:42so that user doesn't get uh charged
  1871. 1:17:45multiple times. So yeah, I think those
  1872. 1:17:47are the I'm not probably a little bit
  1873. 1:17:48over time so I'm not going to go through
  1874. 1:17:50them step by step but like those are
  1875. 1:17:51very important concept when you are
  1876. 1:17:53building the system that's uh um when
  1877. 1:17:55you have a distributed system you have
  1878. 1:17:57multi-user and then uh we want to scale
  1879. 1:17:59the system those are very important uh
  1880. 1:18:02things to know and the last thing is
  1881. 1:18:03when you scale the system how you can
  1882. 1:18:06deploy the whole thing. Um so basically
  1883. 1:18:08previously we have this uh we learn the
  1884. 1:18:11clock it's a set a timer but over here
  1885. 1:18:14you can set a clockuler so you can
  1886. 1:18:16schedule things regularly to check okay
  1887. 1:18:18whether um whether we're what are
  1888. 1:18:21situation in the in the queue do we have
  1889. 1:18:22to see whether the sales open not and
  1890. 1:18:24then you can resume from and we also
  1891. 1:18:26have the deployment to the cloud run
  1892. 1:18:28with the pops up so yeah basically this
  1893. 1:18:30is like uh how we can deploy everything
  1894. 1:18:32to Google cloud and scale our system why
  1895. 1:18:34we have this long
  1896. 1:18:37workflow. Yeah. So
  1897. 1:18:40the whole thing is we well we start with
  1898. 1:18:43this sticky monster situation that we
  1899. 1:18:45want to learn uh so we first learn that
  1900. 1:18:48you simply tell the agent to do the
  1901. 1:18:50check regularly it's not working. So you
  1902. 1:18:52need to able to you need to making sure
  1903. 1:18:54set explicit trigger and then you need
  1904. 1:18:55to figure out a mechanism to trigger
  1905. 1:18:57them either like every uh set of chrome
  1906. 1:19:00job or whatever to have a mechanism to
  1907. 1:19:02trigger this and then with ADK it's
  1908. 1:19:04important that when you set a trigger
  1909. 1:19:06you need to configure you need to
  1910. 1:19:08integrate with your own runner because
  1911. 1:19:10runner is powering up the whole thing
  1912. 1:19:11and then we learn how do we manage the
  1913. 1:19:14whole thing with uh agent context
  1914. 1:19:16because um we have the we talk about
  1915. 1:19:19session service memory service different
  1916. 1:19:21type of state so that we can resume user
  1917. 1:19:23state. We can have the persistent state
  1918. 1:19:25for for the system and then we have this
  1919. 1:19:28resumable setup. We talk about
  1920. 1:19:30longunning tools and also the request
  1921. 1:19:32input so that in the long running
  1922. 1:19:34workflow you can always pause and then
  1923. 1:19:36resume from there where they were. But
  1924. 1:19:38the backbone the foundation is you need
  1925. 1:19:39to have the persistent memory over here
  1926. 1:19:42so that you can survive the service
  1927. 1:19:46restart. And once you have the you know
  1928. 1:19:49how to set up the trigger you have this
  1929. 1:19:50persistent database set up you know how
  1930. 1:19:52to resume from a long running workflow
  1931. 1:19:54finally when you do the actual purchase
  1932. 1:19:56you need to making sure the purchase is
  1933. 1:19:58uh it's safe you need to making sure the
  1934. 1:20:00purchase up to your standard by first
  1935. 1:20:02set your permission with human input and
  1936. 1:20:04then uh making sure you are doing the
  1937. 1:20:07scar checking that even after this long
  1938. 1:20:09waiting the original request is still
  1939. 1:20:12valid. So you need to have this extra
  1940. 1:20:13check and then um after that resist the
  1941. 1:20:16specific example into making sure user
  1942. 1:20:18doesn't get double charged by making
  1943. 1:20:20sure that we're checking the key to not
  1944. 1:20:22double checked and lastly um this is how
  1945. 1:20:25we can scale the system on Google cloud
  1946. 1:20:27by this is like the whole workflow we're
  1947. 1:20:29building with ADK this is a runner we
  1948. 1:20:31configured and then we we can putting
  1949. 1:20:33the artifact to the cloud storage
  1950. 1:20:35putting the memory artifact to the uh
  1951. 1:20:38clust cloud storage tool and we can also
  1952. 1:20:40have the Google cloud memory bank or
  1953. 1:20:42rack um memory service if you want to
  1954. 1:20:45explore that and we also over here you
  1955. 1:20:47could have cloud SQL to store all the
  1956. 1:20:49event session to store all the
  1957. 1:20:50conversation we have um and here we have
  1958. 1:20:53this uh clouduler to set a timer to
  1959. 1:20:56constantly checking whether things are
  1960. 1:20:57working and we also learned how to have
  1961. 1:20:59the human in the loop with the request
  1962. 1:21:01input to pause the workflow so let's
  1963. 1:21:03continue yeah so I think that is the
  1964. 1:21:06whole thing for this long running
  1965. 1:21:08workflow I'm going to um Pause here and
  1966. 1:21:12then bring Boom back. Thanks Bill for
  1967. 1:21:16help.
  1968. 1:21:16>> Hi. [laughter] Hi.
  1969. 1:21:19For too long.
  1970. 1:21:22[laughter]
  1971. 1:21:22>> Yeah. Thanks for helping me with the
  1972. 1:21:24chat.
  1973. 1:21:26>> I'm going to pause to see if you have
  1974. 1:21:27any questions. If I do I miss anything.
  1975. 1:21:32Yeah, finally.
  1976. 1:21:36I hope that you guys enjoy the session.
  1977. 1:21:40you [snorts] want to broadcast us to the
  1978. 1:21:41next session content the Halloween.
  1979. 1:21:43>> Oh yeah. So next session is a Halloween
  1980. 1:21:45session. We're gonna talk about uh
  1981. 1:21:46multimodel agent. So we all learn how to
  1982. 1:21:49do the multimodel generation, how to
  1983. 1:21:51have a multimodel pipeline ingestion.
  1984. 1:21:52We're going to cover the workflow and uh
  1985. 1:21:55basically um yeah so it's like workflow
  1986. 1:22:00deep dive and multimodel
  1987. 1:22:04multimodel generation multimodel
  1988. 1:22:05ingestion with with rack and um and yeah
  1989. 1:22:09basically how do you build a multimodel
  1990. 1:22:11agent with workflow and next next week
  1991. 1:22:14is about how do you automate the whole
  1992. 1:22:15thing by how to make your video
  1993. 1:22:17generation workflow by it will help you
  1994. 1:22:21automate
  1995. 1:22:22you you actually creating your video and
  1996. 1:22:24you will actually publish your video in
  1997. 1:22:25our own system. So you will able to see
  1998. 1:22:27the video you generate and you able to
  1999. 1:22:29see the video published to our streaming
  2000. 1:22:33service. So cool. Yeah, you will have
  2001. 1:22:36your Halloween video next week if you
  2002. 1:22:39want to. Yeah, if you want to try.
  2003. 1:22:41[snorts]
  2004. 1:22:43>> Is that Asian 103?
  2005. 1:22:45[laughter]
  2006. 1:22:46[sighs]
  2007. 1:22:47>> Oh, I think it's a special edition. It's
  2008. 1:22:51like a festival thing.
  2009. 1:22:52>> 102.5.
  2010. 1:22:55>> Thank you.
  2011. 1:22:58[snorts]
  2012. 1:22:58>> Yeah, we are coming for that fastest
  2013. 1:22:59actually. We're going that fastest. I'm
  2014. 1:23:01going that fastest Atlanta next week and
  2015. 1:23:03also that fastest um Seattle and Boston
  2016. 1:23:07and also trying to go to Vancouver. I'm
  2017. 1:23:10so busy.
  2018. 1:23:18Oh, when is next session? I think let me
  2019. 1:23:22double check my calendar. Um
  2020. 1:23:31I I probably want to do it next
  2021. 1:23:33Wednesday this time. If you guys are up
  2022. 1:23:35for next Wednesday, I'll be here next
  2023. 1:23:38Wednesday, the same time here.
  2024. 1:23:41Let me know if this work for you all.
  2025. 1:23:50Okay. So, it doesn't work for you,
  2026. 1:23:52James.
  2027. 1:23:55That's pretty cool. Hey, uh I want to
  2028. 1:23:58see you you could share the GitHub with
  2029. 1:24:00us.
  2030. 1:24:02Thank you so much. And also kudos to
  2031. 1:24:04Christina. You know, Christina wrote
  2032. 1:24:06this whole lab and then I rebuilt the
  2033. 1:24:09whole thing. I really I kind of like
  2034. 1:24:10modify her lab but she come up with a
  2035. 1:24:12whole design you know how do we how do
  2036. 1:24:15we do this long runninging workflow with
  2037. 1:24:17a ticket purchase.
  2038. 1:24:19So I want to say special thanks to
  2039. 1:24:21Christina even she's not here.
  2040. 1:24:29Yeah that fast is a Google's uh Google
  2041. 1:24:31developer group event. [clears throat]
  2042. 1:24:34Do you have any do you see any fun
  2043. 1:24:36comments you want to
  2044. 1:24:38>> uh in I just try to get the GitHub link
  2045. 1:24:42of that cool AI wise agent.
  2046. 1:24:45[snorts]
  2047. 1:24:48>> Yeah, thank you everyone for stay here.
  2048. 1:24:51Now I know this is like a longer session
  2049. 1:24:54than previous.
  2050. 1:24:57I think it's a important like useful one
  2051. 1:24:59because oftent time that
  2052. 1:25:02I find it's important to know those
  2053. 1:25:04concept to know better about how to code
  2054. 1:25:06with AI and also how do you scale the
  2055. 1:25:08system not sure I'm curious below what
  2056. 1:25:11do you think in your day-to-day job
  2057. 1:25:13>> yeah we had this conversation uh like
  2058. 1:25:16three months ago actually in the team uh
  2059. 1:25:18there are two conversations related to
  2060. 1:25:20that people keeps asking like how could
  2061. 1:25:22we let my agent running for a long time
  2062. 1:25:24>> like I think it's that's why I feel this
  2063. 1:25:27content is super super useful. [snorts]
  2064. 1:25:31>> P in Google, how what is your I'm just
  2065. 1:25:34curious when you how do you code with
  2066. 1:25:38AI, you know, like just curious your
  2067. 1:25:41>> with our internal coding agent.
  2068. 1:25:44>> Yeah. Yeah.
  2069. 1:25:45>> And add some harness like anti-gravity.
  2070. 1:25:49>> Yes. And you write your own harness like
  2071. 1:25:52your skills and you try to see the
  2072. 1:25:55context window try to control the
  2073. 1:25:57hallucination and you also have a lot of
  2074. 1:26:00rules and also you bundle with this like
  2075. 1:26:02today's concept super useful like you
  2076. 1:26:05can make your Asian more powerful. Yeah.
  2077. 1:26:08>> Do you spend a lot of time read code
  2078. 1:26:11like review code or spend a lot of time
  2079. 1:26:12writing PR? Oh, I feel this this the
  2080. 1:26:15bottleneck is reviewing everything like
  2081. 1:26:17review the design doc review the code
  2082. 1:26:20it's all about review stuff like AI can
  2083. 1:26:22easily generate a tons of thing
  2084. 1:26:27although we already have the code review
  2085. 1:26:28agent these days to help with us but
  2086. 1:26:30still need human to interact
  2087. 1:26:33>> when you [snorts] review PR do you re
  2088. 1:26:35review line by line or just review or
  2089. 1:26:38just relying on you know the AI agent
  2090. 1:26:41>> yeah do you review code line by line
  2091. 1:26:43just curious
  2092. 1:26:45No, like you get the whole concept. Uh,
  2093. 1:26:47and there are several different types of
  2094. 1:26:49code review agent. There's code view
  2095. 1:26:52agent to review the potential test
  2096. 1:26:54failure and code agent to review the
  2097. 1:26:57code readability like you know like we
  2098. 1:26:59need to maintain high quality code. So
  2099. 1:27:01the code need to follow the Google's
  2100. 1:27:03readability. So this readability agent
  2101. 1:27:05also helps to make sure your code looks
  2102. 1:27:07clean.
  2103. 1:27:08>> [snorts]
  2104. 1:27:08>> And after you let them to run the first
  2105. 1:27:11run and after that you start to focus on
  2106. 1:27:14the key logic.
  2107. 1:27:17>> Yeah. I find like nowadays because AI is
  2108. 1:27:20so good at generating code uh then like
  2109. 1:27:22reviewing code becomes harder especially
  2110. 1:27:24working in a group right.
  2111. 1:27:26>> Yes.
  2112. 1:27:29>> Yeah. I think Android now is pretty
  2113. 1:27:31pretty powerful.
  2114. 1:27:35>> Glad we got better model now. [snorts]
  2115. 1:27:38Yeah.
  2116. 1:27:41Oh. Oh. You find it's hard to start with
  2117. 1:27:43video generation model. Um like using VO
  2118. 1:27:46or Omni. I think Omni is a pretty cool
  2119. 1:27:48model to do the generation as well. If
  2120. 1:27:52you haven't tried it,
  2121. 1:27:56I'm not sure what your question about
  2122. 1:27:58URL, but for next week I will just
  2123. 1:28:00schedule the session at the YouTube. So
  2124. 1:28:02I don't have a URL for next week.
  2125. 1:28:09Yeah, we need more more code need to
  2126. 1:28:11review.
  2127. 1:28:13It's called slot review, right?
  2128. 1:28:19[clears throat] Oh, anyone have any
  2129. 1:28:20questions?
  2130. 1:28:24Yeah, of course. You know, Ver's using
  2131. 1:28:26antiquarity like internal version of it,
  2132. 1:28:28right?
  2133. 1:28:34Bill, do you have like a harness set up
  2134. 1:28:36like I don't know like a workflow setup
  2135. 1:28:38to have like automate your coding gener
  2136. 1:28:41like automate your task and automate
  2137. 1:28:43your uh for example create a design do
  2138. 1:28:46create your code just curious yeah uh
  2139. 1:28:51basically you you just get the skeleton
  2140. 1:28:55um the workflow I think depends on the
  2141. 1:28:58work for example if you want to do the
  2142. 1:29:00coding like normally inside we have some
  2143. 1:29:02bio organization tool and you got the
  2144. 1:29:05link of that back bization tool and ask
  2145. 1:29:09AI to help you analysis and you just run
  2146. 1:29:12around check if the AI is hallucination
  2147. 1:29:14or is doing the right work and after
  2148. 1:29:17then you create an implementation plan
  2149. 1:29:18and uh ask AI to implement the code and
  2150. 1:29:24then uh have the code review agent to
  2151. 1:29:27self-re your own code first before
  2152. 1:29:29sending it out and you also we also have
  2153. 1:29:31a lot of testing automation using AI
  2154. 1:29:34these days. So this testing automation
  2155. 1:29:36AI tool can help us verify the results.
  2156. 1:29:39Yeah. And the evalu becomes more and
  2157. 1:29:41more important in this way and then you
  2158. 1:29:43send it out and after you receive the
  2159. 1:29:46feedback coding feedback you can ask AI
  2160. 1:29:49to help you address the thing. So you
  2161. 1:29:51can write the whole flow as a skill.
  2162. 1:29:54>> Oh that's pretty cool.
  2163. 1:29:57>> Yeah. I'm just very curious how people
  2164. 1:29:58nowadays are working with AI. How how
  2165. 1:30:00how everyone's be a native. I think
  2166. 1:30:02that's pretty cool. Um, yeah, we have
  2167. 1:30:04for uh ta ta ta asking, thank you for uh
  2168. 1:30:10sharing this and you've been down a lot
  2169. 1:30:12of work and are you thinking about
  2170. 1:30:13organizing? Yeah, I will definitely
  2171. 1:30:15organizing a GitHub and putting things
  2172. 1:30:17together uh so that it's in one place
  2173. 1:30:21and it's easier for for you to review.
  2174. 1:30:22Actually, I'm working on uh putting all
  2175. 1:30:25the agent 101 into one ripple so that
  2176. 1:30:27you can have everything all together and
  2177. 1:30:30I want to like uh so I'm still polished
  2178. 1:30:32at ripple maybe uh learn from bel uh you
  2179. 1:30:36know code review skill to quickly roll
  2180. 1:30:38out the ripple and I will share this
  2181. 1:30:41with you. I can I will share this
  2182. 1:30:42probably uh once I have this I will pin
  2183. 1:30:45this in the comment for all the video if
  2184. 1:30:47that's helpful or maybe I can share this
  2185. 1:30:50with the
  2186. 1:30:53email for everyone who registered for
  2187. 1:30:54this one but I I guess for the agent 101
  2188. 1:30:56I u maybe it's a bit too late but I will
  2189. 1:30:59share this in the comment thanks this is
  2190. 1:31:01a good suggestion
  2191. 1:31:08yeah okay so I think It's a bit late and
  2192. 1:31:12then thank you everyone for joining.
  2193. 1:31:15Thank you Annie. Bye.
  2194. 1:31:18Bye bye. I'm going to stay here for one
  2195. 1:31:21more minute just to check the um check
  2196. 1:31:24the comments. See you soon. Thank you so
  2197. 1:31:26much for joining.
  2198. 1:31:30Thank you for joining. I just want
  2199. 1:31:31making sure. Yeah, I'll definitely
  2200. 1:31:33putting things to the to one uh collab.
  2201. 1:31:36Yeah, I know. But my GitHub I need to
  2202. 1:31:38organize my GitHub. I think that's a
  2203. 1:31:40good call. Thank you so much. You want
  2204. 1:31:42to get for browser control using voice
  2205. 1:31:43agent. Also, I'm using something called
  2206. 1:31:46uh harness. Um so it's a skill uh to
  2207. 1:31:50control the um yeah I will sh I think I
  2208. 1:31:53shared that in my video but I will I'll
  2209. 1:31:55organize my GitHub and share this with
  2210. 1:31:57you. Thank you for suggestion. Thank you
  2211. 1:31:59so much everyone for joining. Thank you
  2212. 1:32:01so much for staying this long. Thank you
  2213. 1:32:03so much and uh I will see you next week
  2214. 1:32:05next Wednesday about Halloween about
  2215. 1:32:07multimodel thing. If you want to learn
  2216. 1:32:09more about
  2217. 1:32:11really look forward to see all of you
  2218. 1:32:13together. Thank you so much again. I'll
  2219. 1:32:15see you next week. Bye.

About this transcript

This page contains the full transcript of Google’s Free 2-Hour AI Agent Course: Master Harness, Loops & Graph Engineering (0% to 100%) by frugle 1.7M, generated from the public captions YouTube serves with the video. The transcript has 16,191 words across 2,219 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.