Enjoying this issue?
Get tomorrow's AI & engineering digest in your inbox — hand-picked, summarized, and always spam-free.
TLDR
Strands Agents, an open-source agent harness from AWS, lets you build and deploy custom agents with any LLM, and Amazon Bedrock Agent Core handles production deployment with built-in memory, observability, and scaling. The workshop demonstrates a customer service agent with tools, hooks for rate limiting, skills for domain knowledge, and steering for output control, all deployable via a single CLI command. For developers building agents on AWS, this is a practical end-to-end workflow that removes much of the infrastructure burden.
Key points
Strands Agents is an open-source agent harness that supports any LLM provider and the MCP and A2A protocols.
Hooks allow deterministic control over the agent loop, such as rate limiting tool calls before they execute.
Skills are markdown files that provide domain-specific context to the agent without bloating the system prompt.
Steering uses a buddy agent to enforce output format and tone rules, acting as a guardrail.
Amazon Bedrock Agent Core deploys agents into a managed runtime with built-in memory, observability, and automatic scaling.
Tools mentioned
Techniques
- Agentic reasoning loop with tool calling
- Hooks for pre- and post-invocation control
- Skills as markdown-based knowledge injection
- Steering with a buddy agent for output enforcement
- Rate limiting via hooks
Stop scrolling. Start reading smarter.
Receive the day's most important AI & engineering updates in one concise email. No spam.
Transcript (captions)
Uh my name is Sandy and this is Elizabeth. Um and we have Mike and we have more people helping us today in case any of you have questions with um setting up your workshop environments
and running. And everyone here is an expert. everyone helping us. We're very excited to get started today. We want to get all of you on board right from ideating an agent, building it, adding a
lot of customization and then deploying it. So we want to start with the simplest form of an agent. Um, and we for this we're using Strand's agents, which is an open- source agentic
harness. And this was actually built by AWS. Uh, but this is fully open source. And so let's walk quickly through it. I'm going to give you a quick introduction on what we're going to be
doing and then we can dive straight into the code and all of you will have code that you can run, take home with you and you can run for two days after this, right? So let's get started.
What is trans agents? Strands agents is an open-source agent harness which means you can you bring your own LLM. You can use any LLM provider model provider and you can build an agent harness around it
and you can control it end to end. You can customize it. You can add your own tools to it. There's this is fully open source. So there's community supporting this on GitHub and AWS maintains this
and it supports MCP protocol. It supports A2A. It's fully open and flexible and you can deploy it on any managed service. You can do it locally. You can host it anywhere. Um now like I
said you can use it with any model. It works natively with uh in production with AWS but you can bring any model you want and you can run it. uh it's also got guard rails and observability built
in. Uh now if when now when I say you can run it on uh a um Amazon bedrock you can with agent core you can also use any of the other services but you can also use a different provider you can also
use your own homegrown uh hosted model if you want Ellie. Yes. Uh let's and because in this workshop you are going to put this agent that we are going to build in production. We are going to use
agent core and agent core is a service. Amazon metro aent core is a service dedicated only to put agents in production. So inside aent core we have a core runtime. that is the runtime the
container where you are going to put this agent and doesn't matter if it's trans the framework if the launch chain if the crew AI doesn't matter the framework that you're using you can put
this aentic application inside the runtime the container and you are going to deploy this engine in one single life on the CLI and when you are using runtime this runtime have sessions and
the session can run up to 15 minutes up to 8 hours. So you can have a session built in inside this container without any uh configuration because it's inside there and you have observability built
into so you only have the code you uh install this code or put this code inside this container and you are going to have memory and observability and when I say observability is not
observability about the RAM or what is the behavior for this container. container is about agentic observability. How how many tokens I spending in this application? What is
what did what tool is using this agent? What happened inside my agent loop? You are going to able to see all of that inside the agent core observability inside cloudatch in AWS and we have a
core gateway. So sometimes we are having a lot of tools a lot of MCP for our aentic application. So you can put all these tool of this MCP behind a aent core gateway and a core is going to be
is going to deliver like a API or API is not the word like a endpoint that you can invoke inside your agent loop and this endpoint is going to be able to do like a semantic search for all your
tools for all your MCP. So only one endpoint for all your NCP for all your tools and it have semantic search. So it help you to uh deliver the best tool for your agent loop and we have agent core
memory because when we create a agent we have shortened memory. The short-term memory is built in the runtime. You already know that. But what happened when you want a a long-term memory, you
know, a memory that can last more than eight hours. So you can create a a core memory. So when you uh create a core memory, you are going to have a semantic memory too. So agent core build for you
in three different types of memory. So you are going to have like I don't remember the name of the memory but you have three different prompts capable to build the three different memories. So
every time that you retrieve your agent loop you can retrieve this memory inside the agent called memory that is completely built in. You don't have to build the vector store the database. You
don't have to build anything. You only have to say hey a core I want a core memory. So it's deploy for you the memory the three different types of memory custom tree memory and no
building memory and you can create your own custom memory. You you can you put your custom prompt to build your own memory. So every time that you retrieve the information for this agent, you are
going to have your custom memory and there is a core identity and a bunch of more agent core but we only have one hour and in this workshop you are going to deploy your agent in agent core
runtime and I already say that and yeah so agent core runtime have uh give you all the that you can put your code and deploy to production. You have the enterprise grade security of course
because it's running on AWS. So it's completely secure of course if you are doing a good deployment if you don't share your keys everything because it's inside AWS and we don't use your data to
train models is in your account and it's only using there and scale automatically. So you have your container and you don't have to manage the scaling because runtime can scale
automatically up if you have a lot of session if you have recession is scale down. Thank you. So today um this is what we're going to be doing. We're going to
be starting with a basic agent. What is an agent loop? Um how can we build um an actual system with it? um and some ideas, deeper dive ideas about what actually makes a good agent, right? So,
talk about hooks, talk about skills, steerings, and then Ellie's going to be talking about um session management, and she's going to be covering how to actually deploy to agent core. We also
have evalentic frameworks as part of the workshop. If we have time, we will do it. But because we want to take it slow, we want to take it easy. We want to make sure everyone
understands the basics before we get into the advanced concepts. But if we don't have time, you can still use this link. This is still valid for two more days. So you can still use it. Go back
home, run it, complete all of the modules, and ask us ask any of us questions if you have any and we'll be there to support you. So uh first thing is uh go to this workshop link if uh we
have so this is enabled for about 250 participants. If we have more and some of you run into problems we have a backup workshop link but for now uh log this website and it should take you to a
link. Uh Ellie can also walk excuse me walk you through the steps if necessary. Um so this is going to take you to an account. Does uh everyone have the previous link? Do you want me to wait a
couple of seconds? >> It's on there. It's on there. >> I think it's also there on the next few slides. I think uh so what what are we going to be doing today? We're going to
go to this workshop studio account. Uh you don't have to so you don't have to create your own AWS account. Uh these accounts are already created for you and there is going to be like a Jupyter
notebook format. Uh most of the code is already in there. We can customize it. You can run it. You can download it. You can run it in your own environments but for this uh session it's all there for
you. So you can directly use and run it from there. Uh this is free of charge. You will not be using any of your accounts. It's not going to ask for any credit card. So just go walk with us and
do it step by step. If you have any questions all of us are here to support you. Um so like I said first thing join this workshop link. So when you go to this link you are this
link is going to uh give you a website. The first thing that you need to do is put your email email one time passport OTP. So then it's going to send you a email with uh I don't remember how many
numbers is that yeah you need to enter your email and then you are going to receive the one time passport and you need to put that password inside the the window as similar to that
>> and if any of you have questions please raise your hand and one of us will come find you we'll work with you >> and in this workshop when you start to either uh you are going to be able to
use anthropic models through the Amazon bedroom API and I think I'm not sure I'm think that you are going to be able to use the new open AI models too and of score all the Amazon models that we have
that you can invoke through Amazon API and uh you are be able to use a Amazon better agent core for free it's not so expensive okay I I know that and I know that people is having problems sometimes
to use the new service because yeah it's normal to have I don't know uh it's money but if you try Amazon B aent cord in your account you are going to see that it's not so expensive
and then you need to approve the next the next window is >> is everyone with us right now anyone struggling at any step so far you do you
need help Sorry. Do you are you having trouble signing in? Um, so you're you've opened that workshop link and then did you type in your email address and your password?
>> Okay, I think Mike can help. >> You are okay. I need to see >> everyone else. Okay. Any other >> problems? Is anyone struggling with anything? We might be having a little
trouble with wifi. Who would have thought that a conference would have trouble with wifi? A lot of people are getting on. Are you going to be stepping through some of the things on stage
there? >> Um what >> you going to are you going to run through the workshop stages on on stage? So if people can't do it, can they watch
>> at the end of the session? Uh we are going to share with you all the slides. This is a Jupiter. This is a repository that you can clone too. you know this this uh this code everything that we are
going to build here is not only available in the virtual studio. So because this virtual studio is going to be open for two days so probably it's better that we start to show what is
inside and you can do this >> uh for your you know for your business >> and you can do it and you know I can I then when we finish the session I going to put this workshop for three days. So,
so you can be you can use all these for free for 3 days. >> Yeah. And may the Wi-Fi gods be with us as well today while we run it through with you.
>> Oh yeah. >> Um so if it's just network issues because of which some of you are not able to follow along, we will try to go step by step again hopefully with the
Wi-Fi is working for us and um any other issues apart from network issues with signing up, signing in, anything at all. >> Yeah. >> Right. So before to start please take a
picture to this. Yes. Because if you have problem with the first one you know it's not a problem of internet. If you are having problem hey there is not enough account is because the first one
is running for account. So you can use the second one. >> So we have to uh separate environments deployment. >> Yeah.
>> So let's get started. Okay. So, all of you should be seeing this right now, correct? >> No, that's not >> this, right? All of you should be seeing
this. This is going to be on the left is going to be your stepbystep work um your work through on what what we're going to be building, how we're going to be building it. the setup each
of the modules. So this is for you to follow along if you're ever stuck how to actually start running this. Right? So this gives you a full walkthrough. But if you want to get started with the
code, click on this over here, the agent speedrun idea to code, right? Click on that. Scroll all the way down and you will see the code editor URL. Everyone with me? Click that URL.
>> The people who is having internet. Yes, everyone who's got internet click like click on this button over here. Scroll all the way to the bottom to the code editor URL and then open that and this
should pop up module one for you. So this is module one and you can close all of this. The first thing you will have to do is select your kernel, right? And which kernel do I select? go to the same
workshop studio here under setup when you get started and you go to your next steps it's going to actually show you here right so select kernel python environments USR bin python 3.13
copy that and in your select kernel paste that over here and it should close it and pick it up for you okay so you You need to do this for every module that you're running. Now,
what are we building today? Is everyone with me? Is anyone not with me? Oh, a bunch of you because of Wi-Fi. Is there any other >> just Wi-Fi?
>> What do we do? Do we Okay, we're just >> Yes. Yeah. Thank you. So, if that's the case, then we're going to start walking through step by step. It's fairly simple and you can definitely go back and try
it. Okay. So I'm just going to go with it and feel free to ask us any questions. So what are we building today? Today we're building a customer service agent and we're building that
using Strand's agent which is an agent harness framework and how that works is it's basically using an agent with the loop. So the user sends in their input and their context and then you have an
LLM which you can provide right because uh this is works natively with Amazon. We have a bedrock hosted model but you can have so if you go to strands agents over here this is the strand agents and
you can and you look at model providers you can use any of your favorite model providers you can use your llama and if you want to host it locally and this shows you how to do it all you have to
do is call the model here define the model and then under agent you just have to specify model and your model name you can do this with open AAI this supports all of your different LLMs your favorite
LLM times use what you will um hugging face all of your favorite things right so use your favorite uh model bring your own uh API key and then connect it to the model and then we we are ready to
get started so we are building um a simple customer service agent and what how what makes the agent powerful is the agentic reasoning loop which means when you give it when the user asks a
question and says hey I have this trouble, I have this problem. The agent receives that input. The agent gets invoked. The agent calls the LLM and the LLM then reads the question and calls a
tool. So we want to define a set of tools because tools are the way by which we give an agent agency to execute a function because LLMs are mostly just going to be predicting the next token.
We don't want to really rely on the LLM's base knowledge of what the answer is. You want to ground it to a source of truth, to a source of information. And this information can be stored in your
database. This can be stored as a file. This can be stored in any different format. And that can be written inside of a tool. And that tool can be given access. The agent can be given access to
that tool. And the agent decides when to use that tool. And the agent can have access to a bunch of different tools. And the agent will figure out, it will rely on the LLM, the LLM's capability,
the LLM's reasoning capability to figure out what to which tool to use and call the tool, run the tools response and potentially again, you know, the agent loop can get completed and then it would
send a response. Now, another amazing thing about using an agent harness is because you can support a bunch of different models, you can swap out whichever model you want without really
having to change the system prompt. You can if you want to, but you don't really have to change the system prompt or change the structure or the architecture of how everything works. This is it. And
then you can try out with any model you want and then it still works. It's still good to go. So you can even compare your models different models performances against the same uh boilerplate code. So
it's super powerful and then you get a response. Right. So how can we get started with this? Uh first thing is so uh in your module one we've got um we install the requirements.ext
file. Then we define tools. Is this big enough for everyone to see? Do I need to zoom it in further? Okay, good. I'm seeing thumbs up. So what are we doing here? because we're doing customer
service bots. First thing is we need to have data. So we've create mock data of two customers and their account orders. So they've ordered something off of a website and then they want questions.
They want to get refunds on whatever they've ordered. So how are they going about this and how can we build an agentic system that can offer solutions to these customers? So they have these
orders. Uh it's just like a dictionary. Okay, so these are the customers and these are the order statuses and we define tools. Tools can be written it can be uh it can be a functional code
but it can also be uh like an NLP type of a tool that you can have generated. The way to define a tool is by using the at tool decorator function and you write a code. So here we've got a simple tool
that's doing a lookup on customers. That's just doing a get customer ID. Then we've got another tool that's just doing get order history. The third tool we've got is process refund. Right? So
in each of these cases, the tools can look very very different, but they're all the same format, all the same pattern. They all just have the add tool decorator. So let let's run this.
And after that, what we do, and this is our initial code for creating tools. Now what we do to create an agent, we just need two basic things. One is your system prompt. The second is your LLM,
your model. In this case, because we're using native uh bedrock models, hosted models, we don't really need to specify the model. We're just using the default model. But like I showed you in the on
the strands website, you can establish whichever model you want and you can add your model here. The third thing you want to add apart from this is your tools. So you will call the agent
method. Write the tool three tools that we've just defined and then create the system prompt which says you are a customer service agent. Um and these are your guidelines. Always verify customer
using look up customer before taking action. Use tool data to answer questions. Don't ask the customer for info you already have. So in the system prompt you tell the agent like you tell
the LLM how to use the tools that it's got access to and what to do with it. So that's how your LLM and your agent understands what needs to be done with it. So here now when we run this agent
we just say hi I'm customer so and so can you check my recent orders and so now it's saying sure let me pull up um your account and the order history. So it's invoking tool one. It's doing the
look up on customer. Then it's calling tool two which is get order history and it's saying ah okay this is a summary of your recent orders. And then it's saying hey is there anything else I can help
you with? Now this is awesome but how can we figure out what's actually happening under the hood? Because a lot of times one of the problems we have is my agent is doing things and I have no
insight into what it's doing. Where is my control? How do I get that? Right? So let's inspect that agent loop. So what we So this is how it works, right? And as we saw in the previous diagram, the
user sends in a message, goes to the LLM, the LLM does the tool call, we get a tool result, and finally we get a response. Now we can look at the agent messages agent message. And so this is
just code to see what the messages look like. And so this shows us the handoff. So this says the total number of messages for this is what the user is saying. This is what the assistant does.
Then this is the tool call one tool call two. Then there's nothing else that the user has done. And so the assistant says okay here is the response. So this these are the metrics. These are number of
tokens that it used. We can use more metrics. You can add more metrics. Do what you will. Additionally uh we just want to do something simple here, right? Because it's simple walk through. But
what we can do is we can also have multi-turn conversations. This is just a single conversation. You can also run your multi-turn conversations where you have an extended chat with your agent.
So for that you can also try these right. These are other samples that we've given. You're free to write your own if your internet is working. I hope it is. Is it? Um but also what you can
do is we've created chat.py under the same module and we've got chat.py Pi file for every single one of these modules. So when I click chat.py, this is the exact same underneath
underlying code except we've enabled it for multi-turn conversation. So you do the same thing enable um you just have to so when you go here what you can do is you can open your terminal and you
just have to copy these two lines because we're already in this specific folder and then you pip install your requirements over here and then you open a thing and then you can chat with it
directly if you want to. So then you can say, "Hey, blah, blah, blah." So you can just type, right? Um, and you can have multi-turn conversations with it. It's just going to reply and see there we go.
So you can continue to have multi-turn conversations with it, the exact same co under underlying code, uh, exact same tools, and it's just able to talk to you. 60 lines of code, less than 60
lines of code. Uh, so that's basic agent. Are we good? Okay, cool. Awesome. Second part, how do we make this agent better? What else can we do? This is
this is basic stuff, right? Anyone's who who's been looking at blogs or just checking online would probably know how to do this. How can we make it better? Let me introduce you to what we call
hooks. Now, hooks are amazing because let me first open that. Let me first open that code there. Okay, I'm going to close this. Now hooks are a way by which you can enforce certain
programmatic uh commands and functions to take place. So before so what you can do is in this entire process where your from the time your agent is just getting invoked it's
doing its own tool calls and it's getting responses and sending it out. what you we want to be able to control it, right? Right from the time that the agent is being invoked to the like
before the tool is being called or maybe once the tool is being called and then it gets a response. We want to be able to have a lot of control over it. We want to potentially be able to validate
who the who's using it like who which uh who are the customers that are probably talking to this or what type of questions are they answering? Is it even supposed to be be entertaining these
types of questions? Do we want to have rate limits on the type of tools that are being called and the number of times these tools are being called? How can we do that? So when you have a hook, you
can you can introduce your code at this junction where you can have an assert function or a different type of function that allows it to do to ensure that certain checks go through before it
proceeds to your final output. So you can do it before invocation, you can do it after the LLM call, before the tool call and then you can decide whether you want to approve of it or cancel it. And
then you can even do it after tool execution, before it sends the response. So you can do it at all of these spaces, but you can also do it at more locations. And um this is just an
example. If we go to strands agents, this will show you all the different ways you can enforce hooks. Um so this is this where I am at? No, I keep I'm going to close all of these. Um, okay.
So, uh, in hooks, what are we doing here? We've got the same data that we're calling. Let me run this first. Okay. Go to the notebook.
>> This is not the notebook. >> No. >> Oh, this is a customer service tools. Okay. Um, yeah. Yeah, I'm on the wrong one.
Okay. I'm on the notebook again. We have to install requirements and choose our environment. So how does this work? Now we want to import strands.hooks and we want to
import hook provider hook registry and where we want to call these hooks. So in our case we want to do it before invocation and also before tool call. And I'll tell you what we're doing.
We're trying to create a rate limiter hook which ensures that for one user request the number of tools that are being invoked is not more than three in case you have um an LLM that's just
going crazy and that's continuously invoking your tools that's going to cost you a lot of tokens and you know it's not working right so you want to create a hard stop rate limiter and say hey
even if it's not working it's fine stop it at three right so now that's what we're doing how can we create that rate limiter over here. So first what we do is we define the rate limiter hook and
we want to say okay these are the maximum number of calls we're creating a default number and then we have to add it to the registry. So over here we add it and say okay be before invocation
event and then we want another call back which is before tool call event and a call back means that's when it would get called that's because you're defining it over here. So then we have this counter
which that which at before every response like every new time the user is asking sending in a request this gets reset to zero because you don't want it to continue running that u rate limiter
and we define a second one called check second function called check that checks the number that's basically like a counter it counts the number of times your tools are being invoked so that's
what this does and then This looks at the max calls and then it just calculates that. So we define our rate limiter over here and this is the main function that we've been looking at. One
extra line that we added is the hooks and we say rate limiter hook max calls equals three. And if we run it, it's calling these two and it's saying okay tool call one tool call two. Here's
a summary of your events. This is what's happened. But let's actually test it. Let's try and break it and see if the rate limit is actually working. Right? So here I'm doing max calls equals true.
You want to lower the limit to the trigger. So over here it's calling it so many times, right? And so it's actually blocked it. So here it's saying block lookup because it's
exceeded the number of times. So when your agent starts to go haywire and we all worry about oh my god is my agent going to take over everything, right? It won't because we have something called
hooks. Is everyone with me? Are we good? Is anyone able to run it with me? Am I going too fast or are we just watching us? That works. Oh, okay. Good. We have
at least a few people. >> I I would like to add something to the hooks. >> Sometimes, you know, hook is better because when you're using a LLM with
some tools, the LLM are probabilistic. >> Yeah. You know they when you put a prom inside your agentic application the prom is like a suggestion you know it's only about the probability to give you an
answer. So when you use a hook you can be more deterministic. So you can put code inside your aent loop so you can put code a python code before or after the invocation. So you can stop uh I
don't know in this example you stop a a lot of more than three tools invocation but for example if you want to restrict a I don't know some credit cards number something like that you can put a hook a
code capable to understand some things so yeah hey you can receive this information so I going to block this with this deterministic uh function so you don't receive that so
the model the model never is going to receive that information. So you block the call so you don't waste token. So you don't have to invoke the model again. You don't you don't waste tokens
because you are stopping that. You send a hook. And if you don't want to send some type of answer to your customer service, you can stop that answer with after call hook as well.
>> Exactly. Thank you. Okay. So you can try it out yourself. And again, if you want to do multi-turn conversations, go to chat.py in the second module with hooks enabled. You
can still continue to chat with it. And you can play around, add different hooks at different places, see what works. You can try and block certain customers or block certain types of questions. Thing
guard rails, right? So hooks are amazing and we want to have hooks as we're writing good building good agentic systems. Now, let's add one more layer of coolness to this project, right?
Let's add skills. Let's add skills and let's find a way to steer your agent and your LLM and get them to respond in a fashion that we want it to respond in. And so, steering is I love steering.
Steering is awesome. Um, so let's get to steering. Do I have any questions? Everyone good with the idea of hooks? >> Yes.
So the so if we sorry >> oh okay okay okay um so the question that was Oh you have a mic now do you want to
>> yes >> okay ask oh this is wrong uh I saw that in the example with the hook, it kept running the agent, but it just blocked the tool call. How do we stop the agent
so that it it doesn't go into infinite loop and keep looping? And >> so, as we're defining our hooks, we can define the hook in such a way to even end the agent's turn if we wanted to.
For demo purposes, we wanted to show you how it's working so that we can see it doing the rate limiting and we can see that it's not running multiple times, right, the calls. So what it's doing is
it's trying to invoke the tool in this case because we said before tool invocation it just kept attempting to do it and kept stopping and but the LLM still continued to run the loop until
the end. But if we want we can create it in such a way that we say okay if I see this just stop the turn and end it at that point. So the we can definitely customize just because we wanted to show
you the end to end working. We made it this way. Um thank you for that question. Um, okay. So, skills and steering. Now, now this is a chatbot that's supposed to be answering customer
service questions, but they could be asking a bunch of different questions that the agent may just not have access or the knowledge to answer. So, how do we give it that knowledge? How do we
tell it how to answer it? We create what's called a skills folder, a skills file which contains potentially all of your information on your your your ground truth, right? Your uh single
source of truth maybe on what it what actually what steps it needs to take. And we can add this as a markdown file. And this is a way by which so here what it do what it would do is when we add
agent skills it would first go look up the skills folder and read all of the skills see which one actually makes sense and then it would use those skills. Um let me get to steering in
just a bit but skills is a way by which we can give our let me go to the third one third module. So um I'm I'm just gonna run this first. Perfect. So first thing is when we
create skills now we've got three types of skills that we've created. One is how do you process refund? How do you track orders? And what if people ask some types of account related questions? My
password is not working or something a bunch of frequently asked questions. How can we get it to work? Right? So this one is on how to handle account issues. So here we are creating these different
skills plugins and then we can directly call it. Um so when I open the skills folder here we can look at sample skills. So this is just a markdown file on skills for account troubleshooting
which is giving it context additional context because in your system prompt you don't want to overflow it with all of the amount of information you have because those are also considered input
tokens and those can get wasted unnecessarily needlessly. So when a certain type of question is being asked, we can give it context that is relevant to that specific type of question then
it has access to all the information that it needs so that it can do justice and answer the question correctly. So in this case this specific skill talks about how can we do account
troubleshooting? What does it require to reset a password? What do you do when the account is locked? And the same thing for like order tracking, right? What do we do? What are the steps that
we need to follow? So these are instructions that we give to the agent beforehand and we write this based on what we want the agent to do. And so we create these different skills um files
markdown files and when we run it apart from the system prompt what we give it access to is the plug-in. So we've now we're now adding yet another uh parameter here which is called plug-in
and this has access to all of the skills plugins and the skills plugin points to the skills folder here. So now it's going to invoke whichever skills it needs for that specific type of question
that's being asked. And when this runs and we someone says, "I'd like a refund for my wireless headphones," it's actually calling the skills as a tool. And then it's saying, "Okay, I've got
your account pulled up. Here's what I found and here's how it's doing it." So, it's becoming more and more deterministic. It's got a natural order that it flows and you can invoke the
context only at the time that it's required. And it's not you're not lo overflowing your system prompt with a lot of tokens every single time. Now this is skills but how many this is
something that I've generally faced right with steering. How many times have we struggled as we're talking to our agents to give us an answer to a question that we ask in a specific
format and it always messes up. It seems to get all of the difficult questions right. If I tell it this is so if I ask it okay what is my what is the refund I'm supposed to get it would give us a
refund and say okay this is what it is but they also generally tend to talk too much and generate a lot of tokens and they you know just free flowing. So how do we give it how do we get it to
respond in the format that we want? How do how can we ensure that it's giving us like a structured output if that's what we need or like hey stop using m dashes every single time do we want to keep
telling it we want to be able to catch that deterministic the deterministically and ensure that it's doing it in a deterministic way. So for that we do something called steering which helps
the agent which helps the agent steer itself in the direction that we want it to by giving it a buddy agent. So it works, think of it as like pair partnering, like pair programming or
pair partnering where as it's generating an output, the buddy agent looks at what's being generated and then that buddy agent can then tell it, hey, no, this is not what you're supposed to do.
This is the format that you wanted to do in. So your buddy agent is sort of checking and correcting and course correcting and then the response you want is what is the response that you're
actually happy with. When you're deploying your code into production there is no room for egger in like format structure. You want it a certain way and steering can help you do that.
Now I'm going to do I'm going to do this quickly because I want Ellie to talk about deployment which is how you can actually make sure your agent is helpful and useful. So um quick um quick idea of
steering handlers. Now stirring handlers works the same way as hooks. You can um call it you can invoke it at different points. You can invoke it uh before LLM while LM is being invocated before tool
call after tool call. very similar to hooks except at that hook point now you're also adding another agent over there that can do a quick check and that can buddy like sort of buddy work with
this and then give it the output once so think of it as another guard rail if you will right so then you can do a tool call and then you can do this and this is a guide that can say oh you know what
first look up this before you give me a refund or then you can say revise the tone of this message if it's sending out a message and then after that it gets sent. So now you have more control over
what your agent is generating. And if we go back to steering. Okay. So again what do we want? We want to uh import the steerings uh uh we want to import steerings over here. And from
here again the steering handler. And these are all the different places that we're doing it at. And you can do it in different ways. uh check the the strands agent documentation. It's the details
are going to be in there but also in the workshop mentioned over here you will see all of the details. Now we create a deterministic handler. We tell it we give it rules and we tell it what it's
supposed to do. And this can also be a hardcoded function. This can also be another agent that has an hardcoded function in it that works. We can get it to do you can do like um type
enforcement if you want the output to be only of a specific type. You can do different types of enforcements over here. Right? So then you create a a steering agent and then this is all for
steering. Right? So now you create a steering agent and you create the guard rail. So here the refund workflow handler has been defined and finally you create the guardrail. So here you're
saying okay don't overpromise guarantee specific timelines don't blame the customer acknowledge the customer's frustration and so this is the tone guardrail handler that we're creating.
So this is the second type of steering agent that we've created. Now what we do is in our final code apart from agent skills we just call these two different handlers that we've
established and these handlers can be established at different points. So we can say steer after model if we wanted to do and we can tell it what to do in this case. But over here we can also
tell it we can also do steering data.get we can create a ledger for it and we can choose to enable them at whichever part of the flow the agentic flow we wanted to do. And so at the end all we need to
do is give it access to these two sterving handlers. it's going to be enabled and then when you run it, it's not just calling the lookup customer and get order history, but it's
also we see that it's evaluating the agent response. So before you send out the final response to your end user, you can ensure and you can be you can do it with full confidence. you can say with
full confidence that your model that your agent is most likely going to be responding in the way that you want to because we're establishing all of those control features. Um you can try it
yourself and then I'm going to quickly give it over to Ellie because she's going to be talking >> because only have 12 minutes to put this agent in production but I want to I
would like to add something to the steering part. you know uh there is a a open source library that is calling agent control that you can add to a stringent is there in the documentation
with agent control you can create rules to the steering for example if I have a demo where I this is a travel engine so you can use hooks to block numbers for example it's one one to booking a room
for more than five people you can use a hook a hook to block the room for more than five people. But if you want to steer the agent to block for more for five people, you can create rules. So
every time that the agent is going is receiving more than five bookings, he's going to say if I receive six, I can steer the booking for two rooms. So you can create rules for that using the
agent control library. And the rules you can host this rule in a database. So you can create a database for all your rules for steering the agents. So every time that you invoke this agentic
application, you can go to the database and see the rules. So what is the good thing for this? So you only have to change the rules in the database. You don't have to change the code for the
agent. So the agent only have to knows they have to know the endpoint for your database. So every time that you have a new rule, you can edit the database and that's it. And let's put this agent in
production. So here we have the session manager, but I don't going to show you that session manager is when you want to save the memory using a framework. So but you can do that using n get called
memory without the framework and everything is in the in the code and here in the five for deployment we are not going to use a jupy notebook because you can do that for jupy
notebook but we are going to use the CLI the terminal. So here in this folder uh lose the folder we are having the same engine. So we have the customer service tools and we having the uh the skills we
have everything here. So to put this engine in production you have to go to the workship studio here. This is the thing what we are going to do. We are going to use the AWS
CLI through the terminal. We are going to use some one command or two commands in the CLI. We are going to take this agent then we are going to send this agent this agent code to a runtime on
AWS and agent core is going to deploy this code inside a container but we are not going to handle that because agent core is going to do that for us and and we are going to have memory too without
doing anything. So let's see let's follow the steps. So this is the ah something important when you build a gentic application and you want to put that code inside a core runtime the only
different that you have to do for your engine is put this deconator the a entry point. So the MPP entry point is is the only different between your engine running in your notebook or your
computer uh between production because the MTP entry point is the thing that the runtime when runtime see can see the MTP entry point ah everything behind the MTP entry point is the agent. So every
time that you invoke this runtime, this container is going to run that code behind the empty entry point. Okay. So let's style this. So I go to the here. Sorry,
let me open this. This is the library that I need to execute all my CLI codes and mean I hope I have good internet is running. Yeah. So in this environment you are going to
able to deploy the agent and everything. But if you are running this locally you are going to be able to test the agent before to putting it in in AWS. And something that you have to do to have
the the built-in observability, you need to do something in the console. So let let me show you this. So to go to the console, you open this part AWS console. So it's going to open the console that
is running in this session in this uh in this uh account that you have. So you need to go to a core run not here aen core better aen core so you can see all the service that a core
have harness because you can build a hardness with a few lines of code too runtime gateway memory and observability is just right here but you need to select something I don't remember what
is the name but I'm going to show you let me see here here enable no that's not here configure so you need to go to configure and here you need to enable transaction search so
this thing allows you to have the built-in observability inside the runtime if you don't have that you are not going to see the agentic observability inside your agent because
cloudatch is not going to receive the information and another thing that you have to do let Save this is install put inside the requirement the observability library that I have the observability
requirements. So for that sorry oh it's done. So we have this transm requirements because I'm going to use AM core and you need this one the AWS oper telemetry district. So if you are using
another framework for example line chain or ci there is a unique library for that uh for that framework but you need to do some modification inside your agentic application for a strand you don't need
to do anything because a strand is built in for AWS so everything is built but the observability works for other frameworks but you need to do some modification everything is in
documentation so you can see it so we have the library let's go to So here I'm already there. So A and C. Great. Oh,
so I going to create. No, it's okay. I I didn't save it. >> So my name I going to put Ellie because I am Ellie. And for here I don't going to create a
harness. I going to create a agent. But I have my code. You know, if you if you choose agent, it's going to be a simple agent for you. But I have the code, so I can skip it. And it's going to create
environment everything that I need to put this aent that I already have inside this container. So it's going to create a folder for me. Here is my folder, the aen core, everything. So you all these
steps are here in the workshop. Oh my god. Five minutes. But I going to do it in five minutes. I'm going to put this aent in production. >> That's all right.
>> Yeah. So, a core add to add my aent and what is here. So, well, it's taking a moment. When I put a is going to add create the the container that I need, but I already
have this agent here in my computer because I wanted to show you something. the same engine that Sandy just showed you. This customer engine I have I have the repo here in my computer. So, let me
put this bigger. This is the same again the in the five. Yeah, you can use a core dev agent core dev to test the a locally. So you can do this you can't do
this in the virtual studio because virtual studio is a virtual machine that only allows you to run code in this VS code but if you are running this locally in your computer you can have this
environment to test the engine. So this is the same agent and you know I have some sessions here too. You can see the amounts of tokens. If you want to explore what's happening inside your
engine and you can do that locally but because I'm using Amazon Metro as a model provider I'm using my AWS credential and to use Amazon a core you need AWS credential if you are running
this locally but in the Amazon brow and workshop you don't need that. So yeah, it's working. Yeah, it's the same exactly the same area and I didn't do anything. So let's come back to the
>> Yeah, I have my everything. >> Yeah. >> So I I I did this. I don't remember if I did this. >> Nope. So CD
>> early. So I going to add my uh code inside this aented application. Let me see inside this container. So agent core what I want I want a agent
I going to uh click bring my own code that's it that's it and I you can use direct code deploy or you can use container I going to use that and you can bring your own API key to deploy
this a using entropy open IO whatever you want but I'm going to use Amazon better I don't going to do anything here Enter. Enter. That's it. Now I going to move my code.
And to move my code, I have here copy and paste. And okay, now what else? Ah, I need to create this. So let's see. Copy and paste. One minute.
Wait. And I don't going to do that. So core deploy and one minute to deploy one minute to put this agency in production inside AWS. So it's running is going to
validate it's going to check my credentials. So if you are familiar with AWS when you build everything inside AWS you need to create the am you need to create policy permissions you need to
allows the service to connect with other service you need to do a lot of thing inside core is handle everything for me so you I don't need to create the policy I don't need to create permissions I
don't need to create every anything so it's doing everything for me and you can you can see that ah and because I created that locally it's creating a cloud formation is a infrastructure as a
code using CDK. So you can explore the CDK code. If you are not familiar with CDK, CDK is cloud developer kit. So you can create infrastructure as a code with a l a program lens one that you know for
example Python, TypeScript, whatever. So it's doing that for me. It's creating it's creating everything. It's creating the deployment and everything. And you can do that you can see that in the
console. So let's go to Amazon bedro runtime. Yeah. What? I can't see anything up. So it's it's creating the let me show the cloud formation.
Here I going to see my stack. Ah no because it's a virtual studio account. I'm sorry. You can see that here. But when it start to put this inside the runtime I will see that here.
>> There we go. So it's here and you can test the is is ready. Okay, I can test the end right away. So I can invote this engine here and you know this is super uh terminal
everything inside the repo. You can find how to invoke this a using bo tree. So you the only thing that you need is the air and for this agent is working. Okay, I think it's working. I hope so.
>> It is. It's invoking the agent. >> Yeah. So here you can find how to invoke this agent using the uh SDK. Is there is give me the answer. You can >> it it actually worked. I think is there
anything else I can? >> Yeah. So you can invoke this agent using the SD explore. how to involve this engine using the SDK and to see the observability.
You can go to the runtime. In here you have the observability dashboard and you can see the session the trace how many runtime that you running how
many session do you have each session is a runtime a different container it take a moment you take about one or two minutes to see everything there I'm okay what yeah yeah I'm done that's it please
take a picture for this and share it for the other Friends, here you can find all the information. Everything is here. The the deck, the work studio, some credits
if you are lucky because our few about 20 credits for Eds >> and the Feda please. Firestar, we are amazing the internet. Nobody's not at all [laughter]
and all social media and if you have an answer we are on linking, Twitter, Instagram. Please in the QR code is everything that you need to learn more about strands and a core.
>> Thank you. >> [music]