← Back
AI Engineer October 11, 2026 59m

Agent Speedrun — Elizabeth Fuentes Leone & Sandhya Subramani, AWS

Read full transcript 50 segments
  1. My name is Sandy, and this is My name is Sandy, and this is Elizabeth. Also with Elizabeth. Also with Elizabeth. Also with us is Mike and other us is Mike and other us is Mike and other colleagues who colleagues who colleagues who will help you today will help you today will help you today if you have any if you have any if you have any questions about questions about questions about setting up your setting up your setting up your work environment; work environment; work environment; each of them is an expert. each of them is an expert. We are very excited to get We are very excited to get started. Today started. Today started. Today we will go from we will go from we will go from the idea of ​​creating an the idea of ​​creating an the idea of ​​creating an agent, through its development agent, through its development agent, through its development and deep and deep and deep customization to customization to customization to deployment. So, deployment. So, deployment. So, let's start with the let's start with the let's start with the simplest form of simplest form of simplest form of agent, agent, agent, using Strands using Strands using Strands agents—an agents—an open open source agent framework. It was actually source agent framework. It was actually source agent framework. It was actually developed by AWS, but it is developed by AWS, but it is developed by AWS, but it is completely open source. completely open source. So let's quickly So let's quickly go through it. go through it. I'll briefly explain I'll briefly explain what we'll be doing, and what we'll be doing, and what we'll be doing, and then we'll then we'll then we'll jump right into the code jump right into the code jump right into the code that you can that you can that you can run, take with run, take with run, take with you, and you, and you, and use use use for two days for two days for two days after the workshop. So, after the workshop. So, after the workshop. So, let's begin. What are Strands let's begin. What are Strands let's begin. What are Strands agents? Strands agents is an agents? Strands agents is an open source agent framework that open source agent framework that allows you allows you allows you to use to use to use your own LLM. You can your own LLM. You can your own LLM. You can choose any choose any model provider, create a model provider, create a wrapper around them, wrapper around them, wrapper around them, and manage the entire and manage the entire and manage the entire process from start process from start process from start to finish. You can to finish. You can to finish. You can customize it.

  2. customize it. customize it. You can add your You can add your You can add your own tools. own tools. It is a completely open It is a completely open solution, solution, solution, supported by the community supported by the community supported by the community on GitHub and AWS, it on GitHub and AWS, it on GitHub and AWS, it supports the MCP supports the MCP supports the MCP and A2A protocol, is flexible, and you and A2A protocol, is flexible, and you and A2A protocol, is flexible, and you can deploy can deploy can deploy it on any it on any it on any managed service. managed service. You can run You can run it locally or it locally or it locally or host it anywhere. host it anywhere. host it anywhere. As I said, it As I said, it As I said, it can be can be can be used with used with used with any model. any model. any model. It runs in a It runs in a It runs in a production production production environment with AWS, but environment with AWS, but environment with AWS, but you can add you can add any model and any model and any model and run it. It run it. It run it. It also has built-in also has built-in also has built-in protection and protection and protection and surveillance mechanisms. When I surveillance mechanisms. When I surveillance mechanisms. When I say it can be say it can be say it can be run on Amazon Bedrock, run on Amazon Bedrock, run on Amazon Bedrock, you can you can you can use Agent use Agent use Agent Core, other services, or a Core, other services, or a Core, other services, or a different different different provider altogether. You provider altogether. You provider altogether. You can even can even can even use use use your own model your own model your own model hosted on your own hosted on your own hosted on your own servers. Ellie? servers. Ellie? servers. Ellie? Yes. Since in Yes. Since in Yes. Since in this lesson you this lesson you this lesson you will be deploying the will be deploying the will be deploying the created agent created agent created agent , we will , we will , we will use Agent Core—an use Agent Core—an Amazon Bedrock service Amazon Bedrock service Amazon Bedrock service specifically specifically specifically designed for designed for designed for deploying agents into deploying agents into production. So, production. So, inside Agent Core we inside Agent Core we inside Agent Core we have the Agent Core runtime, that is, the have the Agent Core runtime, that is, the have the Agent Core runtime, that is, the runtime environment runtime environment , the container where you , the container where you , the container where you are going to put are going to put are going to put this agent. And it doesn't this agent. And it doesn't this agent. And it doesn't matter if it's Trust, or the

  3. matter if it's Trust, or the matter if it's Trust, or the LangChain framework, or LangChain framework, or LangChain framework, or CrewAI—it doesn't matter what CrewAI—it doesn't matter what CrewAI—it doesn't matter what framework you framework you framework you use, you use, you use, you can put that can put that can put that agent application agent application agent application into a into a into a runtime, a container, runtime, a container, runtime, a container, and deploy it with a and deploy it with a and deploy it with a single command in the CLI. single command in the CLI. When you When you use the use the use the runtime environment runtime environment , it has sessions. , it has sessions. A session can last A session can last from 50 minutes to 8 from 50 minutes to 8 from 50 minutes to 8 hours. So you can hours. So you can hours. So you can have a session have a session have a session built into this built into this built into this container without container without any configuration, any configuration, any configuration, because it's already there. And because it's already there. And because it's already there. And you also have built-in you also have built-in you also have built-in observability. observability. So, you just have the code, So, you just have the code, you install it, you install it, you install it, add it to the container, and you add it to the container, and you add it to the container, and you immediately get immediately get immediately get memory and memory and memory and observability. And observability. And observability. And when I talk about when I talk about when I talk about observability, observability, observability, it's not about monitoring it's not about monitoring it's not about monitoring RAM RAM RAM or the behavior of the or the behavior of the or the behavior of the container itself. This is about container itself. This is about container itself. This is about agentic agentic agentic observability. observability. observability. How many tokens do I How many tokens do I How many tokens do I spend in this spend in this spend in this app? What app? What app? What tools tools tools does this does this does this agent use? What happened agent use? What happened agent use? What happened inside my inside my inside my agent cycle? You will agent cycle? You will agent cycle? You will be able to see all of be able to see all of be able to see all of this in the this in the Agent Core observability within Agent Core observability within CloudWatch in AWS. We also CloudWatch in AWS. We also CloudWatch in AWS. We also have an Agent Core gateway. Sometimes we have an Agent Core gateway. Sometimes we have an Agent Core gateway. Sometimes we have many have many have many tools, many tools, many tools, many MCPs for our MCPs for our MCPs for our agent application agent application . You can . You can . You can put all these put all these put all these tools and MCPs behind the

  4. tools and MCPs behind the tools and MCPs behind the Agent Core gateway, and it Agent Core gateway, and it Agent Core gateway, and it will provide something will provide something will provide something like an API—although “API” is like an API—although “API” is like an API—although “API” is not exactly the right word not exactly the right word —it’s an endpoint —it’s an endpoint —it’s an endpoint that you can that you can that you can call in your call in your call in your agent loop. This agent loop. This agent loop. This endpoint will be able to endpoint will be able to endpoint will be able to perform perform perform semantic search semantic search semantic search across all your across all your across all your tools and MCPs. tools and MCPs. So, just one So, just one endpoint for endpoint for endpoint for all your MCPs and all your MCPs and all your MCPs and tools. And it tools. And it tools. And it has semantic has semantic has semantic search. This helps search. This helps search. This helps provide the best provide the best provide the best tool for tool for tool for your agent your agent your agent cycle. And we also have cycle. And we also have cycle. And we also have Agent Core memory, because Agent Core memory, because Agent Core memory, because when we create an when we create an when we create an agent, we have agent, we have agent, we have short-term short-term short-term memory. memory. memory. Short-term Short-term Short-term memory is built into the memory is built into the memory is built into the runtime environment runtime environment , you already know that. But what , you already know that. But what , you already know that. But what if you if you if you need need need long-term long-term long-term memory? You know, the kind of memory? You know, the kind of memory? You know, the kind of memory that can memory that can memory that can last longer last longer last longer than 8 hours. Then you than 8 hours. Then you than 8 hours. Then you can create can create can create Agent Core memory. Agent Core memory. By creating Agent By creating Agent Core memory, you also Core memory, you also Core memory, you also gain semantic gain semantic gain semantic memory. Thus, memory. Thus, memory. Thus, Agent Core creates Agent Core creates Agent Core creates three different types of three different types of three different types of memory for you. So you'll have memory for you. So you'll have memory for you. So you'll have , well, I don't , well, I don't , well, I don't remember the name of remember the name of remember the name of the memory, but you have the memory, but you have the memory, but you have three different queries three different queries three different queries capable of creating three capable of creating three capable of creating three different types of memory.

  5. different types of memory. So, every time So, every time you access you access you access your agent's loop your agent's loop , you can get , you can get , you can get that memory inside the that memory inside the Agent Core's built-in memory. You don't Agent Core's built-in memory. You don't need to create a need to create a need to create a vector storage, a vector storage, a vector storage, a database, you database, you database, you don't need to create anything at all don't need to create anything at all don't need to create anything at all . . . You just have to You just have to You just have to say, "Hey, Agent Core, say, "Hey, Agent Core, say, "Hey, Agent Core, I want Agent Core's memory I want Agent Core's memory ." So, there's memory unfolding for you ." So, there's memory unfolding for you , three different , three different types of memory: types of memory: types of memory: random memory, random memory, random memory, built-in memory, and built-in memory, and built-in memory, and you can create you can create you can create your own custom your own custom your own custom memory. You can memory. You can memory. You can add your own add your own add your own query to build query to build query to build your own memory. So your own memory. So your own memory. So every time you every time you every time you get information get information get information for that agent, you for that agent, you for that agent, you will have your will have your will have your own memory. There own memory. There own memory. There 's also the identity of 's also the identity of 's also the identity of Agent Core and much more Agent Core and much more , but we only have 1 , but we only have 1 , but we only have 1 hour. And in this hour. And in this hour. And in this virtual virtual virtual environment, you will environment, you will environment, you will deploy your deploy your deploy your agent in the agent in the agent in the Agent Core runtime. And I Agent Core runtime. And I Agent Core runtime. And I already said that. And yes, already said that. And yes, already said that. And yes, Agent Core Runtime provides you with Agent Core Runtime provides you with Agent Core Runtime provides you with everything you need to be everything you need to be everything you need to be able to host able to host able to host your code and your code and your code and deploy it to deploy it to deploy it to production right away. You production right away. You production right away. You get get get enterprise-grade security enterprise-grade security , of course, because it , of course, because it , of course, because it runs on AWS. So, it is runs on AWS. So, it is runs on AWS. So, it is completely safe.

  6. completely safe. completely safe. Of course, if you Of course, if you Of course, if you do the do the do the deployment correctly, if you don't deployment correctly, if you don't deployment correctly, if you don't share your share your share your keys, etc., keys, etc., keys, etc., since it's since it's since it's inside AWS. And we don't inside AWS. And we don't inside AWS. And we don't use your use your use your data to train data to train data to train models. It's in your models. It's in your models. It's in your account and account and account and only you can see it. And only you can see it. And only you can see it. And it scales it scales it scales automatically. You have a automatically. You have a automatically. You have a container and you don't container and you don't container and you don't need to manage need to manage need to manage scaling scaling scaling because the because the because the runtime can runtime can runtime can automatically automatically automatically scale up scale up if you have many if you have many if you have many sessions and down if you have sessions and down if you have sessions and down if you have fewer sessions. fewer sessions. Thank you. So, today Thank you. So, today we're going to do this we're going to do this we're going to do this . We'll start with the . We'll start with the . We'll start with the base agent. What base agent. What base agent. What is an agent cycle? is an agent cycle? is an agent cycle? How can we How can we How can we build a build a build a real system on this? And real system on this? And real system on this? And some ideas for a some ideas for a some ideas for a deeper dive deeper dive deeper dive into what really into what really into what really makes an agent makes an agent makes an agent good, right? good, right? good, right? We'll talk about hooks, We'll talk about hooks, We'll talk about hooks, skills, skills, skills, settings, and then settings, and then settings, and then Ellie will talk about Ellie will talk about Ellie will talk about session management, and session management, and session management, and she'll cover she'll cover she'll cover how to actually how to actually how to actually deploy this in Agent Core deploy this in Agent Core . We also have . We also have . We also have evaluation and evaluation and evaluation and multi-agent multi-agent multi-agent frameworks as frameworks as frameworks as part of the workshop.

  7. part of the workshop. part of the workshop. If we have time, we will If we have time, we will If we have time, we will , but since , but since , but since we want to move we want to move we want to move slowly and calmly, slowly and calmly, slowly and calmly, we want to we want to we want to make sure everyone make sure everyone make sure everyone understands the basics understands the basics understands the basics before moving on before moving on before moving on to complex to complex to complex concepts. But if concepts. But if concepts. But if we don't make it, you we don't make it, you we don't make it, you can still can still can still use this use this use this link. It will be link. It will be link. It will be valid for 2 more days. So valid for 2 more days. So valid for 2 more days. So you can you can you can use it use it , go home, , go home, , go home, run everything, run everything, run everything, complete all the modules, complete all the modules, complete all the modules, and ask any and ask any and ask any of us questions if of us questions if of us questions if they arise, and we'll they arise, and we'll they arise, and we'll be there to be there to be there to help. So, help. So, first, follow first, follow first, follow this link to the this link to the this link to the seminar. This is seminar. This is seminar. This is designed designed designed for approximately 250 for approximately 250 for approximately 250 participants. If there are participants. If there are participants. If there are more of us and any more of us and any more of us and any of you run into of you run into of you run into problems, we have a problems, we have a problems, we have a backup link backup link backup link to the seminar. But for now, to the seminar. But for now, to the seminar. But for now, log into this log into this log into this site and it should site and it should site and it should direct you to the direct you to the direct you to the link. Ellie link. Ellie link. Ellie can also, can also, can also, I apologize, explain I apologize, explain I apologize, explain all the steps to you if all the steps to you if all the steps to you if necessary. This necessary. This necessary. This will take you to the will take you to the will take you to the account...Everyone account...Everyone account...Everyone has the previous has the previous has the previous link? Do you want link? Do you want link? Do you want me to wait a few me to wait a few me to wait a few seconds? seconds? seconds? It's on...It's on the It's on...It's on the It's on...It's on the agenda. He... agenda. He... agenda. He... I think that will be I think that will be I think that will be on the on the on the next few next few next few slides as well. So, what exactly are slides as well. So, what exactly are slides as well. So, what exactly are we going to we going to we going to do today? We'll move on do today? We'll move on do today? We'll move on to this to this workshop studio account. You don't workshop studio account. You don't need to create your need to create your need to create your own own own AWS account. These AWS account. These AWS account. These accounts are already created accounts are already created accounts are already created for you, and there will be a for you, and there will be a for you, and there will be a format like Jupyter format like Jupyter format like Jupyter notebook. Most of the code notebook. Most of the code notebook. Most of the code is already inside. We is already inside. We is already inside. We can configure can configure can configure it, you can it, you can it, you can run it, run it, run it, download it, and download it, and download it, and use it in use it in use it in your own environments, your own environments, your own environments, but for this session, but for this session, but for this session, everything is already ready for everything is already ready for everything is already ready for you. So you can you. So you can you. So you can directly directly directly use and use and use and run it from there.

  8. run it from there. run it from there. It's free. You It's free. You It's free. You will not use will not use will not use any of your own any of your own any of your own accounts. accounts. accounts. You will not be asked You will not be asked You will not be asked to enter your to enter your to enter your credit card details. So credit card details. So credit card details. So just follow along with just follow along with just follow along with us and do everything us and do everything us and do everything step by step. If step by step. If step by step. If you have any you have any you have any questions, we are all here questions, we are all here questions, we are all here to support you. to support you. to support you. As I said, first of As I said, first of As I said, first of all, follow all, follow all, follow this link to the this link to the this link to the seminar. seminar. When you click on When you click on this link, it will this link, it will this link, it will open a website. open a website. The first thing you The first thing you need to do is need to do is need to do is enter your enter your enter your email address. email address. email address. Email, Email, Email, one-time password ( one-time password ( OTP). After that, OTP). After that, OTP). After that, you will receive a letter in your mailbox you will receive a letter in your mailbox you will receive a letter in your mailbox with... with... with... I don't remember how many I don't remember how many I don't remember how many numbers there are. Yes, you numbers there are. Yes, you numbers there are. Yes, you need to enter your need to enter your need to enter your email address. And email address. And email address. And then you will receive a then you will receive a then you will receive a one-time password. one-time password. one-time password. You need to enter You need to enter You need to enter this password in a window this password in a window this password in a window similar to the one on similar to the one on similar to the one on the screen. the screen. If any of you have any If any of you have any questions, questions, questions, please raise your please raise your please raise your hand and one of us will hand and one of us will hand and one of us will come to you. We come to you. We come to you. We will work with you.

  9. will work with you. And in this workshop, And in this workshop, when you get when you get when you get started, you'll be able started, you'll be able started, you'll be able to use to use to use Anthropic models through the Anthropic models through the Anthropic models through the Amazon Bedrock API. And I think, I'm Amazon Bedrock API. And I think, I'm Amazon Bedrock API. And I think, I'm not sure, but I not sure, but I not sure, but I think you'll also think you'll also think you'll also be able to be able to be able to use the new use the new use the new OpenAI models. And of course, OpenAI models. And of course, OpenAI models. And of course, all the Amazon models that we all the Amazon models that we all the Amazon models that we have, you can have, you can have, you can call through the call through the call through the Amazon Bedrock API. And you will be able to Amazon Bedrock API. And you will be able to use the use the core Amazon core Amazon core Amazon Bedrock agents for free. It's not that expensive, Bedrock agents for free. It's not that expensive, Bedrock agents for free. It's not that expensive, okay? I know, I know okay? I know, I know okay? I know, I know that people sometimes that people sometimes that people sometimes have problems have problems have problems using new using new using new services because, well, services because, well, services because, well, that's normal, I don't know, that's normal, I don't know, that's normal, I don't know, it's money. But if it's money. But if it's money. But if you try the you try the you try the Amazon Bedrock core agents on Amazon Bedrock core agents on Amazon Bedrock core agents on your your your account, you'll see account, you'll see account, you'll see that it's not that expensive. And that it's not that expensive. And that it's not that expensive. And then you need to then you need to then you need to confirm the next confirm the next confirm the next window, and this, yes, this... window, and this, yes, this... Is everyone with us now? Is Is everyone with us now? Is anyone having anyone having difficulty at difficulty at any stage right now? Do any stage right now? Do any stage right now? Do you need you need you need help? Good.

  10. help? Good. help? Good. Sorry. Are you having Sorry. Are you having Sorry. Are you having trouble trouble trouble logging in? Um, logging in? Um, logging in? Um, so you opened so you opened so you opened the link to the seminar the link to the seminar the link to the seminar and then entered your and then entered your and then entered your email address and email address and email address and password? Good. I think password? Good. I think password? Good. I think Mike can help. Are Mike can help. Are Mike can help. Are you okay? I, you okay? I, you okay? I, I need to I need to I need to see your screen. Is everyone else see your screen. Is everyone else see your screen. Is everyone else okay? Are there okay? Are there okay? Are there any other problems? Is any other problems? Is any other problems? Is anyone having difficulty with anyone having difficulty with anyone having difficulty with anything? anything? anything? We may have had We may have had We may have had a little a little a little trouble with the Wi-Fi. Who would have trouble with the Wi-Fi. Who would have trouble with the Wi-Fi. Who would have thought that there thought that there thought that there would be would be would be problems with Wi-Fi at a conference? Many problems with Wi-Fi at a conference? Many problems with Wi-Fi at a conference? Many people are trying people are trying people are trying to connect. Will you to connect. Will you to connect. Will you be demonstrating be demonstrating be demonstrating some things on stage? some things on stage? Um, what? Are Um, what? Are you going to...Are you you going to...Are you you going to...Are you going to go through going to go through going to go through the stages of the seminar on the stages of the seminar on the stages of the seminar on stage? So if people stage? So if people stage? So if people can't do it, can't do it, can't do it, can they can they can they watch? watch? watch? At the end of the session, we At the end of the session, we At the end of the session, we will share will share will share all the slides with you. This is all the slides with you. This is all the slides with you. This is Jupyter...This is a repository Jupyter...This is a repository Jupyter...This is a repository that you can also that you can also that you can also clone. You know, clone. You know, clone. You know, this code, everything we're this code, everything we're this code, everything we're going to create here, is going to create here, is going to create here, is not only available in the not only available in the not only available in the virtual studio.

  11. virtual studio. Since this Since this virtual studio virtual studio virtual studio will be open will be open will be open for 2 days, for 2 days, for 2 days, I guess I better start I guess I better start I guess I better start showing you what's showing you what's showing you what's inside and you inside and you inside and you can do it can do it can do it for yourself, you know, for for yourself, you know, for for yourself, you know, for your...Yeah. Yes, and you your...Yeah. Yes, and you your...Yeah. Yes, and you can do it. And can do it. And can do it. And you know, I can...Then you know, I can...Then you know, I can...Then when we finish when we finish when we finish the session, I'll leave this the session, I'll leave this the session, I'll leave this workshop open for workshop open for workshop open for 3 days. So you can 3 days. So you can 3 days. So you can use all of use all of use all of this for free this for free this for free for 3 days. for 3 days. And may the Wi-Fi gods And may the Wi-Fi gods be with us be with us be with us today as we go today as we go today as we go through this through this through this with you. So, with you. So, with you. So, if if if some of you are some of you are some of you are unable to follow unable to follow unable to follow the process due to network issues, we the process due to network issues, we the process due to network issues, we will try to go through everything will try to go through everything will try to go through everything step by step again. step by step again. step by step again. Hopefully the Wi-Fi Hopefully the Wi-Fi Hopefully the Wi-Fi will work for us. will work for us. will work for us. As well as any other As well as any other As well as any other problems besides problems besides problems besides network ones: with network ones: with network ones: with registration, login, registration, login, registration, login, or anything else. Yes. or anything else. Yes. or anything else. Yes. Wait. So before you Wait. So before you Wait. So before you start, please start, please start, please take a picture of this, because take a picture of this, because take a picture of this, because if you have a if you have a if you have a problem with the first one, you problem with the first one, you problem with the first one, you know it's not because of the know it's not because of the know it's not because of the internet. If you internet. If you internet. If you have a problem: " have a problem: " Hey, missing Hey, missing Hey, missing account". This is because account". This is because account". This is because the first one is already the first one is already the first one is already using the account.

  12. using the account. using the account. So you can So you can So you can use the second one. use the second one. use the second one. So, we have two So, we have two So, we have two separate separate separate environment deployments. So let's environment deployments. So let's environment deployments. So let's begin. begin. Good. So, you all Good. So, you all should see this now should see this now . Right? . Right? . Right? No, that's not it. No, that's not it. No, that's not it. This is it, right? This is it, right? This is it, right? You all need to see this. This will be on You all need to see this. This will be on You all need to see this. This will be on the left, this is your the left, this is your the left, this is your step-by-step step-by-step step-by-step guide to what guide to what guide to what we'll we'll we'll be building, how we'll be building, how we'll be building, how we'll do it, do it, do it, the settings, and the settings, and the settings, and each of the modules. each of the modules. So, this is so So, this is so you can follow along you can follow along you can follow along if you if you if you get stuck somewhere. How do you get stuck somewhere. How do you get stuck somewhere. How do you actually get started actually get started actually get started with this, right? So with this, right? So , this gives you complete , this gives you complete , this gives you complete instructions. But if instructions. But if instructions. But if you want to get started with you want to get started with you want to get started with code, click code, click code, click here, the idea is to quickly here, the idea is to quickly here, the idea is to quickly launch the agent to the launch the agent to the launch the agent to the code, right? code, right? code, right? Click on this. Click on this. Click on this. Scroll to the very Scroll to the very Scroll to the very bottom and you will see the URL of the bottom and you will see the URL of the code editor. Is everyone with me?

  13. code editor. Is everyone with me? Click on this Click on this URL. URL. URL. Those who have the internet. Those who have the internet. Yes, everyone with Yes, everyone with internet access, click internet access, click internet access, click on this button right here, on this button right here, on this button right here, scroll all the way scroll all the way scroll all the way down to the down to the down to the code editor URL. And code editor URL. And code editor URL. And then open it, then open it, then open it, and you should have the and you should have the and you should have the first module appear. So, first module appear. So, first module appear. So, this is the first module, and you this is the first module, and you this is the first module, and you can close all of this can close all of this . The first thing you will . The first thing you will . The first thing you will need to need to need to do is choose a do is choose a do is choose a kernel. Right? And which kernel. Right? And which kernel. Right? And which kernel should I choose? kernel should I choose? kernel should I choose? Go to the same Go to the same Go to the same workshop studio here in the workshop studio here in the workshop studio here in the settings section settings section settings section when you start and when you start and when you start and proceed to the proceed to the proceed to the next steps. It's next steps. It's next steps. It's actually going to show you actually going to show you actually going to show you here, right? So, here, right? So, here, right? So, select Python select Python select Python environments USR bin Python 3.13 kernel. environments USR bin Python 3.13 kernel. Copy this and in the Copy this and in the kernel selection box paste it kernel selection box paste it kernel selection box paste it here and it should here and it should here and it should recognize it for recognize it for recognize it for you. Good? So, you you. Good? So, you you. Good? So, you need to do this need to do this need to do this for every module for every module for every module you run.

  14. you run. you run. Now, what are we building Now, what are we building Now, what are we building today? Is everyone with me? Is there today? Is everyone with me? Is there today? Is everyone with me? Is there anyone who is not with anyone who is not with anyone who is not with me? Oh, many of me? Oh, many of me? Oh, many of you. Through Wi-Fi? Is there anything you. Through Wi-Fi? Is there anything you. Through Wi-Fi? Is there anything else? Wi-Fi only? So, what are else? Wi-Fi only? So, what are else? Wi-Fi only? So, what are we doing? Are we... we doing? Are we... Okay, we just Yes, Okay, we just Yes, Okay, we just Yes, of course, thank you. So, of course, thank you. So, of course, thank you. So, if that's the case, we'll if that's the case, we'll if that's the case, we'll start step by start step by start step by step. It's pretty step. It's pretty step. It's pretty simple, and you simple, and you simple, and you can definitely go back can definitely go back can definitely go back and try it yourself, and try it yourself, and try it yourself, okay? So I'll just okay? So I'll just okay? So I'll just continue, and you feel free to continue, and you feel free to continue, and you feel free to ask ask ask questions. So what are we questions. So what are we questions. So what are we building today? building today? building today? Today we are Today we are Today we are creating a creating a creating a customer support agent customer support agent customer support agent using Strands agent, using Strands agent, using Strands agent, which is an which is an which is an agent management framework. agent management framework. This actually works like This actually works like using an agent using an agent using an agent in a loop. The user in a loop. The user in a loop. The user sends input and sends input and sends input and context, and you context, and you context, and you provide the LLM, right? provide the LLM, right? Since this works Since this works natively with Amazon, we have a natively with Amazon, we have a natively with Amazon, we have a Bedrock-based model, Bedrock-based model, Bedrock-based model, but you can have your but you can have your but you can have your own. If you own. If you own. If you go here to go here to go here to Strands agents, this is Strands agents, this is Strands agents, this is Strands agents itself, you can Strands agents itself, you can Strands agents itself, you can look at look at model providers, you can model providers, you can use use any of your favorites, you any of your favorites, you any of your favorites, you can can can use Llama, use Llama, use Llama, or host locally, or host locally, or host locally, here's how. You here's how. You here's how. You just need to call just need to call just need to call the model here, define the model here, define the model here, define it, and then it, and then specify the model and its specify the model and its name in the agent settings. This can be name in the agent settings. This can be name in the agent settings. This can be done with OpenAI, done with OpenAI, done with OpenAI, the system supports the system supports the system supports all your different LLMs, all your different LLMs, all your different LLMs, your favorite LLMs.

  15. your favorite LLMs. your favorite LLMs. Use whatever Use whatever Use whatever you want. Um, Hugging Face, you want. Um, Hugging Face, you want. Um, Hugging Face, all your favorites, all your favorites, all your favorites, right? So, grab your right? So, grab your right? So, grab your favorite model, your favorite model, your favorite model, your own API key, own API key, own API key, connect to the connect to the connect to the model—and we're ready to model—and we're ready to model—and we're ready to go. So, we are go. So, we are go. So, we are building a simple building a simple customer support agent. What makes customer support agent. What makes an agent powerful an agent powerful an agent powerful is the agent is the agent is the agent reasoning cycle: when reasoning cycle: when reasoning cycle: when a user asks a user asks a user asks a question and says, "Hey a question and says, "Hey , I have a problem. , I have a problem. , I have a problem. I have this I have this I have this problem." The agent problem." The agent problem." The agent receives this input, receives this input, receives this input, activates, activates, activates, calls the LLM, and the LLM reads calls the LLM, and the LLM reads calls the LLM, and the LLM reads the question and calls the the question and calls the the question and calls the tool. We tool. We tool. We need to define a need to define a need to define a toolkit toolkit toolkit because tools because tools are a way to empower are a way to empower are a way to empower an agent an agent an agent to perform to perform to perform functions. Since LLMs functions. Since LLMs functions. Since LLMs mostly only mostly only mostly only predict the predict the predict the next token, we next token, we next token, we don't want to don't want to don't want to rely solely rely solely rely solely on the on the on the model's underlying knowledge of the response.

  16. model's underlying knowledge of the response. You want to tie You want to tie it to a source of truth, it to a source of truth, it to a source of truth, to a source of to a source of to a source of information. This information. This information. This information can information can information can be stored in your be stored in your be stored in your database, in a file, or database, in a file, or database, in a file, or in any other in any other in any other format. And this can be format. And this can be format. And this can be written within the written within the written within the tool, and the agent tool, and the agent tool, and the agent can be given access can be given access can be given access to this tool, to this tool, to this tool, and the agent decides and the agent decides and the agent decides when when when to use it. to use it. The agent may have The agent may have access to many access to many access to many different tools, different tools, different tools, and it and it and it will rely on the LLM will rely on the LLM , its capabilities and its , its capabilities and its , its capabilities and its ability to make ability to make ability to make logical inferences, logical inferences, logical inferences, to figure out which to figure out which to figure out which tool to choose, tool to choose, tool to choose, call it, call it, call it, get a response, and get a response, and get a response, and maybe again—the maybe again—the maybe again—the agent's cycle may agent's cycle may agent's cycle may complete, and then complete, and then complete, and then it will send a it will send a it will send a response. Another response. Another response. Another amazing advantage of amazing advantage of amazing advantage of using an using an agent environment is agent environment is that you can that you can that you can support many support many support many different models and different models and different models and change them to change them to any other without changing the any other without changing the any other without changing the system system system prompt. You can prompt. You can prompt. You can do this if do this if do this if you want, but you don't you want, but you don't you want, but you don't have to have to have to change the system change the system change the system query to change the query to change the query to change the structure or structure or structure or architecture of how architecture of how architecture of how everything works. That's it, and everything works. That's it, and everything works. That's it, and after that you can after that you can after that you can try any try any try any model you want model you want and everything and everything and everything will continue to will continue to will continue to work. Everything is ready work. Everything is ready work. Everything is ready to go. So you to go. So you to go. So you can even can even can even compare compare compare the performance of the performance of the performance of different models based on the same different models based on the same template template code. This is extremely code. This is extremely code. This is extremely powerful, and as powerful, and as powerful, and as a result, you a result, you a result, you get a response. Is get a response. Is get a response. Is n't that right? So how do we get started n't that right? So how do we get started n't that right? So how do we get started with this?

  17. with this? First—in your First—in your first module, we first module, we first module, we install the install the install the requirements files (requirements.text). requirements files (requirements.text). Then we define Then we define the tools. Is the tools. Is the tools. Is it large enough for it large enough for it large enough for everyone to see? everyone to see? everyone to see? Do you need to Do you need to Do you need to zoom in a little more? Okay, zoom in a little more? Okay, zoom in a little more? Okay, great. I see great. I see thumbs up. So, what are we thumbs up. So, what are we doing here? Since doing here? Since doing here? Since we are building we are building customer service bots, the first thing customer service bots, the first thing we need is data. We we need is data. We we need is data. We created fictitious created fictitious created fictitious data about two data about two data about two customers and their customers and their customers and their orders. They orders. They orders. They ordered something on the ordered something on the ordered something on the website and now they have website and now they have website and now they have questions, questions, questions, they want to get they want to get they want to get a refund for a refund for a refund for their orders. How do their orders. How do their orders. How do they do it and how they do it and how they do it and how can we build an can we build an can we build an agent system that agent system that agent system that can offer can offer can offer solutions for such solutions for such solutions for such clients? So, they have clients? So, they have clients? So, they have these orders. It's these orders. It's these orders. It's like a like a dictionary. These are our dictionary. These are our dictionary. These are our customers, these are customers, these are customers, these are order statuses, and we order statuses, and we order statuses, and we define the define the define the tools. tools. Tools can be Tools can be written as written as written as functional code, functional code, functional code, but it can also but it can also but it can also be an NLP tool be an NLP tool be an NLP tool that you can that you can that you can generate. The way generate. The way generate. The way to define to define to define a tool is a tool is to use the to use the @tool decorator function, after @tool decorator function, after @tool decorator function, after which you write the code.

  18. which you write the code. which you write the code. Here we have a simple Here we have a simple customer finder that customer finder that simply does simply does simply does get.customer_id. Then we get.customer_id. Then we get.customer_id. Then we have another tool have another tool have another tool that simply retrieves that simply retrieves order history. The third order history. The third tool we have tool we have tool we have is is is refund processing. refund processing. refund processing. Yes? So, in each of Yes? So, in each of Yes? So, in each of these cases, these cases, these cases, the tools may the tools may the tools may look very look very different, but they all different, but they all different, but they all have the same have the same have the same format and template. format and template. format and template. They all just have the They all just have the They all just have the act tool decorator. So act tool decorator. So act tool decorator. So let's get this going. let's get this going. And then we And then we do the following—this is do the following—this is do the following—this is our source code our source code our source code for creating for creating for creating tools. Now, tools. Now, tools. Now, to create an agent, to create an agent, to create an agent, we only need two we only need two we only need two basic things. The first basic things. The first is your system is your system is your system prompt. The second is prompt. The second is prompt. The second is your LLM, your model. In your LLM, your model. In your LLM, your model. In this case, this case, this case, since we since we since we are using are using are using native Bedrock models, native Bedrock models, native Bedrock models, hosted models, hosted models, hosted models, we don't have to we don't have to we don't have to specify a model. We specify a model. We specify a model. We just just just use the use the use the standard model. standard model. standard model. But as I've shown on But as I've shown on But as I've shown on this site, you this site, you this site, you can set up can set up can set up any model you any model you any model you want and add want and add want and add it here. The third thing to it here. The third thing to it here. The third thing to add, beyond add, beyond add, beyond that, is your that, is your that, is your tools. So you tools. So you tools. So you call the call the call the agent method, specify the agent method, specify the agent method, specify the two or three tools two or three tools two or three tools we just we just we just defined, and then defined, and then defined, and then create a system create a system create a system prompt that says, "You are a prompt that says, "You are a customer service agent, and customer service agent, and here are your instructions.

  19. here are your instructions. here are your instructions. Always check Always check Always check the customer with the customer with the customer with search before search before search before taking any taking any taking any action. Use the action. Use the action. Use the tools' data tools' data tools' data to answer the to answer the to answer the question. Don't question. Don't question. Don't ask the customer for ask the customer for ask the customer for information you information you information you already have." So, in the already have." So, in the already have." So, in the system prompt, system prompt, system prompt, you are telling the agent, you are telling the agent, you are telling the agent, that is, telling the LLM, how that is, telling the LLM, how that is, telling the LLM, how to use to use to use the tools it has the tools it has the tools it has access to and what to access to and what to access to and what to do with them. This do with them. This do with them. This way your LLM and your way your LLM and your way your LLM and your agent understand what agent understand what agent understand what needs to be done. needs to be done. needs to be done. So now when we So now when we So now when we run this run this run this agent, we just agent, we just agent, we just say, "Hi, I'm say, "Hi, I'm say, "Hi, I'm customer so-and-so. customer so-and-so. customer so-and-so. Can you check Can you check Can you check my recent my recent my recent orders?" And now orders?" And now orders?" And now he says, "Sure, he says, "Sure, he says, "Sure, let me let me let me open your open your open your account and account and account and order history." order history." order history." So he calls the So he calls the So he calls the first instrument. first instrument. first instrument. He performs a He performs a He performs a client search. Then client search. Then client search. Then it calls the second it calls the second it calls the second tool— tool— getting getting getting order history. And he says, "Oh, order history. And he says, "Oh, order history. And he says, "Oh, okay. Here's a summary of okay. Here's a summary of okay. Here's a summary of your recent your recent your recent orders." And then orders." And then orders." And then he says, "Hey, can I he says, "Hey, can I he says, "Hey, can I help you with help you with help you with anything else?" That's great, anything else?" That's great, anything else?" That's great, but how do we find out but how do we find out but how do we find out what's really what's really what's really going on under the going on under the going on under the hood? Because hood? Because hood? Because often one of the problems often one of the problems often one of the problems is that is that is that the agent is doing something and I the agent is doing something and I the agent is doing something and I have no have no have no idea what exactly. Where is idea what exactly. Where is idea what exactly. Where is my control? How do I my control? How do I my control? How do I get this, right? So get this, right? So get this, right? So let's explore let's explore let's explore this agent work cycle this agent work cycle this agent work cycle . So, that's how . So, that's how . So, that's how it works, right? As we it works, right? As we it works, right? As we saw in the previous saw in the previous saw in the previous diagram, the user diagram, the user diagram, the user sends sends sends a message, it a message, it a message, it goes to LLM, LLM calls goes to LLM, LLM calls goes to LLM, LLM calls the tool, we the tool, we the tool, we get the result, get the result, get the result, and finally we get and finally we get and finally we get the response. Now we the response. Now we the response. Now we can look at the can look at the can look at the agent message.

  20. agent message. agent message. agent.message This is just code agent.message This is just code agent.message This is just code to see what the to see what the messages look like. So, messages look like. So, this shows us the this shows us the this shows us the transfer process. The transfer process. The transfer process. The total number of total number of total number of messages is shown here, this is what messages is shown here, this is what messages is shown here, this is what the user is saying. the user is saying. the user is saying. That's what That's what That's what an assistant does. Then comes the an assistant does. Then comes the an assistant does. Then comes the first first first tool call, the second tool call, the second tool call, the second tool call. tool call. tool call. The user The user The user didn't do anything else, so didn't do anything else, so didn't do anything else, so the assistant says, "Okay, the assistant says, "Okay, the assistant says, "Okay, here's the answer." So, here's the answer." So, here's the answer." So, these are the metrics. This is the these are the metrics. This is the these are the metrics. This is the number of number of number of tokens used tokens used . We can . We can . We can use use use more metrics. You more metrics. You more metrics. You can add more can add more can add more metrics, do as you metrics, do as you metrics, do as you wish. Besides, we wish. Besides, we wish. Besides, we just want to just want to just want to do something do something do something simple here, right? Because simple here, right? Because simple here, right? Because this is a simple guide. this is a simple guide. this is a simple guide. But we can also But we can also But we can also implement implement implement multi-pass dialogues multi-pass dialogues . This is just one dialogue. . This is just one dialogue. . This is just one dialogue. You can also You can also You can also launch launch launch multi-pass dialogues multi-pass dialogues , where you have a long , where you have a long , where you have a long conversation with an agent. conversation with an agent. conversation with an agent. For that, you For that, you For that, you can also try these can also try these can also try these examples, okay? These are examples, okay? These are examples, okay? These are other samples we other samples we other samples we provided. You can provided. You can provided. You can write your own if write your own if write your own if your internet works. your internet works. your internet works. I hope it works. I hope it works. I hope it works. Or not? But you Or not? But you Or not? But you can also do this can also do this : we created chat.py in : we created chat.py in : we created chat.py in the same module, and the same module, and the same module, and we have a chat.py file for we have a chat.py file for we have a chat.py file for each of those modules each of those modules . So when I . So when I . So when I click on chat.py, it's the click on chat.py, it's the click on chat.py, it's the same basic code, same basic code, same basic code, except we've except we've except we've enabled it for enabled it for enabled it for multi-pass multi-pass multi-pass dialogue. You do the dialogue. You do the dialogue. You do the same thing, activate... You same thing, activate... You same thing, activate... You just need to...

  21. just need to... When you go here When you go here , you can open a , you can open a , you can open a terminal and terminal and terminal and copy these two copy these two copy these two lines, since we're lines, since we're lines, since we're already in this folder. Then already in this folder. Then already in this folder. Then you set the requirements you set the requirements you set the requirements via pip, open via pip, open via pip, open everything, and you can everything, and you can everything, and you can communicate with it communicate with it communicate with it directly if you want. directly if you want. directly if you want. You can say, " You can say, " Hey, blah blah blah." You Hey, blah blah blah." You Hey, blah blah blah." You can just can just can just type, right? And you type, right? And you type, right? And you can have can have can have multi-turn dialogues with him multi-turn dialogues with him . He . He . He will simply answer, and here you go will simply answer, and here you go will simply answer, and here you go . So, you . So, you . So, you can continue to have can continue to have can continue to have multi-turn multi-turn multi-turn dialogues with him. dialogues with him. dialogues with him. Same underlying code, same Same underlying code, same Same underlying code, same tools, and tools, and tools, and it can just it can just it can just talk to you. 60 talk to you. 60 talk to you. 60 lines of code. Less than 60 lines of code. Less than 60 lines of code. Less than 60 lines of code. So, this is the lines of code. So, this is the lines of code. So, this is the base agent. Is everything base agent. Is everything base agent. Is everything clear? Okay, clear? Okay, clear? Okay, cool. Perfectly. The second cool. Perfectly. The second cool. Perfectly. The second part. How can I make part. How can I make part. How can I make this agent better? this agent better? this agent better? What else can we What else can we What else can we do? These... these are do? These... these are do? These... these are basic things, right basic things, right ? Anyone who has read ? Anyone who has read ? Anyone who has read blogs or simply blogs or simply blogs or simply searched for information searched for information searched for information online probably knows online probably knows online probably knows how to do this. How how to do this. How how to do this. How can we improve this?

  22. can we improve this? can we improve this? Let me Let me Let me introduce you to what introduce you to what introduce you to what we call we call we call hooks. Hooks are great hooks. Hooks are great hooks. Hooks are great because...let because...let because...let me me me open this up first. open this up first. Let me Let me open open open that code first. Okay, I'll that code first. Okay, I'll that code first. Okay, I'll close this. So, hooks are a close this. So, hooks are a close this. So, hooks are a way to way to ensure that ensure that certain certain certain program commands and program commands and program commands and functions are executed. So what you functions are executed. So what you functions are executed. So what you can do in can do in can do in this whole process: this whole process: this whole process: from the moment from the moment from the moment the agent is called, when it the agent is called, when it the agent is called, when it executes its own executes its own executes its own tool calls tool calls , receives responses, , receives responses, , receives responses, and sends them. We and sends them. We and sends them. We want to be want to be want to be able to able to able to control this, control this, control this, right? From the moment right? From the moment right? From the moment an agent is called to, an agent is called to, an agent is called to, for example, a tool is called for example, a tool is called for example, a tool is called , or , or , or perhaps after the perhaps after the perhaps after the tool tool tool is called and a is called and a is called and a response is received, we want to response is received, we want to response is received, we want to have significant have significant have significant control over this. We control over this. We control over this. We want to potentially want to potentially want to potentially be able to be able to be able to check who exactly is check who exactly is check who exactly is using this. using this. using this. For example, who are the For example, who are the For example, who are the customers who are customers who are customers who are likely likely likely to interact with him?

  23. to interact with him? to interact with him? Or what types of Or what types of Or what types of questions do they questions do they questions do they answer? Should answer? Should answer? Should he even he even he even answer such answer such answer such questions? Do questions? Do questions? Do we want to limit the frequency of we want to limit the frequency of tool usage and tool usage and the number of tool the number of tool the number of tool calls? How calls? How calls? How can we do this? can we do this? Once you have a hook, you Once you have a hook, you can inject can inject can inject your code at this point, your code at this point, your code at this point, where you can add a where you can add a where you can add a validation function validation function validation function or other type of function or other type of function that will that will that will ensure that ensure that ensure that certain certain certain checks are performed before checks are performed before checks are performed before passing to the passing to the passing to the final final final result. So you result. So you result. So you can do it before can do it before can do it before the call, after the the call, after the the call, after the LLM call, before the LLM call, before the LLM call, before the tool call tool call and then decide whether and then decide whether and then decide whether to approve it or to approve it or to approve it or cancel it, and even cancel it, and even cancel it, and even do it after the do it after the tool executes before tool executes before it sends a it sends a it sends a response. You can response. You can response. You can do it in all of these do it in all of these do it in all of these places, but also in places, but also in places, but also in many others. And this is many others. And this is many others. And this is just an example. If we just an example. If we just an example. If we go to Strands Agents, go to Strands Agents, go to Strands Agents, it will show all the different it will show all the different it will show all the different ways that ways that ways that hooks can be applied. Um hooks can be applied. Um ...So, is this...is this where ...So, is this...is this where ...So, is this...is this where I am now? No, I am now? No, I am now? No, I'll close all of this. Um, I'll close all of this. Um, I'll close all of this. Um, okay. So, um, in the okay. So, um, in the okay. So, um, in the hooks, what are we hooks, what are we hooks, what are we doing here? We have the same doing here? We have the same doing here? We have the same data that we data that we data that we call.

  24. call. call. Let me Let me Let me run run run this through first. Good. Let this through first. Good. Let this through first. Good. Let me go to me go to me go to the notebook. This is the notebook. This is the notebook. This is an application. Isn't this an application. Isn't this an application. Isn't this a notebook? a notebook? a notebook? No. No. No. Oh, these are Oh, these are customer service tools. OK. Um, customer service tools. OK. Um, yes, yes, yes. I'm not where I yes, yes, yes. I'm not where I yes, yes, yes. I'm not where I need to be. Good. Now need to be. Good. Now need to be. Good. Now I'm in a notebook. Again I'm in a notebook. Again I'm in a notebook. Again , we need to , we need to , we need to set requirements and set requirements and set requirements and choose our choose our choose our environment. So, how does environment. So, how does environment. So, how does it work? Now we it work? Now we it work? Now we need to import need to import need to import strands.hooks, hook provider, hook strands.hooks, hook provider, hook strands.hooks, hook provider, hook registry and define where registry and define where registry and define where we want to call we want to call we want to call these hooks. In our these hooks. In our these hooks. In our case, we want to case, we want to case, we want to do this before do this before do this before calling and before calling and before calling and before calling the tool calling the tool . And I'll tell you what . And I'll tell you what . And I'll tell you what we do. We are we do. We are we do. We are trying to create a trying to create a request rate limit hook that request rate limit hook that ensures that ensures that no no more than three tools are called for a single user request. If more than three tools are called for a single user request. If more than three tools are called for a single user request. If you have an LLM that just you have an LLM that just goes "crazy" and constantly goes "crazy" and constantly goes "crazy" and constantly calls your calls your calls your tools, it's going tools, it's going tools, it's going to cost you to cost you to cost you a lot of tokens, and you a lot of tokens, and you a lot of tokens, and you know that doesn't know that doesn't know that doesn't work, right? So you work, right? So you work, right? So you want to create a want to create a want to create a hard hard hard frequency limiter and say, " frequency limiter and say, " Hey, even if it doesn't Hey, even if it doesn't Hey, even if it doesn't work, it's okay.

  25. work, it's okay. work, it's okay. Stop it at three." Stop it at three." Stop it at three." Yes? So, here's what we Yes? So, here's what we Yes? So, here's what we do. How can we do. How can we do. How can we create this create this create this frequency limiter frequency limiter frequency limiter here? First, we here? First, we here? First, we define a define a define a rate limiter hook and rate limiter hook and rate limiter hook and say, "Okay, this is the say, "Okay, this is the say, "Okay, this is the maximum maximum maximum number of calls." number of calls." number of calls." We create a We create a We create a standard number and standard number and standard number and then we have to add then we have to add then we have to add it to the registry. So it to the registry. So it to the registry. So here we add it and here we add it and here we add it and say, "Okay, say, "Okay, say, "Okay, pre-call event." And pre-call event." And pre-call event." And then we need another then we need another callback, which is an event callback, which is an event before the tool is called before the tool is called before the tool is called . And a . And a . And a callback callback callback means that it means that it means that it will be called at that time. will be called at that time. will be called at that time. That's because you That's because you That's because you define it here. define it here. So we have So we have a counter that is reset to zero before a counter that is reset to zero before a counter that is reset to zero before every response, every response, every response, that is, every time that is, every time that is, every time the user the user the user sends a new request, sends a new request, because you don't want because you don't want this this this rate limiter to keep rate limiter to keep rate limiter to keep running. And we running. And we running. And we define a second define a second define a second function called function called function called check that checks check that checks check that checks the count, which the count, which the count, which is essentially a counter. It is essentially a counter. It is essentially a counter. It counts the number of counts the number of counts the number of times your times your times your tools tools tools are invoked. That's what are invoked. That's what are invoked. That's what it does, then it it does, then it it does, then it checks the checks the checks the maximum maximum maximum number of calls and number of calls and number of calls and calculates that. So, we calculates that. So, we calculates that. So, we define our define our define our frequency limiter frequency limiter frequency limiter here. And this is the main here. And this is the main here. And this is the main function we function we function we considered. One considered. One considered. One extra line extra line extra line we added is we added is we added is hooks. And we say: " hooks. And we say: " The maximum The maximum The maximum number of frequency number of frequency number of frequency limit hook calls limit hook calls limit hook calls is is is three." And if we three." And if we three." And if we run it, it run it, it run it, it calls these two and calls these two and calls these two and says, "Okay, call says, "Okay, call says, "Okay, call tool one, tool one, tool one, call tool call tool call tool two. Here's a summary of two. Here's a summary of two. Here's a summary of your events. This is what your events. This is what your events. This is what happened." But let's happened." But let's happened." But let's actually actually actually test this.

  26. test this. test this. Let's try to break this down Let's try to break this down Let's try to break this down and see if the speed and see if the speed and see if the speed limit really works limit really works limit really works , shall we? So, , shall we? So, , shall we? So, here I set the here I set the here I set the maximum maximum maximum number of calls to number of calls to number of calls to two. You want two. You want two. You want to lower the limit to the to lower the limit to the to lower the limit to the trigger. So, here he trigger. So, here he trigger. So, here he brings it up so brings it up so brings it up so many times, many times, many times, right? And so he right? And so he right? And so he actually blocked actually blocked actually blocked it. So, it says it. So, it says it. So, it says "search blocking" here "search blocking" here "search blocking" here because because because the number of times has been exceeded. So the number of times has been exceeded. So the number of times has been exceeded. So when your agent when your agent when your agent starts to starts to starts to malfunction and we're all malfunction and we're all malfunction and we're all worried, "Oh my God, is worried, "Oh my God, is worried, "Oh my God, is my agent going to take over my agent going to take over my agent going to take over everything?", right? This won't everything?", right? This won't everything?", right? This won't happen because happen because happen because we have something we have something we have something called hooks. Are called hooks. Are called hooks. Are you all with me? Is everything you all with me? Is everything you all with me? Is everything okay? Can someone okay? Can someone okay? Can someone run this with run this with run this with me? Am I going too me? Am I going too me? Am I going too fast, or are we just fast, or are we just fast, or are we just observing? It observing? It observing? It works. Oh, okay, works. Oh, okay, works. Oh, okay, great. We have great. We have great. We have at least a few at least a few at least a few people. people. people. I...I would like to I...I would like to I...I would like to learn something about learn something about learn something about hooks. Sometimes, you know, a hooks. Sometimes, you know, a hooks. Sometimes, you know, a hook is better because hook is better because hook is better because when you when you when you use LLM with use LLM with use LLM with some some some tools, LLMs are tools, LLMs are tools, LLMs are probabilistic. probabilistic. probabilistic. Yes. Yes. Yes. Do you know? They, when you Do you know? They, when you Do you know? They, when you add a prompt to add a prompt to add a prompt to your agent your agent your agent app, that prompt app, that prompt is like a suggestion. is like a suggestion. is like a suggestion. You know, it's just about You know, it's just about You know, it's just about the probability of giving the probability of giving the probability of giving you an answer. So you an answer. So you an answer. So when you when you when you use a hook, use a hook, use a hook, you can be more you can be more you can be more deterministic. So deterministic. So deterministic. So you can insert the you can insert the you can insert the code into your agent code into your agent code into your agent loop. So you can loop. So you can loop. So you can insert code, Python code, insert code, Python code, insert code, Python code, before or after the call.

  27. before or after the call. before or after the call. So you can, uh, So you can, uh, So you can, uh, stop, uh, I don't stop, uh, I don't stop, uh, I don't know if in this know if in this know if in this example you're example you're example you're stopping more than stopping more than stopping more than three three three tool calls. But, tool calls. But, tool calls. But, for example, if you for example, if you for example, if you want to restrict IP, I want to restrict IP, I want to restrict IP, I don't know, some don't know, some don't know, some credit card numbers or credit card numbers or credit card numbers or something like that, something like that, something like that, Yes. Yes. Yes. you can put a you can put a you can put a hook, code that is able hook, code that is able hook, code that is able to understand certain things. to understand certain things. to understand certain things. So, yeah, hey, you So, yeah, hey, you So, yeah, hey, you can get that can get that can get that information. So I'm information. So I'm information. So I'm going to block going to block going to block it with this it with this it with this deterministic deterministic deterministic function so you don't function so you don't function so you don't get that. get that. So the model will never So the model will never get this get this get this information. So you information. So you information. So you block the call to block the call to block the call to avoid wasting tokens. avoid wasting tokens. avoid wasting tokens. So you don't need to So you don't need to So you don't need to call call call the model again. You don't...You don't the model again. You don't...You don't the model again. You don't...You don't spend tokens spend tokens spend tokens because you stop because you stop because you stop it. You send a hook. it. You send a hook. it. You send a hook. And if you don't want to And if you don't want to And if you don't want to send a certain type of send a certain type of send a certain type of response to your response to your customer support, you can customer support, you can stop that stop that stop that response as well response as well response as well using a post- using a post- using a post- call hook. call hook. That's right. Thank you. Okay, now you Okay, now you can try it can try it can try it yourself. And again yourself. And again yourself. And again , if you want to , if you want to , if you want to implement implement implement multi-pass dialogs multi-pass dialogs , go to chat.py in , go to chat.py in , go to chat.py in the second module with the second module with the second module with hooks enabled.

  28. hooks enabled. hooks enabled. You can still You can still You can still continue to continue to continue to communicate, communicate, communicate, experiment, experiment, experiment, add different hooks in add different hooks in add different hooks in different places, and different places, and different places, and see what works. see what works. see what works. You can try You can try You can try blocking certain blocking certain blocking certain customers or certain customers or certain customers or certain types of questions. This is a types of questions. This is a types of questions. This is a really great really great really great way to set up way to set up way to set up fuses, isn't fuses, isn't fuses, isn't it? So, hooks are it? So, hooks are it? So, hooks are incredible, and we incredible, and we incredible, and we need them to need them to need them to build quality build quality build quality agent systems. agent systems. agent systems. Now let's add Now let's add Now let's add another level of another level of another level of coolness to this coolness to this coolness to this project, okay? project, okay? project, okay? Let's add Let's add Let's add skills. Let's add skills. Let's add skills. Let's add skills and find a skills and find a skills and find a way to control way to control way to control your agent and your agent and your agent and language model so that language model so that language model so that they respond the way they respond the way they respond the way we need. we need. Management—I love Management—I love management. The handling management. The handling is just great. is just great. is just great. So, let's move on to So, let's move on to So, let's move on to management. Do you have any management. Do you have any management. Do you have any questions? Does everyone questions? Does everyone questions? Does everyone understand the idea with the understand the idea with the understand the idea with the hooks? Yes. So, hooks? Yes. So, hooks? Yes. So, if we...Excuse me?

  29. if we...Excuse me? if we...Excuse me? Can you repeat Can you repeat Can you repeat the question? the question? the question? Good, good, good. Good, good, good. Good, good, good. Yes, the question was... Yes, the question was... Oh, you have Oh, you have Oh, you have a microphone now. Do you want... a microphone now. Do you want... a microphone now. Do you want... Yes. Yes. Yes. Perfectly. This is serious. Perfectly. This is serious. Perfectly. This is serious. I saw in the I saw in the I saw in the hook example that the agent hook example that the agent hook example that the agent continued continued continued to run but simply to run but simply to run but simply blocked the blocked the blocked the tool call. How tool call. How tool call. How to stop an agent from to stop an agent from to stop an agent from getting into an getting into an getting into an infinite loop and infinite loop and infinite loop and continuing continuing continuing to work cyclically? to work cyclically? to work cyclically? By defining our hooks, By defining our hooks, By defining our hooks, we can we can we can configure them configure them configure them to even complete the to even complete the to even complete the agent's turn if agent's turn if agent's turn if we want. For we want. For we want. For demonstration purposes, we demonstration purposes, we demonstration purposes, we showed how it showed how it showed how it works so you works so you works so you can see the can see the can see the speed limit and speed limit and speed limit and make sure it make sure it make sure it doesn't happen doesn't happen doesn't happen multiple times in a row. multiple times in a row. multiple times in a row. Challenges. So, it Challenges. So, it Challenges. So, it tries tries tries to call the tool to call the tool , and since we , and since we , and since we specified "before specified "before specified "before calling the tool calling the tool ", it kept ", it kept ", it kept trying, stopped, and trying, stopped, and trying, stopped, and LLM LLM LLM continued the loop to continued the loop to continued the loop to the end anyway. But if we the end anyway. But if we the end anyway. But if we want, we can want, we can want, we can do something like do something like do something like say, "Okay, if say, "Okay, if say, "Okay, if I see this, just I see this, just I see this, just stop the move and end stop the move and end stop the move and end it at this point." it at this point." it at this point." So, we can definitely So, we can definitely customize everything. We customize everything. We did it this way did it this way did it this way only because we wanted to only because we wanted to only because we wanted to show you how the show you how the show you how the system works from start system works from start system works from start to finish. Thank you for this to finish. Thank you for this to finish. Thank you for this question. Okay, question. Okay, question. Okay, so skills and so skills and so skills and management. This is a chatbot management. This is a chatbot management. This is a chatbot that is supposed to answer that is supposed to answer that is supposed to answer support questions support questions support questions , but they , but they , but they can ask a bunch of can ask a bunch of can ask a bunch of different questions that the different questions that the different questions that the agent simply doesn't have agent simply doesn't have agent simply doesn't have access to or knowledge for.

  30. access to or knowledge for. So how do we give So how do we give him this knowledge? How do we him this knowledge? How do we him this knowledge? How do we teach him teach him teach him to respond to them? to respond to them? We create what We create what 's called a skills folder, a 's called a skills folder, a 's called a skills folder, a skills file, which skills file, which skills file, which contains potentially contains potentially contains potentially all of your information, all of your information, all of your information, your knowledge base, your knowledge base, your knowledge base, right? Your only right? Your only right? Your only source of truth source of truth source of truth may be about what may be about what may be about what exact steps he exact steps he exact steps he needs to take. And needs to take. And needs to take. And we can add this we can add this we can add this as a as a as a markdown file, and this is the way markdown file, and this is the way markdown file, and this is the way that... that... So here's how it So here's how it So here's how it would work: when would work: when would work: when we add skills to we add skills to we add skills to an agent, it would first an agent, it would first an agent, it would first look at the look at the look at the skills folder and read skills folder and read skills folder and read all the skills, all the skills, all the skills, determine which one determine which one determine which one makes sense, and then makes sense, and then makes sense, and then use those use those use those skills. Um, still... skills. Um, still... Let me Let me Let me streamline this a little bit, but streamline this a little bit, but streamline this a little bit, but skills are a way skills are a way skills are a way that we that we that we can provide our can provide our ... Let me ... Let me ... Let me move on to the third one. move on to the third one. Third module. So, Third module. So, um, I'll just run this um, I'll just run this um, I'll just run this first. Perfectly.

  31. first. Perfectly. first. Perfectly. So, first of all, when So, first of all, when So, first of all, when we create skills, we create skills, we create skills, now we have three types of now we have three types of now we have three types of skills that we skills that we skills that we created. First—how created. First—how created. First—how to process to process to process refunds? How refunds? How refunds? How to track to track to track an order? And what if an order? And what if an order? And what if people ask people ask account-related questions? account-related questions? My password doesn't work My password doesn't work My password doesn't work or something like that, or something like that, or something like that, a bunch of questions that are a bunch of questions that are a bunch of questions that are often asked. How do often asked. How do often asked. How do we make this we make this we make this work? Isn't that right? work? Isn't that right? work? Isn't that right? So, this one is about So, this one is about So, this one is about how to fix how to fix how to fix account issues account issues account issues . So here we . So here we . So here we create these different create these different create these different skill plugins and skill plugins and skill plugins and then we can then we can then we can call them call them call them directly. So directly. So directly. So when I open the when I open the when I open the skills folder here, we skills folder here, we skills folder here, we can look at can look at can look at examples of skills. examples of skills. So this is just a So this is just a markdown file with account troubleshooting skills markdown file with account troubleshooting skills that gives it some that gives it some extra context extra context extra context because you don't want to because you don't want to because you don't want to flood your flood your flood your system query with all the system query with all the system query with all the information you information you information you have because have because have because those are also those are also those are also considered input considered input considered input tokens and they tokens and they tokens and they can be can be can be wasted wasted wasted unnecessarily. So, unnecessarily. So, unnecessarily. So, when a specific question is asked when a specific question is asked when a specific question is asked , we can , we can , we can provide context provide context provide context relevant to that relevant to that relevant to that specific type of specific type of specific type of question, then it will question, then it will question, then it will have access to have access to have access to all the necessary all the necessary all the necessary information to information to information to properly properly properly answer the answer the answer the question. So, in question. So, in question. So, in this case, this this case, this this case, this particular skill is particular skill is particular skill is about how about how about how we can troubleshoot we can troubleshoot account issues? What is account issues? What is needed to needed to needed to reset the password? What reset the password? What reset the password? What to do when to do when to do when your account is your account is your account is blocked? And the blocked? And the blocked? And the same goes for same goes for same goes for order tracking, right?

  32. order tracking, right? order tracking, right? What should we do? What What should we do? What What should we do? What steps should we steps should we steps should we take? So these are take? So these are take? So these are instructions that we instructions that we instructions that we give to the agent in advance give to the agent in advance give to the agent in advance , and we write them , and we write them , and we write them based on what we based on what we based on what we want the agent to want the agent to want the agent to do. So, we do. So, we do. So, we create these create these create these skill files, skill files, skill files, markup files, and when we markup files, and when we markup files, and when we run them, in addition to the run them, in addition to the run them, in addition to the system prompt, system prompt, system prompt, we provide access to the we provide access to the we provide access to the plugin. Now we plugin. Now we plugin. Now we add another add another add another parameter parameter parameter called plugin called plugin , and it has access to , and it has access to , and it has access to all all all skill plugins, and the skill plugins, and the skill plugins, and the skill plugin points to the skill plugin points to the skill plugin points to the skills folder. So, skills folder. So, skills folder. So, now it will now it will now it will call out the call out the call out the skills that are needed skills that are needed skills that are needed for a specific type of for a specific type of for a specific type of question. And when this question. And when this question. And when this starts, and someone starts, and someone starts, and someone says, "I want a says, "I want a says, "I want a refund for refund for refund for my wireless my wireless my wireless headphones." it headphones." it headphones." it actually calls for actually calls for actually calls for skills as a skills as a skills as a tool. And then tool. And then tool. And then he says, “Okay, I he says, “Okay, I he says, “Okay, I opened your opened your opened your account. "Here's account. "Here's account. "Here's what I found, and here's how what I found, and here's how what I found, and here's how I do it." So, it I do it." So, it I do it." So, it becomes more and more becomes more and more becomes more and more deterministic. It deterministic. It deterministic. It has a natural has a natural has a natural order in which it order in which it order in which it works, and you can works, and you can only call the context when you only call the context when you need it, and you don't need it, and you don't need it, and you don't overload your overload your overload your system prompt with a system prompt with a system prompt with a bunch of tokens every time.

  33. bunch of tokens every time. So, those are skills, but So, those are skills, but how much...is that what how much...is that what how much...is that what I usually I usually I usually encounter when it comes encounter when it comes encounter when it comes to to to driving? How many driving? How many driving? How many times have we tried times have we tried times have we tried to get our to get our to get our agents to agents to agents to answer answer answer questions in a certain questions in a certain questions in a certain format, and they format, and they format, and they kept getting it wrong. kept getting it wrong. He seems to He seems to answer answer answer all the difficult all the difficult all the difficult questions correctly. If I questions correctly. If I questions correctly. If I tell him... So tell him... So tell him... So if I ask, " if I ask, " Okay, what is the amount of Okay, what is the amount of Okay, what is the amount of the refund that I should the refund that I should the refund that I should get?" he get?" he get?" he will provide the will provide the will provide the return information and return information and return information and say, "Okay, here it is. say, "Okay, here it is. say, "Okay, here it is. " But they also tend to " But they also tend to " But they also tend to talk talk talk too much and generate too much and generate too much and generate a lot of tokens a lot of tokens a lot of tokens just by just by just by expressing themselves freely. So how do expressing themselves freely. So how do expressing themselves freely. So how do we get it we get it we get it to respond in the to respond in the format we need? How can we format we need? How can we ensure that ensure that structured data is retrieved , if that is what we , if that is what we , if that is what we need? Or, need? Or, need? Or, for example: "Hey, for example: "Hey, for example: "Hey, stop stop stop using dashes using dashes ." Do we have to ." Do we have to ." Do we have to constantly remind ourselves constantly remind ourselves constantly remind ourselves of this every time? of this every time? of this every time? We want to be We want to be We want to be able to able to able to control this control this control this deterministically and deterministically and deterministically and ensure that it ensure that it ensure that it works predictably works predictably . To do this, we . To do this, we . To do this, we use a method use a method called called called management. Which management. Which management. Which helps the agent helps the agent helps the agent direct itself in the direct itself in the direction we need with the direction we need with the help of an help of an assistant agent. So it assistant agent. So it assistant agent. So it works like pair works like pair works like pair programming or programming or programming or partnership, where in the partnership, where in the partnership, where in the process of generating a process of generating a process of generating a result, the result, the partner agent checks partner agent checks partner agent checks what's being created and what's being created and what's being created and can say, "Hey, no, can say, "Hey, no, can say, "Hey, no, that's not what you're supposed to that's not what you're supposed to that's not what you're supposed to do." "Here's the format in do." "Here's the format in do." "Here's the format in which you should

  34. which you should which you should do it." So, your do it." So, your do it." So, your partner agent partner agent partner agent checks, corrects, checks, corrects, checks, corrects, and course corrects, and and course corrects, and and course corrects, and in the end you get in the end you get in the end you get an answer that you are an answer that you are an answer that you are truly happy with. truly happy with. When you deploy When you deploy code to a production code to a production code to a production environment, there is no environment, there is no environment, there is no room for errors in the room for errors in the room for errors in the format structure. You format structure. You format structure. You want to get a want to get a want to get a certain result, and certain result, and certain result, and steering can steering can steering can help you do that help you do that . Now I'm going to do this . Now I'm going to do this . Now I'm going to do this quickly because I want quickly because I want quickly because I want Ellie to talk about Ellie to talk about Ellie to talk about deployment, which is deployment, which is deployment, which is how to how to how to make sure your make sure your make sure your agent is useful and agent is useful and agent is useful and effective. So, uh, effective. So, uh, effective. So, uh, quick...quick quick...quick quick...quick overview of overview of overview of control handlers. control handlers. control handlers. Control handlers Control handlers Control handlers work in the same way as work in the same way as work in the same way as hooks. You can, uh hooks. You can, uh , call them at , call them at , call them at different times. You different times. You different times. You can call them can call them can call them before the LLM, during the before the LLM, during the before the LLM, during the LLM call, before the LLM call, before the LLM call, before the tool call, tool call, tool call, or after it—it's or after it—it's or after it—it's very similar to hooks, very similar to hooks, very similar to hooks, except that at except that at except that at this point you're adding this point you're adding this point you're adding another agent another agent another agent that can do a that can do a that can do a quick check. And quick check. And quick check. And it can work in it can work in it can work in tandem with another to tandem with another to tandem with another to ensure the desired ensure the desired ensure the desired outcome. So outcome. So outcome. So think of it as an think of it as an think of it as an extra training extra training extra training wheel if you will, wheel if you will, wheel if you will, right? So, you right? So, you right? So, you can make a can make a can make a tool call and tool call and tool call and then execute it. And then execute it. And then execute it. And this is a kind of guide this is a kind of guide this is a kind of guide that can say, "Oh, that can say, "Oh, that can say, "Oh, you know what?

  35. you know what? you know what? Check this first before Check this first before Check this first before issuing a issuing a issuing a refund." refund." refund." Or you can say Or you can say : "Change the tone of this : "Change the tone of this : "Change the tone of this message if message if message if it is sent." it is sent." it is sent." And after that it is And after that it is And after that it is sent. So, sent. So, sent. So, now you have more now you have more now you have more control over what control over what control over what your agent generates. And your agent generates. And your agent generates. And if we go back if we go back if we go back to steering. Okay, so again to steering. Okay, so again to steering. Okay, so again , what do we , what do we , what do we want? We want to want? We want to want? We want to import steering. We import steering. We import steering. We want to import want to import want to import steering here, and from here, steering here, and from here, steering here, and from here, again, the again, the again, the steering handler, and these are steering handler, and these are steering handler, and these are all different places where we all different places where we all different places where we do this, and you can do this, and you can do this, and you can do this in different do this in different do this in different ways. ways. Review the Stance agent documentation. All the details Stance agent documentation. All the details will be there, but also will be there, but also will be there, but also in the workshop mentioned in the workshop mentioned in the workshop mentioned here you will see all here you will see all here you will see all the details. Now we the details. Now we the details. Now we create a create a create a deterministic deterministic deterministic handler. We give handler. We give handler. We give him rules and tell him him rules and tell him what to do. And what to do. And what to do. And it could also be a it could also be a it could also be a hard-coded hard-coded hard-coded function. It function. It function. It could also be another agent could also be another agent that has a that has a that has a working hard- working hard- working hard- coded function inside it.

  36. coded function inside it. coded function inside it. We can We can We can customize this, you customize this, you customize this, you can apply, can apply, can apply, for example, for example, for example, type coercion if type coercion if type coercion if you want the output you want the output you want the output data to be only of a data to be only of a data to be only of a certain type. You certain type. You certain type. You can apply can apply can apply different types of restrictions different types of restrictions different types of restrictions here, right? So here, right? So here, right? So then you create a then you create a then you create a Sterling agent, and that's it Sterling agent, and that's it Sterling agent, and that's it for Sterling, right? Now for Sterling, right? Now for Sterling, right? Now you create a you create a you create a Sterling agent and create a Sterling agent and create a Sterling agent and create a guard guard guard rail. Here, the refund workflow handler is defined rail. Here, the refund workflow handler is defined , and finally you , and finally you create a protective create a protective create a protective barrier. Here you say: barrier. Here you say: barrier. Here you say: okay, don't okay, don't okay, don't overpromise, overpromise, overpromise, don't guarantee don't guarantee don't guarantee specific deadlines, specific deadlines, specific deadlines, don't blame don't blame don't blame the customer, acknowledge the the customer, acknowledge the the customer, acknowledge the customer's disappointment customer's disappointment , and that's the , and that's the tone barrier handler that we're tone barrier handler that we're creating. This is the second creating. This is the second creating. This is the second type of Sterling agent type of Sterling agent type of Sterling agent we have created. Now in we have created. Now in we have created. Now in our final our final our final code, in addition to the code, in addition to the code, in addition to the agent skills, we simply agent skills, we simply agent skills, we simply call these two call these two call these two different handlers that different handlers that different handlers that we set up. And these we set up. And these we set up. And these handlers can be handlers can be handlers can be installed at different installed at different installed at different points. We can points. We can points. We can say "after say "after say "after the model" if we want the model" if we want the model" if we want and specify what to do in and specify what to do in and specify what to do in that case, but that case, but that case, but here we can also here we can also here we can also say that we can say that we can say that we can do sterling data.get.

  37. do sterling data.get. We can create a We can create a registry for it and registry for it and registry for it and choose to activate them choose to activate them choose to activate them in any part of the in any part of the in any part of the flow, the agent flow, the agent flow, the agent flow, where we want it to flow, where we want it to flow, where we want it to run. So in run. So in run. So in the end, we the end, we the end, we just need to give just need to give just need to give it access to these it access to these it access to these two two two control handlers. It will be control handlers. It will be control handlers. It will be activated, and when activated, and when activated, and when you run it, you run it, it not only calls the it not only calls the customer search and customer search and customer search and retrieves retrieves retrieves the order history, we also the order history, we also the order history, we also see that it evaluates the see that it evaluates the see that it evaluates the agent's response. So agent's response. So agent's response. So before before before sending the final sending the final sending the final response to the end response to the end response to the end user, you user, you user, you can make sure can make sure can make sure and do so with complete and do so with complete and do so with complete confidence. You confidence. You confidence. You can say with complete can say with complete can say with complete confidence confidence confidence that your model, your that your model, your that your model, your agent, is more likely agent, is more likely agent, is more likely to respond the way to respond the way to respond the way you want it to because we you want it to because we you want it to because we set up all these set up all these set up all these control features. You control features. You control features. You can try it can try it can try it yourself, and then I'll quickly yourself, and then I'll quickly yourself, and then I'll quickly hand it over to Ellie hand it over to Ellie hand it over to Ellie because she's because she's because she's going to talk about going to talk about going to talk about Because we only have 12 Because we only have 12 Because we only have 12 minutes to get minutes to get minutes to get this agent into this agent into this agent into production.

  38. production. production. Well, I was. I would like to Well, I was. I would like to Well, I was. I would like to add add add something to the something to the something to the management part. You know, there's an management part. You know, there's an open source library open source library called agent control that called agent control that called agent control that you can add to the you can add to the you can add to the Sterling agent. This is in Sterling agent. This is in Sterling agent. This is in the documentation. the documentation. the documentation. With agent control, you With agent control, you With agent control, you can create can create can create rules for rules for rules for management. For example, management. For example, management. For example, I have a demo where it's a I have a demo where it's a I have a demo where it's a travel agent, so you travel agent, so you travel agent, so you can can can use hooks use hooks use hooks to block to block to block numbers. For example, numbers. For example, numbers. For example, if someone wants to if someone wants to if someone wants to book a room book a room book a room for more than five for more than five for more than five people, you can people, you can people, you can use a hook to use a hook to use a hook to block the room block the room block the room for companies larger for companies larger for companies larger than five people. But than five people. But than five people. But if you want if you want if you want to direct an agent to direct an agent to direct an agent to block bookings to block bookings to block bookings for more than five people, for more than five people, for more than five people, you can create you can create you can create rules. So, whenever the rules. So, whenever the rules. So, whenever the agent agent agent receives a request receives a request receives a request for more than five rooms, for more than five rooms, for more than five rooms, he will say, "If he will say, "If he will say, "If the request is for six, I the request is for six, I the request is for six, I can direct can direct can direct the booking to two the booking to two the booking to two rooms." So you rooms." So you rooms." So you create rules for that create rules for that create rules for that in the in the in the agent core control library, agent core control library, agent core control library, and you can and you can and you can put those put those put those rules in the database.

  39. rules in the database. This way, you This way, you can create a can create a can create a database for all your database for all your agent management rules. So every time agent management rules. So every time you run this you run this you run this agent application, you agent application, you agent application, you can go to the can go to the can go to the database and database and database and look at the rules. look at the rules. look at the rules. So what is the So what is the So what is the advantage of this? You advantage of this? You advantage of this? You only need only need only need to change the rules in the to change the rules in the to change the rules in the database. You don't database. You don't database. You don't need to change the need to change the need to change the agent code itself. agent code itself. agent code itself. The agent only needs The agent only needs The agent only needs to know the endpoint of to know the endpoint of to know the endpoint of your database. So your database. So your database. So every time you have a every time you have a every time you have a new new new rule, you can rule, you can rule, you can edit the edit the edit the database, and that's it. Now database, and that's it. Now database, and that's it. Now let's put let's put let's put this agent into this agent into this agent into operation. Here operation. Here operation. Here we have a session manager, we have a session manager, we have a session manager, but I'll show you that a but I'll show you that a but I'll show you that a session manager is session manager is session manager is needed when you needed when you needed when you want to preserve want to preserve want to preserve memory using memory using memory using a framework. But you a framework. But you a framework. But you can do this can do this can do this using the using the using the agent's core memory agent's core memory agent's core memory without a framework. And all of without a framework. And all of without a framework. And all of this is already in the code. But this is already in the code. But this is already in the code. But here, in the deployment file here, in the deployment file here, in the deployment file , we will not , we will not use Jupiter use Jupiter notebook, although it can be notebook, although it can be notebook, although it can be done through it, done through it, done through it, we will use the CLI, we will use the CLI, we will use the CLI, that is, the terminal.

  40. that is, the terminal. So, here in this folder, So, here in this folder, this is the same folder, this is the same folder, this is the same folder, we have the same agent. we have the same agent. We have the customer service tools, we have customer service tools, we have the skills, we have everything we the skills, we have everything we the skills, we have everything we need here. So, need here. So, need here. So, to launch this to launch this to launch this agent, you agent, you agent, you need to go to need to go to need to go to Virtual Studio. Here's what we're Virtual Studio. Here's what we're Virtual Studio. Here's what we're going to do. going to do. going to do. We are going to We are going to We are going to use the AWS CLI use the AWS CLI use the AWS CLI through the terminal. We will through the terminal. We will through the terminal. We will use one use one use one or two commands in the CLI. or two commands in the CLI. We'll take this We'll take this agent, push agent, push agent, push its code to the its code to the its code to the AWS runtime, and the AWS runtime, and the AWS runtime, and the agent core will deploy that agent core will deploy that agent core will deploy that code into a container. But code into a container. But code into a container. But we won't do we won't do we won't do this manually, this manually, this manually, because the agent core will because the agent core will because the agent core will do it for us. And do it for us. And do it for us. And after that we will have after that we will have after that we will have memory, even memory, even memory, even without doing anything. without doing anything. without doing anything. So, let's take a look. So, let's take a look. So, let's take a look. Let's go Let's go Let's go through the steps. This is, uh, through the steps. This is, uh, through the steps. This is, uh, something important. When you something important. When you something important. When you create an agent create an agent create an agent application and want to application and want to application and want to deploy that code to the deploy that code to the Agent Core runtime, the only Agent Core runtime, the only difference you difference you difference you need to make to need to make to need to make to your agent is to your agent is to your agent is to add this decorator, the add this decorator, the add this decorator, the APP entry point. So, the APP entry point. So, the APP entry point. So, the APP entry point is the APP entry point is the APP entry point is the only difference only difference only difference between your between your between your agent's work in your agent's work in your agent's work in your notebook or on your notebook or on your notebook or on your computer and his computer and his computer and his work in " work in " production." Because the production." Because the production." Because the APP entry point is what the APP entry point is what the runtime sees and runtime sees and says, "Oh, everything after the says, "Oh, everything after the says, "Oh, everything after the APP entry point is the APP entry point is the APP entry point is the agent." So every time

  41. agent." So every time agent." So every time you call this you call this you call this runtime runtime , this container, it will , this container, it will , this container, it will run the code that run the code that run the code that is behind the is behind the is behind the APP entry point. APP entry point. OK. Let's try this. So, I'll move on here. So, I'll move on here. Sorry. Let Sorry. Let Sorry. Let me open this. This is me open this. This is me open this. This is the library I the library I the library I need to need to need to run all my run all my run all my ACL code. And let ACL code. And let ACL code. And let me switch. me switch. me switch. I hope I have I hope I have I hope I have good internet. good internet. good internet. It's starting. Yes. It's starting. Yes. It's starting. Yes. So, in this So, in this So, in this environment, you will environment, you will environment, you will be able to deploy the be able to deploy the be able to deploy the agent and everything else. agent and everything else. But if you But if you run this run this run this locally, you will be able to locally, you will be able to locally, you will be able to test the agent test the agent test the agent before before before deploying it to AWS. deploying it to AWS. And one more thing you need to And one more thing you need to do to have do to have do to have built-in built-in built-in observability observability is some actions in the is some actions in the is some actions in the console. Let console. Let console. Let me show you this. me show you this. So, to go to So, to go to the console, open this the console, open this the console, open this panel, AWS console. It will panel, AWS console. It will panel, AWS console. It will open the console open the console open the console running in this session, in running in this session, in running in this session, in this this this account of yours.

  42. account of yours. You need to go You need to go to Am core. Look to Am core. Look to Am core. Look here. Am core, that's where Am core is. here. Am core, that's where Am core is. here. Am core, that's where Am core is. You can see You can see You can see all the services that Am all the services that Am all the services that Am core has because you can core has because you can core has because you can create a binding create a binding create a binding with a few with a few with a few lines of code. The runtime gateway lines of code. The runtime gateway , memory, and , memory, and observability are right observability are right here. But you here. But you here. But you need to need to need to choose something. I don't remember what choose something. I don't remember what it's called. I'll it's called. I'll it's called. I'll show you now. show you now. show you now. Let me take a look here. Let me take a look here. Let me take a look here. Here. Turn on...Oh, no, Here. Turn on...Oh, no, Here. Turn on...Oh, no, that's not it. Here. that's not it. Here. that's not it. Here. Configure. So, Configure. So, Configure. So, you need to go you need to go you need to go to "Configure". And to "Configure". And to "Configure". And here you need to here you need to here you need to enable enable enable transaction search. This transaction search. This transaction search. This feature allows you feature allows you feature allows you to get built-in to get built-in to get built-in observability in the observability in the observability in the runtime environment runtime environment . If you don't . If you don't . If you don't do this, you won't do this, you won't do this, you won't see see see the observability in the observability in the observability in your agent your agent your agent because CloudWatch won't because CloudWatch won't because CloudWatch won't receive receive receive the information. And one more the information. And one more the information. And one more thing to thing to thing to do—let do—let do—let me save this—is me save this—is to install by adding to install by adding to install by adding to the requirements the observability library to the requirements the observability library that I have in the that I have in the requirements file. So, for that, I requirements file. So, for that, I requirements file. So, for that, I apologize. Oh, done.

  43. apologize. Oh, done. apologize. Oh, done. So we have the So we have the So we have the Stratus Am requirements because I'm Stratus Am requirements because I'm Stratus Am requirements because I'm going to going to going to use the use the use the Betr Am core. And you need this Betr Am core. And you need this Betr Am core. And you need this . AWS . AWS . AWS OpenTelemetry distribution. So if you're OpenTelemetry distribution. So if you're OpenTelemetry distribution. So if you're using a different using a different using a different framework, like framework, like framework, like LangChain or CrewAI, there's a LangChain or CrewAI, there's a LangChain or CrewAI, there's a unique library unique library unique library for that uh for that for that uh for that for that uh for that framework. But you framework. But you framework. But you need to make need to make need to make some changes to your some changes to your some changes to your agent program. For agent program. For agent program. For Stratus, you don't Stratus, you don't Stratus, you don't need to do anything need to do anything need to do anything because Stratus because Stratus because Stratus is built for AWS, so is built for AWS, so is built for AWS, so everything is built-in. But everything is built-in. But everything is built-in. But observability observability observability works for other works for other works for other frameworks as well, but frameworks as well, but frameworks as well, but you need to make you need to make you need to make some changes. It's all in some changes. It's all in some changes. It's all in the documentation, so you the documentation, so you the documentation, so you can see it. can see it. can see it. So, we have a So, we have a So, we have a library. library. Let's move on to So, I'm Let's move on to So, I'm here. So, A in court, here. So, A in court, here. So, A in court, right? A. So I'm going to right? A. So I'm going to right? A. So I'm going to create No, but that's create No, but that's create No, but that's okay. I I didn't okay. I I didn't okay. I I didn't save it. save it. save it. Good. Good. So, I'll call it So, I'll call it early because I'm in a hurry.

  44. early because I'm in a hurry. And I won't And I won't create a binding here. create a binding here. create a binding here. I want to create an I want to create an I want to create an agent, but I have my agent, but I have my agent, but I have my own code. You know, if own code. You know, if own code. You know, if you choose an agent, you choose an agent, you choose an agent, it will create a it will create a it will create a simple agent for you, but simple agent for you, but simple agent for you, but I have the code, so I I have the code, so I I have the code, so I can skip that. And can skip that. And can skip that. And it will create it will create it will create the environment, everything the environment, everything the environment, everything needed to needed to needed to put this put this put this agent that I agent that I agent that I already have, into this container already have, into this container . So, it will create a . So, it will create a . So, it will create a folder for me here. This is folder for me here. This is folder for me here. This is my folder. A in court, everything. my folder. A in court, everything. my folder. A in court, everything. So, you can do all these So, you can do all these So, you can do all these steps here in the workshop. Oh my steps here in the workshop. Oh my steps here in the workshop. Oh my god, 4 minutes, but god, 4 minutes, but god, 4 minutes, but I'll make it. I'll make it. I'll make it. I'll get these agents I'll get these agents I'll get these agents into production in 5 minutes. into production in 5 minutes. into production in 5 minutes. That's all it takes, That's all it takes, That's all it takes, right? 5 minutes. right? 5 minutes. right? 5 minutes. Yes. So, A in court at, to Yes. So, A in court at, to Yes. So, A in court at, to add my A in, and where is add my A in, and where is add my A in, and where is it here. Well, it it here. Well, it it here. Well, it takes a little time. takes a little time. When I press A in at, When I press A in at, it will create it will create it will create the container that I the container that I the container that I need, but I already have this A in need, but I already have this A in need, but I already have this A in on my on my on my computer because I want to computer because I want to computer because I want to show you something. show you something.

  45. The same A in that The same A in that Sandy just showed Sandy just showed Sandy just showed you, this client A you, this client A you, this client A in, I have I have I have a in, I have I have I have a in, I have I have I have a repository here on repository here on repository here on my computer. my computer. my computer. So let me So let me So let me zoom in on this. It's the zoom in on this. It's the zoom in on this. It's the same A in, the same one in the same A in, the same one in the same A in, the same one in the file, yes. You can file, yes. You can file, yes. You can use the A in use the A in use the A in court dev agent court dev to court dev agent court dev to court dev agent court dev to test A in test A in test A in locally. So, you locally. So, you locally. So, you can do it. You can do it. You can do it. You can do this in can do this in can do this in virtual studio virtual studio virtual studio because virtual in is a because virtual in is a because virtual in is a virtual machine virtual machine virtual machine that allows you that allows you that allows you to run code only in to run code only in to run code only in this VS code. But if this VS code. But if this VS code. But if you run this you run this you run this locally on your locally on your locally on your computer, you can computer, you can computer, you can have this environment have this environment have this environment for testing the for testing the for testing the agent. So this is the agent. So this is the agent. So this is the same agent, and you same agent, and you same agent, and you can see I have a can see I have a can see I have a few sessions here as well. few sessions here as well. few sessions here as well. You can see You can see You can see the number of tokens, the number of tokens, the number of tokens, if you want if you want if you want to know what is to know what is to know what is happening happening happening inside your inside your inside your agent, you can agent, you can agent, you can do it locally. do it locally. do it locally. But since I'm But since I'm But since I'm using Amazon Bedrock using Amazon Bedrock using Amazon Bedrock as my as my as my model provider, I'm model provider, I'm model provider, I'm using my using my using my AWS credentials. And AWS credentials. And AWS credentials. And to use to use to use Amazon Bedrock agent core, you Amazon Bedrock agent core, you Amazon Bedrock agent core, you need need need AWS credentials. If you AWS credentials. If you AWS credentials. If you are running this are running this are running this locally but locally but locally but within an Amazon within an Amazon within an Amazon Bedrock agent workshop, you don't Bedrock agent workshop, you don't Bedrock agent workshop, you don't need this. So, yes, it need this. So, yes, it need this. So, yes, it works. Yes, it's the works. Yes, it's the works. Yes, it's the same, exactly the same same, exactly the same same, exactly the same agent. I didn't agent. I didn't agent. I didn't do anything. So, do anything. So, do anything. So, back to, yes, back to, yes, back to, yes, I have everything.

  46. I have everything. Yes. Yes. So I, I did it. I don't So I, I did it. I don't So I, I did it. I don't remember if I remember if I remember if I did it. So, CD. LS. So did it. So, CD. LS. So did it. So, CD. LS. So I want to add my I want to add my I want to add my code to this code to this code to this agent application. Let me agent application. Let me agent application. Let me see. see. see. Inside this Inside this Inside this container. So, agent container. So, agent container. So, agent core, what I want, I want an core, what I want, I want an core, what I want, I want an agent. I want to agent. I want to agent. I want to click "add click "add click "add custom code". That's custom code". That's custom code". That's all. That's all. And you all. That's all. And you all. That's all. And you can can can use use use direct direct direct code deployment or a container. I code deployment or a container. I code deployment or a container. I want to use want to use want to use this. And you can provide this. And you can provide this. And you can provide your own API key to your own API key to your own API key to deploy this deploy this deploy this agent agent agent using Anthropic, using Anthropic, using Anthropic, OpenAI, or whatever. OpenAI, or whatever. OpenAI, or whatever. But I want to But I want to But I want to use Amazon use Amazon use Amazon Bedrock. I won't do anything here Bedrock. I won't do anything here Bedrock. I won't do anything here . Introduction. . Introduction. . Introduction. Introduction. That's all. Now Introduction. That's all. Now Introduction. That's all. Now I want to migrate my I want to migrate my I want to migrate my code. And to transfer code. And to transfer code. And to transfer my code, I have to my code, I have to my code, I have to copy and copy and copy and paste it here. And paste it here. And paste it here. And okay, what else? Ah, I okay, what else? Ah, I okay, what else? Ah, I need to create this.

  47. need to create this. need to create this. So, let's see. So, let's see. So, let's see. Copy and Copy and Copy and paste. 1 minute. paste. 1 minute. Wait. And I, I won't do that Wait. And I, I won't do that . . . So, agent core deploy. And 1 So, agent core deploy. And 1 So, agent core deploy. And 1 minute to minute to minute to deploy? 1 deploy? 1 deploy? 1 minute to minute to minute to migrate this agent to a migrate this agent to a migrate this agent to a production production production AWS environment. So, AWS environment. So, AWS environment. So, it works. It it works. It it works. It will perform the check. will perform the check. will perform the check. It will verify my It will verify my It will verify my credentials. So, credentials. So, credentials. So, if you're familiar with AWS, if you're familiar with AWS, if you're familiar with AWS, when you build everything when you build everything when you build everything inside AWS, you inside AWS, you inside AWS, you need to create IAM, need to create IAM, need to create IAM, you need to you need to you need to create policies, create policies, create policies, permissions. You need to permissions. You need to permissions. You need to allow the service allow the service allow the service to connect to to connect to to connect to another service. You another service. You another service. You need to do need to do need to do a lot of things a lot of things a lot of things inside. Agent core takes care of inside. Agent core takes care of inside. Agent core takes care of all this. So, all this. So, all this. So, you don't need, I you don't need, I you don't need, I don't need to don't need to don't need to create policy. create policy. create policy. I don't need to I don't need to I don't need to create permissions. create permissions. create permissions. I don't need to I don't need to I don't need to create anything. create anything. create anything. So, he does everything So, he does everything So, he does everything for me. And you can for me. And you can for me. And you can see that, ah, and see that, ah, and see that, ah, and because I created this because I created this because I created this locally, it locally, it locally, it creates a cloud formation. This is creates a cloud formation. This is creates a cloud formation. This is infrastructure as infrastructure as infrastructure as code using code using code using CDK. So, you can CDK. So, you can CDK. So, you can explore the CDK code. If explore the CDK code. If explore the CDK code. If you are not familiar with CDK, it is you are not familiar with CDK, it is you are not familiar with CDK, it is Cloud Development Kit. You Cloud Development Kit. You Cloud Development Kit. You can create can create can create infrastructure as infrastructure as infrastructure as code in a programming language you code in a programming language you know. For example, know. For example, Python, TypeScript or any Python, TypeScript or any other. So, he other. So, he other. So, he does it for me.

  48. does it for me. does it for me. He creates everything. He creates everything. He creates everything. Creates deployments Creates deployments Creates deployments and everything else. You can and everything else. You can and everything else. You can see this in the console see this in the console . So, let's move on to the . So, let's move on to the Amazon Bedrock runtime. So? I ca Amazon Bedrock runtime. So? I ca n't see anything. Ah, it n't see anything. Ah, it n't see anything. Ah, it creates...Let me creates...Let me creates...Let me show you CloudFormation. Here show you CloudFormation. Here show you CloudFormation. Here I will see my stack. Oh, I will see my stack. Oh, I will see my stack. Oh, no, because this is a no, because this is a no, because this is a Virtual Studio account. Virtual Studio account. Virtual Studio account. Sorry, you can Sorry, you can Sorry, you can see it here. But see it here. But see it here. But when it starts when it starts when it starts working in the working in the working in the runtime runtime , I'll see it here. I , I'll see it here. I , I'll see it here. I said, "That's it." said, "That's it." said, "That's it." So, he is here. You So, he is here. You So, he is here. You can check if can check if can check if the agent is ready, okay? the agent is ready, okay? the agent is ready, okay? I can I can I can test the agent right away. test the agent right away. test the agent right away. So, I can So, I can So, I can call this call this call this agent here. And it's very agent here. And it's very agent here. And it's very convenient, all through the convenient, all through the convenient, all through the terminal. In terminal. In terminal. In the repository you the repository you the repository you will find how will find how will find how to invoke this to invoke this to invoke this agent using agent using agent using boto3. All you boto3. All you boto3. All you need is an ARN, and this need is an ARN, and this need is an ARN, and this agent works. Okay, agent works. Okay, agent works. Okay, I think it works.

  49. I think it works. I think it works. I hope so. I hope so. I hope so. That's right. This is a working That's right. This is a working That's right. This is a working agent. agent. agent. So, here you will find So, here you will find So, here you will find how to call the agent how to call the agent how to call the agent using the SDK. Hey using the SDK. Hey using the SDK. Hey Siri, give me Siri, give me Siri, give me an answer. You can't an answer. You can't an answer. You can't . . . It really worked. It really worked. It really worked. I wonder if there's anything else I can I wonder if there's anything else I can I wonder if there's anything else I can help with? help with? help with? You can call You can call You can call the agent using the agent using the agent using the SDK and explore how to the SDK and explore how to the SDK and explore how to do it. To see do it. To see do it. To see monitoring data, monitoring data, monitoring data, go to the go to the go to the runtime environment runtime environment . Here you have an . Here you have an observation dashboard. You observation dashboard. You can see can see can see the session, trace, the session, trace, the session, trace, number of runs and number of runs and number of runs and sessions. Each session sessions. Each session is a is a is a runtime environment, a separate runtime environment, a separate runtime environment, a separate container. This takes container. This takes container. This takes some time. Yes, it some time. Yes, it some time. Yes, it takes about 1-2 takes about 1-2 takes about 1-2 minutes for everything to minutes for everything to minutes for everything to appear. What? OK. appear. What? OK. appear. What? OK. What? Yes, yes, yes. I'm What? Yes, yes, yes. I'm What? Yes, yes, yes. I'm done. That's all. done. That's all. done. That's all. Wait. Please Wait. Please Wait. Please take a photo of this. And take a photo of this. And take a photo of this. And share it with your share it with your share it with your friends. Here you friends. Here you friends. Here you will find all the will find all the will find all the information. Everything is here.

  50. information. Everything is here. Presentation, workshop, Presentation, workshop, some credits. If some credits. If some credits. If I'm lucky, because I have I'm lucky, because I have I'm lucky, because I have about 20 AWS credits. about 20 AWS credits. about 20 AWS credits. And reviews, please, And reviews, please, And reviews, please, five stars. We are five stars. We are five stars. We are incredible on the incredible on the incredible on the internet. No, but it's internet. No, but it's internet. No, but it's not a mistake. And all not a mistake. And all not a mistake. And all social networks. And social networks. And social networks. And if you have any if you have any if you have any questions, we are on LinkedIn questions, we are on LinkedIn , Twitter, Instagram. , Twitter, Instagram. , Twitter, Instagram. Please, the QR code has everything Please, the QR code has everything Please, the QR code has everything you need to you need to you need to learn more about learn more about learn more about Estrands and AN Corp. Estrands and AN Corp. Estrands and AN Corp. Thank you.

No summary available yet.

View original episode ↗