Agent Speedrun — Elizabeth Fuentes Leone & Sandhya Subramani, AWS

Read the talk

Agent Speedrun

Elizabeth Fuentes Leone and Sandhya Subramani build a Strands customer service agent, add tools, hooks, skills and steering, then deploy it to Amazon Bedrock AgentCore. A live rate-limit test reveals why blocking an action and stopping an agent require different controls.

From a talk by Sandhya Subramani and Elizabeth Fuentes Leone

At a glance

Ideas worth remembering

  • Tools connect the model to customer records and actions; inspecting message history reveals which operations produced an answer.

  • The demonstrated hook limits tool executions per request. It leaves the model loop running; ending the turn requires a separate behavior.

  • Skills supply relevant procedures on demand, while steering handlers check workflow and response behavior at selected execution points.

  • AgentCore deployment uses an application entry point and generated infrastructure. The demonstrated observability setup additionally needs transaction search and the AWS OpenTelemetry dependency.

Start with a harness; choose where it runs

A customer service agent needs to look up an account, inspect orders and handle refunds. Elizabeth Fuentes Leone and Sandhya Subramani’s workshop builds toward that workflow in layers: first a small agent, then controls over its behavior, and finally a deployed service. Strands Agents, the AWS-maintained open-source harness used here, supplies the structure around the language model: tools, execution and places to customize the loop.

The model provider and the deployment service are separate choices. Strands supports different providers and locally hosted models; the workshop uses a Bedrock-hosted model. Amazon Bedrock AgentCore supplies the managed production environment. Its Runtime hosts the application without requiring the application to use Strands: LangChain and CrewAI are also named as possible frameworks.

Several AgentCore services address different problems:

  • Runtime: Run the agent in a managed container with sessions and automatic scaling as session demand changes.
  • Gateway: Expose tools and MCP servers through one endpoint, with semantic search to help find a relevant tool.
  • Memory: Keep information beyond the current session using managed memory capabilities, including custom prompt-based memory behavior.
  • Observability: Inspect token consumption, tool use and events inside the agent loop through CloudWatch, rather than only container resource use.

The hands-on environment uses precreated AWS accounts and Jupyter notebooks, so attendees can run and download the supplied code without setting up billing. Conference Wi-Fi delays the start—“may the Wi-Fi gods be with us”—and the presenters continue with the onstage walkthrough. Each notebook module needs its Python kernel selected; the demonstrated environment uses /usr/bin/python3.13.

0:120:42
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

0:12 · section reference included

Give the model customer data through three tools

The agent loop starts with a user request and context. The model chooses a tool, the application executes it, and the tool result supplies information for the next decision or final response. This is how an order answer gets grounded in customer records rather than the model’s general knowledge. Strands also lets the application change its model configuration while keeping the surrounding tool architecture, making the same application a starting point for comparing providers.

The first notebook installs its requirements and defines dictionary-based mock records for two customers and their orders. Three functions become agent tools through the @tool decorator:

  • Look up customer: Retrieve a customer record using a customer identifier.
  • Get order history: Retrieve the customer’s orders and their statuses.
  • Process refund: Give the agent an action it can call for a refund request.

The agent receives those tools and a system prompt. The prompt tells it to look up the customer before taking action, answer from tool data and avoid asking for information it already has. The notebook uses the default Bedrock model rather than specifying a separate model configuration.

For a request to check recent orders, the observed sequence is customer lookup, order-history lookup, then an order summary. How can a developer distinguish that sequence from a plausible answer generated without the records? Inspect the agent’s message history. The walkthrough exposes the user message, assistant activity, tool calls and final response, along with token metrics. That history connects the answer to the operations that produced it.

A chat.py file turns the same underlying agent and tools into a multi-turn terminal conversation. Each module includes this conversational version, so later controls can be tried through an extended exchange as well as notebook calls. The presenters describe the basic version as fewer than 60 lines of code: enough to make the first interaction work, before introducing stricter behavior.

16:3917:09
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

16:39 · section reference included

Use hooks to enforce a tool-call budget

A prompt can request good behavior, but the application also needs places where code decides whether execution may proceed. Hooks provide those intervention points: before invocation, after a model call, before a tool call and after tool execution are examples discussed in the workshop. A callback can check the user or request, approve an operation, cancel it or inspect an outgoing answer.

The spoken explanation describes a per-request tool-call limit, initially set to three; the visible notebook counts calls per tool within each request and offers total counting across all tools as a separate exercise. The implementation imports HookProvider and HookRegistry from strands.hooks and registers callbacks at two points. Before invocation, a callback resets the counter to zero so a new user request gets a fresh budget. Before each tool call, a check counts calls against the configured maximum and blocks calls beyond it. The agent receives the limiter through its hooks configuration. Despite the name “rate limiter,” the demonstrated budget is a count per request, with no time interval described.

The initial run makes two tool calls and returns a summary under the three-call budget. To make the restriction observable, the presenter lowers max_calls to two and runs the test again. The resulting execution attempts additional calls and reports a blocked lookup after the limit is exceeded. The useful comparison is the permitted activity versus the blocked attempt; the walkthrough does not establish why that run attempts more calls than the initial one.

“The prompt is like a suggestion,” Fuentes Leone says, explaining why a code check belongs inside the loop. A hook can reject information before it reaches the model—for example, information identified as a credit card number—so that blocked request need not incur another model invocation. A later hook can stop an unsuitable answer from reaching the customer. These are different checks at different stages: input filtering protects what the model receives, while output filtering controls what the customer receives.

25:3526:06
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

25:35 · section reference included

Blocking a tool does not end the agent’s turn

An audience member spots the consequential limitation: the hook blocks tool execution, but the agent keeps running. Could it keep looping and repeatedly asking for a forbidden call? Subramani confirms that the demonstration leaves the model loop active. Each attempted tool call reaches the before-tool hook and is stopped, while the model continues until the turn ends.

What does the limit actually stop? The distinction below separates the demonstrated behavior from the proposed stronger control. Preventing another tool execution does not itself cap model iterations or their token cost. Subramani explains that a hook can instead end the agent’s turn when the condition is met, but that terminating version is not demonstrated here. A production limit therefore needs a precise consequence: deny this action, or end this turn.

A denied tool call can leave the model loop running

Model attempts a tool callThe agent loop reaches the before-tool callback.
Check the request’s tool budgetCompare tool-call activity with the configured maximum.
Permit tool executiondemo — Calls within the budget proceed.
Cancel excess tool executiondemo — The demo blocks the call while the model loop remains active.
End the agent’s turnalternative — An alternative hook behavior described, rather than demonstrated.
The demo cancels excess tool execution. Ending the turn is a separate hook behavior described in the answer.
Read the diagram as text
  • Model attempts a tool call. The agent loop reaches the before-tool callback.
  • Check the request’s tool budget. Compare tool-call activity with the configured maximum.
  • Permit tool execution. demo — Calls within the budget proceed.
  • Cancel excess tool execution. demo — The demo blocks the call while the model loop remains active.
  • End the agent’s turn. alternative — An alternative hook behavior described, rather than demonstrated.
  • Model attempts a tool call → Check the request’s tool budget: Before-tool callback.
  • Check the request’s tool budget → Permit tool execution: Within budget.
  • Check the request’s tool budget → Cancel excess tool execution: Over budget: demo.
  • Cancel excess tool execution → Model attempts a tool call: Model may attempt another call.
  • Check the request’s tool budget → End the agent’s turn: Over budget: alternative behavior.
33:5134:20
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

33:24 · section reference included

Load procedures when the question needs them

Tools expose records and actions; skills provide instructions for handling a particular kind of problem. The third module creates Markdown skills for refund processing, order tracking and account troubleshooting. A skills plugin points the agent to the skills folder so it can find and use relevant procedural context.

What belongs in an account-troubleshooting skill? The example covers password-reset requirements and what to do when an account is locked. Order tracking has its own steps. Keeping these procedures in separate files lets the agent obtain context relevant to the current question instead of carrying every procedure in the system prompt on every invocation. The intended saving is unnecessary input tokens.

The test request asks for a refund for wireless headphones. The agent calls a skill as a tool, then proceeds with account information and the relevant procedure. This adds guidance at the point of need. It does not turn Markdown instructions into a hard execution check: the earlier hooks remain the mechanism for programmatically permitting or blocking an operation.

35:3136:01
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

35:31 · section reference included

Check workflow order and response tone before delivery

Knowing the refund procedure still leaves another problem: the agent may answer in the wrong format, produce too much text or use an unwanted style. Subramani’s example is familiar: “stop using em dashes.” Steering adds a check that can guide the agent back toward the required behavior, described initially as a “buddy agent” reviewing and correcting its work.

Steering handlers attach at points in the execution flow, much like hooks. A handler can check a proposed tool action or inspect a model response before delivery. Its implementation can use a hard-coded function or another agent; type enforcement is one suggested use. The two customer service handlers address separate concerns:

  • Refund workflow: Guide the agent to perform a required lookup before giving a refund.
  • Tone guardrail: Check for overpromising, specific timeline guarantees, blaming the customer and failure to acknowledge frustration.

Both handlers are supplied to the agent alongside the skills plugin. In the demonstrated run, response evaluation appears in addition to customer and order lookups.

The implementation choice matters. A hard-coded predicate can make its particular check deterministic; another model’s assessment remains a model judgment. The run demonstrates an additional evaluation step, without establishing that every required format or tone will always pass correctly. The value is an explicit opportunity to detect and correct a response before it reaches the customer.

Fuentes Leone extends the idea with Agent Control, an open-source library described as supporting steering rules. Consider a hotel room with a five-person limit. A hook can reject a request for six people; a steering rule can redirect that request toward two rooms. The second response preserves the customer’s goal while changing the proposed action to fit the constraint. This is a separate travel-agent example, not a demonstrated customer service refund result.

Those rules can live in a database. The application retrieves them when invoked, so a rule update can change steering behavior without editing the agent’s code. That separates policy changes from application changes, while leaving the agent responsible for knowing where to retrieve the rules. The workshop then moves to deployment, leaving the separate session-manager module unexplored.

39:0439:34
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

39:04 · section reference included

Give AgentCore an application entry point

Deployment carries forward the customer service code, tools and skills, but moves the work from notebooks to the terminal. AgentCore packages and runs the application in its managed environment. The central code change highlighted in the walkthrough is @app.entrypoint: it marks the function that Runtime executes when the deployed application is invoked.

The decorator identifies where an invocation enters the application; deployment still requires the surrounding environment, dependencies and configuration. Fuentes Leone installs the CLI tooling and explains that the agent can also be tested locally before sending it to AWS. The next step makes one of those configuration requirements concrete: observability needs to be enabled.

47:0447:34
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

47:01 · section reference included

Enable the path from agent activity to traces

What makes agent activity appear in the observability view? In the console, the walkthrough opens AgentCore’s configuration and enables transaction search. Fuentes Leone identifies this as a prerequisite for the demonstrated CloudWatch agentic observability: without it, the expected information will not appear. “Built in” still has a setup step.

In CloudWatch Settings → Enable transaction search, the toggle is on and Save is available; this is the configuration step the walkthrough identifies as a prerequisite for agent observability.Open full source frame
In CloudWatch Settings → Enable transaction search, the toggle is on and Save is available; this is the configuration step the walkthrough identifies as a prerequisite for agent observability.

The application requirements also include the AWS OpenTelemetry distro. For the Strands application, the presenter describes the integration as requiring no further application changes beyond the supplied setup. Other frameworks can participate in observability, but may require framework-specific instrumentation and modifications. Hosting an application and instrumenting its internal behavior are related, distinct tasks.

49:4150:01
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

49:41 · section reference included

Initialize, test locally, deploy and invoke

The CLI creates a project folder and supporting environment. Because the customer service agent already exists, Fuentes Leone skips generating a starter agent and chooses to bring her own code. While setup runs, she switches to a local copy to show the development environment: the same agent can be exercised locally, with sessions and token counts available for inspection.

Local execution still uses remote credentials when it calls a remote provider. This example uses Amazon Bedrock, so the local machine needs AWS credentials; AgentCore operations also require them. The workshop accounts provide the prepared environment, sparing attendees that credential setup during the session.

Back in the deployment project, the CLI offers direct code deployment or a container option. The configuration also permits other model providers through their API keys; this run keeps Amazon Bedrock. The presenter copies the existing application code into the prepared project, then starts deployment. The operation validates the application and checks credentials before provisioning the supporting resources.

The generated infrastructure handles policies, permissions and service connections that would otherwise need manual setup for this path. It also exposes infrastructure code using CDK and CloudFormation, giving the developer something to inspect rather than hiding all provisioning behind the CLI. The presenter describes using familiar programming languages such as Python or TypeScript to express that infrastructure.

The runtime does not appear immediately in the console. After a brief check—including an unsuccessful attempt to inspect the stack in the workshop account—the deployed agent appears and is invoked successfully. For application integration, the presenter points to Boto3 invocation code in the repository and identifies the agent’s ARN as the runtime identifier needed to address it. The live result establishes that the deployed agent can answer an invocation; it does not exercise every earlier guardrail in production.

The final stop is the Runtime observability dashboard: sessions, traces and runtime/session counts are the inspection points. Fuentes Leone warns that the information can take one to two minutes to appear. This completes the path begun with notebook message inspection: once the agent runs as a service, developers still need to connect a response to its session, tool activity and token use. A successful answer is the beginning of that inspection.

52:0852:51
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

52:01 · section reference included

Resources

Read the complete timestamped transcript
  1. 0:12

    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,

  2. 0:42

    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 Strands 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 gonna give you a g-quick introduction on what we're going to be doing, and then we can dive straight, straight into the

  3. 1:12

    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 Strands Agents? Strands Agents is an open source agent harness, which means you can u- 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

  4. 1:42

    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

  5. 2:12

    you want, and you can run it. Uh, it's also got guardrails and observability built in. Uh, now if when-- now when I say you can run it on, uh, e-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?

  6. 2:39

    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 Bedrock Agent Core is a service dedicated only to put agents in production. So inside Agent Core, we have Agent Core runtime. That is the runtime, the container where you are going to put this agent, and

  7. 3:09

    doesn't matter if it's Strands, the framework, if the LangChain, if the CrewAI. Doesn't matter the framework that you're using. You can put this agentic application inside the runtime, the container, and you are going to deploy this agent in one single line on the CLI. And when you are using runtime, this runtime have sessions, and the session can, can run up to fifty minutes, up to eight hours. So you can have a session built in

  8. 3:39

    inside this container without any, uh, configuration because it's inside there. And you have observability built in too. 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, it's not observability about the RAM or what is the behavior for this container. It's about agentic observability.

  9. 4:08

    How, how many tokens I spending in this application? What is-- what it-- what tool is used in this agent? What happened inside my agent loop? You are going to able to see all of that inside the Agent Core observability inside CloudWatch in AWS. And we have Agent Core Gateway. So sometimes we are having a lot of tools, a lot of MCP for our agentic application. So you can

  10. 4:38

    put all this tool of this MCP behind Agent, Agent Core Gateway, and Agent 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 agentic 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 MCP, for all your tools. And it have semantic search,

  11. 5:08

    so it help you to, uh, deliver the best tool for your agentic loop. And we have Agent Core memory because when we, uh, create a agent, we have short-term memory. The short-term memory is built in the runtime. You already know that. But what happen when you want a, a long-term memory? You know, a memory that can last more than eight hours. So you can create Agent Core memory. So when you, uh,

  12. 5:38

    create Agent Core memory, you are going to have a semantic memory too. So Agent Core built for you, built in three different types of memory. So you are going to have like, uh, 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 Core memory that is completely built in. You don't have to

  13. 6:08

    build the vector store, the database. You don't have to build anything. You only have to say, "Hey, Agent Core, I want Agent Core memory." So it deploy for you the memory, the three different types of memory, custom free memory, and... No, built-in memory, and you can create your own custom memory. You s- you can 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

  14. 6:38

    is Agent 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... So that you can put your code and deploy that 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

  15. 7:08

    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. It's in your account, and it's only you see there. And it 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 less session, it's scaled down.

  16. 7:37

    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, steering, 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 evals and

  17. 8:07

    multi-agentic frameworks as part of the workshop. If we have time, we will do it. But because we wanna take it slow, we wanna take it easy, we wanna 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,

  18. 8:37

    we... So this is enabled for about two fifty participants. If we have more and some of you run into problems, we have a backup workshop link. But for now, uh, log in to this website, and it should take you to a link. Uh, Ellie can also walk...

  19. 8:52

    Yeah.

  20. 8:52

    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?

  21. 9:03

    It's only, it's only there. It's only-

  22. 9:04

    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.

  23. 9:34

    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, uh, 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.

  24. 9:57

    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 password, 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 password, and you need to put the password inside the,

  25. 10:27

    the window that's similar to that.

  26. 10:31

    And if any of you have questions, please raise your hand, and one of us will come find you. We'll work with you.

  27. 10:38

    And in this workshop, when you start to be there, uh, you are going to be able to use Anthropic models through the Amazon Bedrock API. And I think, I'm not sure, I think that you are going to be able to use the new OpenAI models too, and of course, all the Amazon models that we have that you can involve through Amazon Bedrock API. And, uh, you are be able to use a Amazon Bedrock Agent Core for free.

  28. 11:08

    It's not so expensive, okay? 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 Bedrock Agent Core in your account, you are going to see that it's not so expensive. And then you need to approve the next, uh, the next window is, uh, yeah.

  29. 11:33

    Is, uh, is everyone with us right now? Anyone struggling at any step so far? You, do you need help? Okay. Sorry.

  30. 11:42

    Do you... Are you having trouble si-signing in? Um, so you're, you've opened that workshop link, and then did you type in your email address and your password?

  31. 11:57

    Okay. I think Mike can help.

  32. 12:01

    You are okay? I, I need to see if-

  33. 12:03

    Is everyone else okay?

  34. 12:04

    I'm good.

  35. 12:04

    Any other-

  36. 12:05

    All perfect

  37. 12:05

    ... problems? Is anyone struggling with anything?

  38. 12:08

    We might be having a little trouble with Wi-Fi. Who would have thought-

  39. 12:12

    Oh my God

  40. 12:12

    ... that a conference would have trouble with Wi-Fi? A lot of people are getting on. Are you going to be stepping through some of the things on stage there?

  41. 12:20

    Um, what?

  42. 12:21

    You're gonna t-- Are you gonna run through the workshop stages on s- on stage?

  43. 12:25

    Yeah.

  44. 12:25

    So if, if people can't do it, can they watch?

  45. 12:28

    At the end-

  46. 12:28

    Yes

  47. 12:29

    ... of the session, uh, we are going to share with you all the slides. This is a Jupyter. This is a repository that you can clone to. Is, 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.

  48. 12:51

    Yeah. Yeah.

  49. 12:51

    And you can do this, uh, for your, you know, for your business.

  50. 12:55

    Yes. Yes. And, and-

  51. 12:56

    And you can do it. And you know, I can, I... Then when we finish the session, I'm going to put this workshop for three days. So, so you can be, you can use all this for free for three days.

  52. 13:08

    Yeah. And may the Wi-Fi gods be with us as well today while we- ... run it through with you.

  53. 13:14

    Oh, yeah.

  54. 13:14

    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, the, 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?

  55. 13:31

    Yeah. Wait. So before to start, please take a picture to this.

  56. 13:35

    Yes.

  57. 13:35

    Because if you have problem with the first one, you know, it's, it's not a problem of internet. If you are having problem, "Hey, there is not enough account," is becau- because the first one is running for account. So you can use the second one.

  58. 13:48

    Yeah.

  59. 13:48

    So we have two, uh, separate environments deployment.

  60. 13:51

    Yeah.

  61. 13:51

    So let us start.

  62. 14:04

    Go. Okay. So all of you should be seeing this right now, correct?

  63. 14:11

    No, that's not.

  64. 14:12

    This, right? All of you should be seeing this. This is going to be, on the left is going to be your step-by-step work, um, uh, 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. B- But if you want to get started with the code, click on this over here, the

  65. 14:42

    Agent Speedrun ID 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.

  66. 14:54

    The people who is having internet.

  67. 14:56

    Yes. Everyone who's got internet, click, like, click on this button over here. Sc- uh, 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,

  68. 15:26

    and you go to your next steps, it's going to actually show you here, right? So select kernel Python environments, usr/bin/python3.13. Copy that, and in your select kernel, paste that over here, and it should close it and pick it up for you.

  69. 15:48

    Okay? So 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-

  70. 16:02

    Yeah. Um-

  71. 16:02

    Just Wi-Fi? Ah, what do we do?

  72. 16:04

    Continue.

  73. 16:05

    Do we... Okay, we'll just-

  74. 16:06

    Please remind the person to go as much closer as they can.

  75. 16:09

    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 Strands Agents, 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

  76. 16:39

    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 Strands 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,

  77. 17:09

    and then under Agent, you just have to specify model and your model name. You can do this with OpenAI. This supports all of your different LLMs, your favorite LLMs. 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, h- what makes the agent

  78. 17:39

    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

  79. 18:08

    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 ac-

  80. 18:38

    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 tool's 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

  81. 19:08

    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

  82. 19:38

    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.txt 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

  83. 20:07

    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 f- to these customers? So they have these orders. Uh, it's just like a dictionary, so these are the customers, and these are the order statuses, and we define tools. Tools can be written, can be, uh, it can be a functional code, but it can also be, uh, like an NLP type of a

  84. 20:38

    tool that you can have generated. The way to define a tool is by using the @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

  85. 21:08

    @tool decorator. So le- let's run this.

  86. 21:13

    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 Strands-- on the Strands website, you can establish whichever model you want, and you can add your

  87. 21:43

    model here. The third thing you want to add apart from this is your tools. So you will call the agent method, write the two, 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 cu- 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

  88. 22:13

    tell the agent, like you tell the, uh, 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 ch- 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 lookup on

  89. 22:43

    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, uh, 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

  90. 23:13

    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 you. This is what the user is saying. This is what the assistant does. Then this is the c- tool call one, tool

  91. 23:43

    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 the number of tokens that it used. We can use more metrics. You can add more metrics. Do what you will. Additionally, uh, we just wanna do something simple here, right? Because simple walkthrough. 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,

  92. 24:13

    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 f- file for every single one of these modules. So when I click chat.py, this is the exact same underne- underlying code, except we've enabled it for multi-turn conversation. So you do

  93. 24:43

    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

  94. 25:13

    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. Sixty lines of code. Less than 60 lines of code. Uh, so that's basic agent. Are we good?

  95. 25:35

    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 who is, who has 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 gonna close this. Now, hooks are

  96. 26:06

    a way by which you can enforce certain programmatic, uh, commands and functions to take place. So before-- So what you can do is, b- uh, 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

  97. 26:36

    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

  98. 27:06

    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

  99. 27:35

    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 gonna 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.

  100. 28:03

    Okay. Go to the notebook. That's that. This is not the notebook?

  101. 28:08

    No.

  102. 28:08

    Oh, this is the customer service tools. Okay. Um, yeah, yeah, yeah. I'm in the wrong one.

  103. 28:17

    Okay, I'm on the notebook. Again, we have to install requirements and choose our environment.

  104. 28:27

    So how does this work? Now, we want to import strands.hooks, and we want to import HookProvider, HookRegistry, 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

  105. 28:56

    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

  106. 29:26

    registry. So over here, we add it and say, "Okay, bef- before invocation event," and then we want another callback, which is before tool call event. And a callback means that's when it would get called. So that's because you're defining it over here. So then we have a counter which the, 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, uh, r-

  107. 29:56

    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

  108. 30:27

    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 is 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 two. 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.

  109. 30:57

    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.

  110. 31:22

    I, I would like to add something-

  111. 31:23

    Yeah

  112. 31:23

    ... to the hooks. Sometimes, you know, hook is better because when you're using a LLM with some tools, the LLM are probabilistic.

  113. 31:32

    Yeah.

  114. 31:32

    You know? They-- When you put a prompt inside your agentic application, the prompt 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 agent loop. So you can put code, Python code, before or after the invocation, so you can stop, uh, I don't know, for an-- in this example, you stop, uh, a lot of,

  115. 32:02

    uh, more than three tools invocation. But for example, if you want to restrict, uh, AP, I don't know, some credit card number, something like that-

  116. 32:11

    Yeah

  117. 32:11

    ... you can put a hook, a code, capable to understand some things. Say, "Hey, you can't receive this information, so I'm 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 using the hook. And if you don't want to

  118. 32:41

    send some type of answer to your customer service, you can stop that answer with a after call hook as well.

  119. 32:50

    Exactly. Thank you.

  120. 32:54

    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. Th-this is a really good way of enabling guardrails, 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

  121. 33:24

    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.

  122. 33:51

    I saw that the hook, it kept going with tool call, but the, the agent was still running. There was nothing to stop. Because if you're infinite loop, you don't want to keep running and just say, "Hey, I won't." How do you stop it from running?

  123. 34:07

    So the e-- So if we-

  124. 34:09

    Can you repeat the question?

  125. 34:10

    Sorry?

  126. 34:11

    Can you repeat the question?

  127. 34:12

    Oh, okay, okay, okay, okay. Um, so the question that was... Oh, you have a mic now. Do you wanna-

  128. 34:17

    Y-yes. Um.

  129. 34:18

    Okay, ask. Oh, this is strong.

  130. 34:20

    Yeah. 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, and-

  131. 34:31

    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,

  132. 35:01

    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. S- 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

  133. 35:31

    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 or 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

  134. 36:01

    would do is when we add sk- 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, ste-- 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 gonna, I'm just gonna run this first.

  135. 36:35

    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

  136. 37:04

    call it. Um, so when I open the skills, uh, 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

  137. 37:34

    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? W- and the same thing for like order tracking, right? What do we do? What are the s- steps that we need to follow? So these are instructions that we give to the agent beforehand, and

  138. 38:04

    we write this based on, uh, 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 plugin. So we've a-- we're now, we're now adding yet another, uh, parameter here, which is called plugin, and this has access to all of the skills plugins, and the skills plugin points to the skills

  139. 38:34

    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 from a 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 is what I found, and here is 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

  140. 39:04

    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

  141. 39:34

    I tell it this is-- so if I ask it, "Okay, w- 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 em dashes." Every single time do we want to keep telling it? We want to be

  142. 40:04

    able to catch that determinist- de- 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

  143. 40:34

    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 error in like format structure. You want it a certain way, and steering can help you do that. Now, I'm gonna do qu- I'm gonna

  144. 41:04

    do this quickly because I want Ellie to talk about deployment, which is how you can actually make sure your p- your agent is helpful and useful. So, um, quick, um, quick idea of steering handlers. Now, steering 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, w- uh, while LLM is being invocated, before tool call, after tool call. Very similar to hooks, except at

  145. 41:34

    that hook point, now you're also adding another agent over there that can do a quick check, and that can buddy, uh, like sort of buddy work with this and then give it the output it wants. So think of it as another guide wheel, uh, 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

  146. 42:04

    more control over what your agent is generating, and if we go back to steering.

  147. 42:13

    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 Agents 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,

  148. 42:43

    and we tell it what it's supposed to do. And this can also be a hard-coded function. This can also be another agent that has an hard-coded 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,

  149. 43:13

    and you create the guardrail. So here, the refund workflow handler has been defined. And finally, you create the guardrail. So here you're saying, okay, don't over-promise, 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,

  150. 43:44

    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 steeringdata.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,

  151. 44:13

    all we need to do is give it access to these two steering handlers. It's going to be enabled. And then when you run it,

  152. 44:26

    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 i-in the way that you want it to, because we're establishing all of

  153. 44:56

    those control features. Um, you can try it yourself, and then I'm gonna quickly give it over to Ellie, because she's gonna be talking about-

  154. 45:01

    Because only have twelve minute to put this agent in production. But I want to, uh-- 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 Strands agent. It's there in the documentation. With Agent Control, you can create rules to the steering. For example, if I have a, a demo where I... This is a travel agent, so you can use hooks to block

  155. 45:31

    numbers. For example, if someone want to book in 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 book for more for five people, you can create rules. So every time that the agent is go-- is receiving more than five bookings, he's going to say, "Hmm, but if I receive six, I can steer the booking for two rooms." So you can create rules for

  156. 46:01

    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 a-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 agents. So the agent only have to knows-- they have to know the

  157. 46:31

    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 these agents in production. So here we have the session manager, but I, I don't going to show you. The session manager is when you want to save the memory using a framework. So but you can do that using the AgentCore memory without the framework. And everything is in there in the code. And here in the

  158. 47:01

    file for deployment,

  159. 47:04

    we are not going to use a Jupyter Notebook, because you can do that for Jupyter Notebook, but we are going to use the CLI, the terminal. So here in this folder, I'll close the folder. We are having the same agent. So we have the customer service, uh, tools, and we have in there, uh, the skills. We have everything here. So to put this agent in production, you have to go to the Workshop Studio. Here, this is the thing what we are going to do. We are going to use the AWS

  160. 47:34

    CLI through the terminal. We are going to use some-- one command or two commands in the CLIs. We are going to take this agent, then we are going to send this agent, this agent code, to a runtime on AWS, and AgentCore is going to deploy this code inside a container. But we are not going to handle that, because AgentCore is going to do that for us. And in the end, we are going to have memory too, without do anything. So let's see. Let's follow

  161. 48:04

    the steps. So this is the... Ah, something important. When you build agentic application, and you want to put that code inside AgentCore runtime, the only difference that you have to do for your agent is put this decorator, the @app.entrypoint. So the @app.entrypoint is, is the only difference between your agent running in your notebook or your computer, uh, between, um, production. Because the @app.entrypoint

  162. 48:34

    is the thing that the runtime, when runtime see, it can see the @app.entrypoint, say, "Ah, everything behind the @app.entrypoint is the agent." So every time that you invoke this runtime, this container, it's going to run that code behind the @app.entrypoint.

  163. 48:53

    Okay. So let's style this. So I go to the... Here, sorry. Let me open this.

  164. 49:11

    This is the library that I need to execute all my, uh, CLI codes. And mean- meanwhile, I hope I have good internet. It's 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 put 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

  165. 49:41

    me show you this. So to go to the console, you open this bar, 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 Agent Core.

  166. 50:01

    Run, not here. Agent Core, better Agent Core. So you can see all the service that Agent Core have. Harness, ah, because you can build a harness 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 it. Here, configure.

  167. 50:31

    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 CloudWatch is not going to receive the information. And another thing that you have to do, let me save this, is install, put inside the requirement

  168. 51:01

    the observability library that I have the observability requirements. So for that... Sorry, it's... Oh, it's done. So we have the strands agent requirements because I'm going to use better Agent Core, and you need this one, the AWS OpenTelemetry distro. So if you are using another framework, for example, LangChain or CrewAI, there is a unique library for that, uh, for that framework. But you need to do some

  169. 51:31

    modification inside your agentic application. For the strands, you don't need to do anything because a strand is building for AWS, so everything is built in. 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 the... So here, I'm already there. So Agent Core, create.

  170. 52:01

    Oh.

  171. 52:04

    So I'm going to create. No, it's okay. I, I didn't save it.

  172. 52:07

    Okay.

  173. 52:08

    So my name, I'm going to put Eli because I am Eli. And for here, I don't going to create a harness. I want to create a agent. But I have my code. You know, if you s- if you choose agent, it's going to build 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 agent that I already have inside this container. So it's going to create a folder for me. Here is my folder.

  174. 52:38

    The Agent Core, everything. So you keep... All the steps are here in the workshop. Oh my God, four minutes. But I'm going to do it. In five minutes, I'm going to put this agent in production.

  175. 52:49

    That's all it takes, right?

  176. 52:50

    Yeah.

  177. 52:50

    Five minutes.

  178. 52:51

    Yeah. So Agent Core add to add my agent. And where is?... Here. So while it's taking a moment, when I put agent add, it's going to add, create a- the container that I need. But I already have this agent here in my computer because I wanted to show you something. The same agent that Sandy just showed you, this customer agent, I have, I, I have the repo here in my computer. So let me put this B

  179. 53:21

    here. This is the same, again, the, in the five. Yeah. You can use Agent Core,

  180. 53:30

    dev, Agent Core dev, to test the agent locally. So you can do this, you can 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 agent. So this is the same agent. And you know, uh, I, I have some sessions here too. You can see the amounts of tokens. If you want

  181. 53:59

    to e- explore what's happening inside your agent, you can do that locally. But because I'm using Amazon Bedrock as a model provider, I'm using my AWS credential. And to use Amazon Bedrock Agent Core, you need AWS credential if you are running this locally. But in the Amazon Bedrock in the workshop, you don't need that. So yeah, it's working. Yeah, it's the same, exactly the same agent. I didn't do anything. So let's come back

  182. 54:29

    to the... Here, I have my-

  183. 54:33

    It's done

  184. 54:33

    ... everything.

  185. 54:34

    Yeah.

  186. 54:34

    So I di- I di- I, I did this. I don't remember if I did this.

  187. 54:40

    Nope. So CD, Eli. So I want to add my, uh, code inside this agentic application. Oh, let me see. Inside this container. So Agent Core, what I want, I want a agent. I'm going to s- 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'm going to use

  188. 55:09

    that. And you can bring your own API key to deploy this agent using Anthropic, OpenAI or whatever you want. But I'm going to use Amazon Bedrock. I don't want to do anything here. Enter. Enter. That's it. Now, I'm going to move my code. And to move my code, I have here copy and paste it. And okay, now what else? Ah, I need to create this.

  189. 55:40

    So let's see. Copy and paste. One minute. Wait. And, hey, I'm not going to do that. So Agent Core deploy. And one minute to deploy. One minute to put these agents in production inside AWS. So it's running. It's going to validate. It's going to check my credentials. So if you're familiar with AWS, when you build everything inside AWS, you need to create a AM, AM. You need to

  190. 56:09

    create policy, permissions. You need to allow the service to connect with other service. You need to do a lot of thing inside. Agent 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 everything, anything. So it's doing everything for me. And you can, you can see that. Ah, and because I, I created that locally, it's creating a cloud formation. It's, uh, infrastructure as a code using CDK. So you can explore the CDK code. If

  191. 56:39

    you are not familiar with CDK, CDK is cloud developer kit. So you can create infrastructure as a code with a lang- a program language 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 Bedrock runtime.

  192. 57:05

    Yeah. What? I can't see anything. Ah, but it's, uh, it's creating the... Let me show the cloud formation.

  193. 57:17

    Here, I'm going to see my stack. Ah, no, because it's a virtual studio account. Sorry. You can see that here. But when it, it start to put this inside the runtime, I will see that here. Ah, it's there.

  194. 57:28

    Ah, there we go.

  195. 57:29

    So it's here, and you can test the agent. It's, it's, it's ready. Okay. I can test the agent right away. So I can invoke this agent here.

  196. 57:41

    And, you know, this is super, uh, terminal everything. Inside the repo, you can find how to invoke this agent using Boto3. So you- the only thing that you need is the ARN for this agent. It's working. Okay. I think it's working. I hope so.

  197. 57:59

    It is. It's invoking-

  198. 58:00

    It's working

  199. 58:00

    ... the agent.

  200. 58:01

    Yeah. So here you can find how to invoke this agent using the, uh, SDK. Hey Ceres, give me the answer. You can-

  201. 58:10

    It, it, it actually worked. I think... Is there anything else I can-

  202. 58:12

    Yeah. So you can invoke this agent using the SDK. Explore how to invoke this agent using the SDK. And to see the observability, you can go to the, uh, runtime.

  203. 58:28

    In here you have the observability dashboard.

  204. 58:33

    And you can see the session, the trace, how many runtime are you running, h-how many session do you have. Each session is a runtime, a different container.

  205. 58:43

    This-

  206. 58:43

    It take a moment. You have... It take about one to two minutes to see everything there. What? I'm okay. What?

  207. 58:50

    Yeah.

  208. 58:51

    Yeah, yeah, yeah. I'm done. That's it. Wait. Please take a picture for this. And share it for the other friends.

  209. 59:00

    Here you can find all the information. Everything is here. The, the deck, the Virtual Studio. Some credits. If you are lucky because are a few, about 20 credits for AWS. And the feedback, please five star. We are amazing. The internet know by now of four. And our social media. And if you have an answer, we are on LinkedIn, Twitter,

  210. 59:29

    Instagram. Please, in the QR code is everything that you need to learn more about Strands and Agent Core.

  211. 59:37

    Thank you.