# Ship it! Building Production-Ready Agents

Mike Chambers

AI Engineer World's Fair 2025

[Talk page](https://ai.engineer/talks/HT4l0DeP69I-ship-it-building-production-ready-agents) · [Video](https://www.youtube.com/watch?v=HT4l0DeP69I)

## Ship it! Building Production-Ready Agents

A tabletop RPG assistant shows what must move beyond the laptop: model access, instructions, the agent loop, execution history, and the tools that act on its decisions.

Basic Python knowledge and familiarity with language-model tool calling will help; AWS Lambda and Bedrock concepts are introduced as they appear.

### Start with a die, not a weather forecast

[1:50](https://www.youtube.com/watch?v=HT4l0DeP69I&t=110s)

How do you take a working Python agent and get it running at cloud scale? Mike Chambers frames the problem through tabletop role-playing games: a small assistant that can roll dice on a player’s behalf. The useful starting point is deliberately modest—a single Python file, with no agent framework, whose tool generates a random number. The demonstrations are prerecorded to avoid Wi-Fi problems, with execution shown in real time between playback advances.

![VS Code showing main.py with random, re and ollama imports, a roll_dice function, and SimpleAgent initialization.](https://ai.engineer/api/talk-essay-media/b79eff4ad4264840da17866a10a891e1c8630804344171f0d6c9234fa1dd95b1)

The Python example defines a dice-rolling tool and a SimpleAgent class.

The local model is **Llama 3.1 8B**, running through [Ollama](https://ollama.com/library/llama3.1) on Chambers’s laptop. His implementation includes a system prompt describing the available tools and examples showing how to invoke them. Those examples give the small model additional help translating a request into tool use. One such request involves a D20: a twenty-sided die.

### Turn gameplay language into an action

[3:40](https://www.youtube.com/watch?v=HT4l0DeP69I&t=220s)

Chambers starts the Python program in a terminal and enters “roll for initiative and add a dexterity modifier of five.” The user does not specify a function name or spell out the number of sides. The model uses its understanding of the game terminology to interpret the request, selects the dice tool, and has the program execute it.

In the local demonstration, the D20 roll returns 10; adding the modifier of 5 produces an initiative total of 15. That small interaction exposes the division of labor: the model interprets the request, executable code supplies the random result, and the agent incorporates that result into its answer. The behavior works on the laptop. The next problem is moving the machinery that produced it into a hosted environment.

![Terminal output shows roll_dice(20), a tool result of 10, and an initiative total of 15, with 15 highlighted.](https://ai.engineer/api/talk-essay-media/389f8dea777738a5113815661bce6ae2690001e127229faa31a4a279c1572c2d)

The local agent rolls 10 and adds a Dexterity modifier of 5 for a total of 15.

### The loop needs history to keep working

[4:53](https://www.youtube.com/watch?v=HT4l0DeP69I&t=293s)

Moving an agent means accounting for more than model inference. Chambers begins with the **model**, which supplies natural-language understanding, and the **prompt**, which establishes the agent’s purpose, capabilities, and personality. Both matter, but neither by itself executes a task.

The **agentic loop** connects interpretation to action. It processes the input, invokes a tool, examines the result, and decides whether another tool call is necessary. At the application level, this can be ordinary conditional and `while` logic moving strings between components. That control flow still needs somewhere to run when the application leaves the laptop.

**History is working context for the current task, not just memory of yesterday’s conversation.** After a tool executes, the next model step needs the original request and the relevant steps and results so far. In the initiative example, retaining the dice result lets the agent continue from the roll it already made. Without that context, the next step cannot reliably build on the previous one.

Finally, **tools** let the agent act outside the model. The dice function is a minimal example of that agency. Model, prompt, loop, history, and tools form Chambers’s minimum viable inventory—not an exhaustive taxonomy, but a concrete set of responsibilities to place in the cloud.

### Assign those responsibilities to Bedrock and Lambda

[7:41](https://www.youtube.com/watch?v=HT4l0DeP69I&t=461s)

Amazon Bedrock supplies access to models from providers including Amazon, Anthropic, Meta, Mistral, and AI21 Labs; Chambers also points to the **Amazon Nova** family. For the orchestration around those models, he chooses [Amazon Bedrock Agents](https://docs.aws.amazon.com/bedrock/latest/userguide/agents.html), a managed service configured with the agent’s behavior and tools. This is the historical service shown in the recording: current AWS documentation calls it **Agents Classic** and says it is closed to new customers, while existing customers can continue using it.

The configuration calls the agent’s behavioral text an **instruction**. It is not quite the complete prompt: the service combines it with a prompt template associated with the selected model. A default template is supplied, and developers can edit it. The service also takes responsibility for the loop and conversational history.

An **action group** is a collection of tools. An agent can have multiple groups, but this example needs only one, containing the dice roller. AWS Lambda provides the execution environment for that tool code. The resulting mapping is compact:

| Agent responsibility | Hosted component |
| --- | --- |
| Language understanding | Model accessed through Bedrock |
| Purpose and behavior | Instruction plus prompt template |
| Loop and execution history | Bedrock Agents orchestration |
| Tool definitions | Action group |
| Tool execution | Lambda function |

Lambda handles scaling of the function execution; the action group tells the agent which functionality it can invoke.

A Lambda-backed tool can reach other AWS services or external systems and perform operations such as sending email. Chambers jokes about launching a rocket, then acknowledges that some use cases do not fit Lambda. The practical boundary is the code and integrations the function can actually execute. The dice roller keeps that boundary easy to inspect.

### Create the agent and choose its role

[10:51](https://www.youtube.com/watch?v=HT4l0DeP69I&t=651s)

The console makes the configuration visible, but Chambers explicitly rejects manual console operations as the production provisioning approach. He names Terraform, Pulumi, [CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-bedrock-agent.html), SDKs, and SAM as routes for expressing the setup in code. The walkthrough uses the console so the audience can follow the settings.

The initial setup is straightforward:

1. Open **Agents** in the Bedrock console and choose **Create agent**.
2. Give the agent a name and a description that will remain recognizable months later.
3. Describe its purpose as helping with tabletop RPGs.

The resulting builder shows `game_master_agent`, its description, resource-role settings, and the test panel. At this point, the agent’s basic identity exists; its model and behavior still need configuration.

![Amazon Bedrock agent builder displaying the game_master_agent name, its tabletop RPG description, resource-role options, and an empty Test Agent panel.](https://ai.engineer/api/talk-essay-media/974161f302dcbad6115c0836c71f19a9f669ff38a33fc9a2759665536310320c)

The newly created game_master_agent appears in Amazon Bedrock’s agent builder.

Chambers selects **Anthropic Claude 3.5 Haiku**, describing it as small, capable, and fast—and more than this simple task requires. He then supplies the games-master instruction: help the user play tabletop RPG games. This is the behavioral text that will be combined with the service’s prompt template.

### Make the tool understandable to the model

[12:51](https://www.youtube.com/watch?v=HT4l0DeP69I&t=771s)

After saving the agent, Chambers adds an action group with a name and description. Here, descriptions have an operational role: the model reads them to decide whether the group contains functionality relevant to the request. Natural-language descriptions become part of the programming interface.

He selects the Lambda quick start, which creates a function, configures the permissions, and connects it to the agent. Within that group, he defines the Roll Dice tool and describes it as rolling a die with a specified number of sides. The tool description explains when to use the function; its parameter definition explains how to call it.

The number-of-sides parameter receives a name, a natural-language description, the type **integer**, and a **required** flag. Together, those settings tell the model that a tool call must include an integer specifying the die’s sides. Chambers clicks **Create**, saves the configuration, and reopens the action group to follow the link to its generated Lambda function. The connection exists, but the generated function still needs the dice logic.

### Put the dice logic inside the Lambda contract

[15:34](https://www.youtube.com/watch?v=HT4l0DeP69I&t=934s)

Inside the Lambda console, Chambers edits the generated Python boilerplate directly. Amazon Q Developer is integrated into the editor and suggests code as he works. The function imports `random`, reads the incoming event to identify the requested function and its parameters, then dispatches to the dice operation. That operation extracts the number of sides and generates a random result.

The response must fit the surrounding integration, not merely return a Python integer. In the [documented function-details Lambda contract](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html), parameter values arrive as strings even when the tool schema declares an integer. A handler therefore converts and validates the value, then wraps the result in the Bedrock response envelope. Using `roll_dice` and `sides` as the configured identifiers, the implementation can take this form:

```python
import random


def lambda_handler(event, context):
    function = event["function"]
    parameters = {
        item["name"]: item["value"]
        for item in event.get("parameters", [])
    }
    response_state = None

    try:
        if function != "roll_dice":
            raise ValueError("Unknown function")

        sides = int(parameters["sides"])
        if sides < 1:
            raise ValueError("sides must be a positive integer")

        roll = random.randint(1, sides)
        body = f"Rolled a D{sides}: {roll}"
    except (KeyError, TypeError, ValueError) as error:
        body = f"Invalid tool request: {error}"
        response_state = "REPROMPT"

    function_response = {
        "responseBody": {"TEXT": {"body": body}}
    }
    if response_state is not None:
        function_response["responseState"] = response_state

    return {
        "messageVersion": "1.0",
        "response": {
            "actionGroup": event["actionGroup"],
            "function": function,
            "functionResponse": function_response,
        },
    }
```

The tool returns the roll itself. The agent can then use that result to answer the larger gameplay request, including its modifier. In the recording, Chambers formats the generated number into the response body, accepts Q Developer’s suggested response code, and adjusts the indentation to fit the boilerplate.

Clicking **Deploy** saves the edited function into the Lambda environment. This deploys the executable tool; the next step is to return to the agent and prepare its configuration for testing.

### Prepare the agent, then test the hosted flow

[17:37](https://www.youtube.com/watch?v=HT4l0DeP69I&t=1057s)

Back in Bedrock, Chambers prepares the agent and points out alias IDs as part of the software development lifecycle. The [deployment lifecycle](https://docs.aws.amazon.com/bedrock/latest/userguide/deploy-agent.html) distinguishes preparing and testing the mutable `DRAFT` from publishing an immutable version through a deployment alias. The walkthrough shows preparation and testing; it does not establish that a production alias was created.

He submits a more elaborate initiative request in the right-hand test pane. The hosted demonstration returns an initiative total of 15. The individual roll and modifier for this second run are not specified. What has changed is where the work happens: managed orchestration now coordinates the model and the Lambda tool. Chambers describes that environment as fully hosted and ready for cloud scale; the demonstrated result is a functional test, with no load or latency measurements supplied.

### Beyond the dice demonstration

[18:34](https://www.youtube.com/watch?v=HT4l0DeP69I&t=1114s)

Chambers closes by returning to DeepLearning.AI training, offering courses that, at the time of the talk, were free and included an AWS environment for experimenting with Bedrock Agents. The invitation extends the walkthrough into hands-on practice rather than adding another deployment step.

Two further technical topics remain outside the demonstration: hosting MCP servers at cloud scale and a new open-source SDK for developing model-first agents. Chambers does not name the SDK here or demonstrate either topic. He invites those conversations at the AWS stand, where the virtual dice example also has a physical counterpart: a D20 to take away.

![Mike’s prompt-template slide lists discussion topics, highlights open source SDKs for developing model-first agents, and shows a QR code and jar of dice.](https://ai.engineer/api/talk-essay-media/33eb89aebb21eec1d306a132aa91ba5470eb8712e0fda4382b236f692476d593)

Follow-up topics include cloud-scale MCP servers and open source SDKs for model-first agents.

## Resources

- [Run Llama 3.1 with Ollama](https://ollama.com/library/llama3.1) — Model variants and commands for running Llama 3.1 locally, including the 8B model used in the walkthrough.
- [Amazon Bedrock Agents documentation and availability](https://docs.aws.amazon.com/bedrock/latest/userguide/agents.html) — Managed-agent concepts and current availability notice: Agents Classic is closed to new customers; existing customers can continue using it.
- [Bedrock action-group Lambda integration](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html) — Input events, response envelopes, permissions and Python examples for implementing agent tools in Lambda.
- [Agent versions and deployment aliases](https://docs.aws.amazon.com/bedrock/latest/userguide/deploy-agent.html) — How working drafts, immutable versions and aliases support deployment and rollback.
- [Define a Bedrock agent with CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-bedrock-agent.html) — CloudFormation resource syntax for configuring an agent and its action groups as infrastructure code.
- [Introducing Strands Agents](https://aws.amazon.com/blogs/opensource/introducing-strands-agents-an-open-source-ai-agents-sdk/) — AWS's launch explanation of its open-source SDK, model-driven agent loop and Python tool definitions.
- [Bedrock agent course retirement notice](https://community.deeplearning.ai/t/announcement-course-deprecation/891738) — DeepLearning.AI's notice retiring Serverless Agentic Workflows with Amazon Bedrock.

## Slides

### Ship it! Building Production-Ready Agents

Mike Chambers introduces a talk on getting agent code into production, with a jar of tabletop RPG dice on the title slide.

[0:24](https://www.youtube.com/watch?v=HT4l0DeP69I&t=24s) [Mike Chambers’s title slide, illustrated with a jar of tabletop gaming dice.](https://assets.ai.engineer/sites/aiecode2025/sha256/d1716af27d213c0bb235f6c803a93d2be56e58d5ae92d9ca279782e197821e0a.webp)

Ship it!
Building Production-Ready Agents

Mike Chambers (he/him)
Senior Developer Advocate, AI Engineering @ AWS

[illegible] or its affiliates. All rights reserved. Amazon Confidential and Trademark.

aws

Interface text:
AIE
World’s Fair

### Generative AI for real-world applications

Chambers worked with Andrew Ng and AWS colleagues on a course covering how generative AI works and how to deploy it. He says over 370,000 people have taken it.

[1:01](https://www.youtube.com/watch?v=HT4l0DeP69I&t=61s) [A generative AI course promotion, created in collaboration with AWS, with colorful geometric artwork and a 375k+ figure.](https://assets.ai.engineer/sites/aiecode2025/sha256/6b7cdb22bd268d043ad1f4055f1b72eed9db05f160bbc67343baf30fbbcbbf99.webp)

Learn the fundamentals of generative AI for real-world applications

In Generative AI with Large Language Models (LLMs), created in partnership with AWS, you’ll learn the fundamentals of how generative AI works, and how to deploy it in real-world applications.

Enroll now

IN COLLABORATION WITH
aws

375k +

[illegible] Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
2

Interface text:
AIE
World’s Fair
Microsoft
smol ai

[1:07](https://www.youtube.com/watch?v=HT4l0DeP69I&t=67s) [Course promotion describing generative AI fundamentals and an AWS collaboration.](https://assets.ai.engineer/sites/aiecode2025/sha256/add331c307feb0a34217e92ffe30245fbed69b4cfd944e8148263ffbbc74479e.webp)

Learn the fundamentals of generative AI for real-world applications

In Generative AI with Large Language Models (LLMs), created in partnership with AWS, you’ll learn the fundamentals of how generative AI works, and how to deploy it in real-world applications.

Enroll now

IN COLLABORATION WITH
aws

375k +

[illegible] Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
2

Interface text:
AIE
World’s Fair
aws

### Playing with Transformers

The speaker poses with Andrew Ng and plays on the Transformers reference: Ng holds Optimus Prime, while the speaker holds Megatron.

[1:22](https://www.youtube.com/watch?v=HT4l0DeP69I&t=82s) [Two people hold Transformers figures in a photograph.](https://assets.ai.engineer/sites/aiecode2025/sha256/13ef633854269b4a014d0e0213c9d9e6c8013b397c126dd3bc87bf4a15634e3c.webp)

[illegible] Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
3

Interface text:
AIE
World’s Fair
Microsoft
smol ai

### Transformers close-up

A close-up shows the Transformers toys Andrew Ng and the speaker are holding: Optimus Prime and Megatron.

[1:31](https://www.youtube.com/watch?v=HT4l0DeP69I&t=91s) [Close-up of two Transformers figures held in the photograph.](https://assets.ai.engineer/sites/aiecode2025/sha256/d18eee7e48ecb1d1a6827ee6f1ebf5d3dd2a956502eceae76824654a7084e239.webp)

[illegible] Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
4

Interface text:
AIE
World’s Fair
aws

### Python agent and dice-rolling tool

A single Python file defines an agent and registers a dice-rolling tool that returns a random number. The demo uses Ollama with Llama 3.1 8B.

[1:48](https://www.youtube.com/watch?v=HT4l0DeP69I&t=108s) [Code editor showing a dice-rolling function and a simple agent class.](https://assets.ai.engineer/sites/aiecode2025/sha256/2bd691559e4735ec9a357e5042691a857cd33a30db063afaa4939ae4984180f1.webp)

import random
import re
import ollama

def roll_dice(sides: int = 6) -> str:
    """Roll a dice with a given number of sides."""
    return f"You rolled a {random.randint(1, sides)}."

class SimpleAgent:
    def __init__(self, model: str = "llama3.1:8b"):
        self.model = model
        self.tools = {"roll_dice": roll_dice}
        self.conversation_history = []

    def get_system_prompt(self) -> str: …

    def parse_tool_call(self, response: str) -> tuple[str, int] | None: …

Interface text:
Code  File  Edit  Selection  View  Go  Run  Terminal  Window  Help
aie-wf-2025-demos
main.py U
local-agent > main.py > roll_dice
master*
AWS: profile:mikegc-Admin
Amazon Q
3.12.8 ('.venv': venv)
AIE
World's Fair
Microsoft
smol ai

### Simple Ollama Agent Demo

The presenter runs the Python agent locally. Its prompt directs it to use a tool for dice rolls, and the terminal waits for a request.

[3:34](https://www.youtube.com/watch?v=HT4l0DeP69I&t=214s) [Code editor showing collapsed agent methods, the main function, and the program entry point.](https://assets.ai.engineer/sites/aiecode2025/sha256/063dfdf20d44272d47b77d24c143b0a7caf41344158ac34b3b118930fceceff7.webp)

class SimpleAgent:
    def get_system_prompt(self) -> str:

Do NOT make up dice roll results. You MUST use the tool to get actual random re[illegible]
Only respond with tool calls when users want to roll dice. For other questions, [illegible]

    def parse_tool_call(self, response: str) -> tuple[str, int] | None: …
    def execute_tool(self, tool_name: str, sides: int) -> str: …
    def chat(self, message: str) -> str: …

def main(): …

if __name__ == "__main__":
    main()

Interface text:
aie-wf-2025-demos
main.py U
local-agent > main.py > SimpleAgent > get_system_prompt
master*  0  0  AWS: profile:mikegc-Admin  Amazon Q  3.12.8 ('.venv': venv)
AIE
Microsoft
smol ai

[3:45](https://www.youtube.com/watch?v=HT4l0DeP69I&t=225s) [A terminal shows a local agent ready for dice-roll requests.](https://assets.ai.engineer/sites/aiecode2025/sha256/211e98fca585a5ec70d4cc0c9da9e8863000e53657ea2047725cd63b7a563135.webp)

class SimpleAgent:
    def get_system_prompt(self) -> str:

Do NOT make up dice roll results. You MUST use the tool to get actual random re[illegible]
Only respond with tool calls when users want to roll dice. For other questions, [illegible]

    def parse_tool_call(self, response: str) -> tuple[str, int] | None: …

mikegc aie-wf-2025-demos % cd ./local-agent/
mikegc local-agent % uv run main.py
🎲 Simple Ollama Agent Demo
Type 'quit' to exit
Try: 'roll a d20', 'roll a dice', 'roll a d12'

Interface text:
aie-wf-2025-demos
main.py U
local-agent > main.py > SimpleAgent > get_system_prompt
PROBLEMS  OUTPUT  TERMINAL  CODE REFERENCE LOG
zsh - local-agent
master*  0  0  AWS: profile:mikegc-Admin  Amazon Q  3.12.8 ('.venv': venv)
AIE
aws

### Dice tool result

The local agent turns an initiative request into a d20 tool call. The tool returns 10, and the agent adds the requested modifier of 5 for a total of 15.

[4:00](https://www.youtube.com/watch?v=HT4l0DeP69I&t=240s) [The agent calls a twenty-sided dice tool, receives 10, and adds a modifier of 5.](https://assets.ai.engineer/sites/aiecode2025/sha256/268a1d023d84bdb1c812ed064beb6ec57310b445b3e0e1fb62fd0a1ebaa2a5c2.webp)

class SimpleAgent:
    def get_system_prompt(self) -> str:

Do NOT make up dice roll results. You MUST use the tool to get actual random re[illegible]
Only respond with tool calls when users want to roll dice. For other questions,

    def parse_tool_call(self, response: str) -> tuple[str, int] | None: …

Agent:
[DEBUG] Model response: TOOL_CALL: roll_dice(20)
[DEBUG] Detected tool call: roll_dice(20)
[DEBUG] Tool result: You rolled a 10.

The result of the initiative roll is a 10. Adding your Dexterity modifier of 5, your total initiativ[illegible] would be 15.

Interface text:
AIE
Microsoft
smol ai
aie-wf-2025-demos
main.py U
local-agent > main.py > SimpleAgent > get_system_prompt
PROBLEMS  OUTPUT  TERMINAL  CODE REFERENCE LOG
zsh - local-agent
master*  0  0  AWS: profile:mikegc-Admin  Amazon Q  3.12.8 ('.venv': venv)

### Dice tool result revisited

The local agent interprets an initiative request, calls a 20-sided dice tool, and adds the Dexterity modifier of 5 to the roll of 10, returning 15.

[4:04](https://www.youtube.com/watch?v=HT4l0DeP69I&t=244s) [The terminal shows the dice tool call and its result of 10, followed by an initiative total of 15.](https://assets.ai.engineer/sites/aiecode2025/sha256/f14612ee2a6fa05e219aaa6857b02940cc9c4a2807c9b0a82d8cd65aa55642c8.webp)

class SimpleAgent:
    def get_system_prompt(self) -> str:

Do NOT make up dice roll results. You MUST use the tool to get actual random re[illegible]
Only respond with tool calls when users want to roll dice. For other questions,

    def parse_tool_call(self, response: str) -> tuple[str, int] | None: …

Agent:
[DEBUG] Model response: TOOL_CALL: roll_dice(20)
[DEBUG] Detected tool call: roll_dice(20)
[DEBUG] Tool result: You rolled a 10.

The result of the initiative roll is a 10. Adding your Dexterity modifier of 5, your total initiative would be 15.

Interface text:
aie-wf-2025-demos
main.py U
local-agent > main.py > SimpleAgent > get_system_prompt
PROBLEMS  OUTPUT  TERMINAL  CODE REFERENCE LOG
zsh - local-agent
master*  AWS: profile:mikegc-Admin  Amazon Q  3.12.8 ('.venv': venv)
AIE
aws
World's Fair

### Amazon Bedrock overview

Bedrock’s overview offers a choice of serverless or Marketplace models and spotlights Claude as the speaker moves from a local agent toward cloud scale.

[4:53](https://www.youtube.com/watch?v=HT4l0DeP69I&t=293s) [Amazon Bedrock overview showing foundation models, navigation, and a Claude model spotlight.](https://assets.ai.engineer/sites/aiecode2025/sha256/8ca57dc637a64847d4382a8900ec5c99ab5993a376e6c1d20031b3a492ea73a2.webp)

Overview

Foundation models
Amazon Bedrock supports over 100 foundation models from industry-leading providers and emerging leaders. Select a serverless model or Bedrock Marketplace model that is best suited for achieving your unique goals.
View Model catalog
Discover marketplace models

Model spotlight
Anthropic's Claude
Choose the exact combination of intelligence, speed, and cost to suit your needs. All of the latest Claude models, like Claude 4, are available in Amazon Bedrock.
Open in chat playground

Interface text:
Amazon Bedrock
Info
Getting started
Overview
Providers
Foundation models
Model catalog New
Marketplace deployments New
Custom models (Distillation, Fine-tuning, Continued pre-training)
Imported models
Prompt Routers
Playgrounds
Chat / Text
Image / Video
Builder tools
Agents
Flows
Knowledge Bases

### Agent outline

The speaker introduces the anatomy of an agent, framing its components as pieces that must run at cloud scale to make the local code production-ready.

[4:59](https://www.youtube.com/watch?v=HT4l0DeP69I&t=299s) [An empty purple box labeled Agent.](https://assets.ai.engineer/sites/aiecode2025/sha256/2edd82b3744e7a42d15ef8339faf7713bcab4b470546b9ccccd43dcc18646ceb.webp)

Agent

[illegible]n Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
6

Interface text:
AIE
Microsoft
smol ai
World’s Fair

### Agent model

The model sits inside the agent and provides natural language understanding. The speaker notes that existing models can be used.

[5:10](https://www.youtube.com/watch?v=HT4l0DeP69I&t=310s) [An Agent box containing a Model component.](https://assets.ai.engineer/sites/aiecode2025/sha256/97413e4625dc6d6c4f076ce0840c7ceede426c7355a6fb68bad5a46ee5cbd9a5.webp)

Agent
Model

[illegible]n Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
6

Interface text:
AIE
World’s Fair
aws

### Agent components

An agent combines a model and prompt with a loop that processes input, evaluates tool results, and decides whether to run another tool.

[5:53](https://www.youtube.com/watch?v=HT4l0DeP69I&t=353s) [An Agent box containing Model, Prompt, and Loop components.](https://assets.ai.engineer/sites/aiecode2025/sha256/1c21fef4a0ca1d0cc7c56ce890a3ae2e933a2532afa6413209c601681b1773ef.webp)

AIE

Agent
Model
Prompt
Loop

[illegible]n Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
6

World’s Fair
aws

[6:13](https://www.youtube.com/watch?v=HT4l0DeP69I&t=373s) [An agent contains a model, prompt, and loop.](https://assets.ai.engineer/sites/aiecode2025/sha256/2661ab5b2e72a2f7cc38e136210ef2900f8afc6081302159ba4a0553331d49ae.webp)

AIE

Agent
Model
Prompt
Loop

[illegible]n Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
6

World’s Fair
Microsoft
smol ai

### Agent components and history

An agent combines a model, prompt, loop, and history. History keeps earlier reasoning and tool results in context for the agent’s next step.

[6:39](https://www.youtube.com/watch?v=HT4l0DeP69I&t=399s) [An agent contains a model, prompt, loop, and history.](https://assets.ai.engineer/sites/aiecode2025/sha256/b9e4fda4bb32170b11c76ef67e14346c5fa3549358f95f1475d99270264d65da.webp)

Agent
Model
Prompt
Loop
History

[illegible] Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
6

AIE
World’s Fair
aws

### Amazon Bedrock Agent

A Bedrock agent connects an LLM to instructions and action groups. The instruction combines with a prompt template; action groups collect tools, shown here with AWS Lambda.

[8:33](https://www.youtube.com/watch?v=HT4l0DeP69I&t=513s) [An LLM icon connects to an empty Amazon Bedrock Agent container.](https://assets.ai.engineer/sites/aiecode2025/sha256/3c6573436d37c1c181a60448f5e10685c61c44e55893fa9f2438d7e745e17131.webp)

Amazon Bedrock Agent

LLM

[illegible] Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
8

AIE
AI Engineer World’s Fair
aws

[9:24](https://www.youtube.com/watch?v=HT4l0DeP69I&t=564s) [An LLM connects to a Bedrock agent containing an instruction and two action groups, each with AWS Lambda.](https://assets.ai.engineer/sites/aiecode2025/sha256/7a03f646b547365d89037412a0ff727a168151b65bfaaef5e606140b37f389f4.webp)

Amazon Bedrock Agent

Instruction
“You are...”

Action Group
AWS Lambda

Action Group
AWS Lambda

LLM

[illegible] Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
10

AIE
AI Engineer World’s Fair
Microsoft
smol ai

### Bedrock Agents overview

The presenter begins creating an agent from an empty Agents list. The overview separates preparation from deployment using aliases.

[11:31](https://www.youtube.com/watch?v=HT4l0DeP69I&t=691s) [The Bedrock Agents page shows an empty agent list and a Create agent button.](https://assets.ai.engineer/sites/aiecode2025/sha256/dd927b0c12337fcc1b7b1a667e1402a0e2fe7f5239fef22af8624928da6a1cf1.webp)

Agents

Overview

Prepare
Create your Agent by selecting a Foundation model, and adding Action groups. After creation you can test out the Agent in real-time and create multiple versions.

Deploy
Create and associate Aliases to deploy an Agent version in your application. Point an Alias to a specific version of your Agent to test it before deploying it to your client application.

Agents (0)
Delete
Edit
Create agent
Find Agents
Name
Status
Description
Last updated
No agents
No agents to display

Interface text:
Amazon Bedrock > Agents
Amazon Bedrock
Getting started
Overview
Providers
Foundation models
Model catalog New
Marketplace deployments New
Custom models (Distillation, Fine-tuning, Continued pre-training)
Imported models
Prompt Routers
Playgrounds
Chat / Text
Image / Video
Builder tools
Agents
Flows
Knowledge Bases

### Configure the game master agent

The presenter names a tabletop RPG agent, selects Claude 3.5 Haiku, and enters game master instructions. The empty action groups section is where they plan to connect code execution.

[11:59](https://www.youtube.com/watch?v=HT4l0DeP69I&t=719s) [The Bedrock Agent builder shows details for a tabletop role-playing agent, service role choices and an empty test panel.](https://assets.ai.engineer/sites/aiecode2025/sha256/11319e55fab3a4f874f79bffa5c1152cd4ddf7f582eb3c909b699586ad8ca933.webp)

Agent builder
Manual | Assistant
Test
Prepare
Save
Save and exit

Agent details
Agent name
 game_master_agent
Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen). The name can have up to 100 characters.

Agent description - optional
An agent to help play ttrpg!
The description can have up to 200 characters.

Agent resource role
Create and use a new service role
Use an existing service role
AmazonBedrockExecutionRoleForAgents_[illegible]

Test Agent
Using ODT Chan[illegible]
Enter your message here
Run

Interface text:
Amazon Bedrock > Agents > game_master_agent > Agent builder: game_master_agent
Notifications: 0 errors, 1 warning, 1 success, 0 information, 0 other
Amazon Bedrock
Getting started
Overview
Providers
Foundation models
Model catalog New
Marketplace deployments New
Custom models (Distillation, Fine-tuning, Continued pre-training)
Imported models
Prompt Routers
Playgrounds
Chat / Text
Image / Video
Builder tools
Agents
Flows
Knowledge Bases

[12:23](https://www.youtube.com/watch?v=HT4l0DeP69I&t=743s) [Agent builder with Claude 3.5 Haiku selected and tabletop game master instructions entered.](https://assets.ai.engineer/sites/aiecode2025/sha256/ecda5aadc4a17007f4037e0416c9a9b8f39e32a8ab2a8a03649e350fac495b93.webp)

Create and use a new service role
Use an existing service role
AmazonBedrockExecutionRoleForAgents_[illegible]

Select model
Claude 3.5 Haiku v1
On-demand

Instructions for the Agent
Provide clear and specific instructions for the task the Agent will perform. You can also provide certain style and tone.
You are a games master who can help me play ttrpg games.
This instruction must have a minimum of 40 characters.

Additional settings

Action groups (0)
Delete
Add
Find action groups
Name
Description
State
Last updated

Test Agent
Using ODT Chan[illegible]
Enter your message here
Run

Interface text:
Amazon Bedrock > Agents > game_master_agent > Agent builder: game_master_agent
Amazon Bedrock
Getting started
Overview
Providers
Foundation models
Model catalog New
Marketplace deployments New
Custom models (Distillation, Fine-tuning, Continued pre-training)
Imported models
Prompt Routers
Playgrounds
Chat / Text
Image / Video
Builder tools
Agents
Flows
Knowledge Bases

## Full transcript

[0:00](https://www.youtube.com/watch?v=HT4l0DeP69I&t=0s) [upbeat music] Um, yeah. So my name's Mike Chambers.

[0:16](https://www.youtube.com/watch?v=HT4l0DeP69I&t=16s) I'm gonna pick you up a little bit there. So I'm from Queensland in the eastern part of Australia, but that's okay. Um, yeah, very happy to be here. So I'm a developer advocate for Amazon Web Services, um, and I completely and utterly and only and totally ge- uh, spec- uh, specialize in generative AI.

[0:32](https://www.youtube.com/watch?v=HT4l0DeP69I&t=32s) Used to be machine learning, now it's generative AI. Um, I'll be talking about why this slide is up here in a moment. Any tabletop RPG players in the room?

[0:40](https://www.youtube.com/watch?v=HT4l0DeP69I&t=40s) There's got to be at least one or two. There are some. Randall, you were saying you were before. Okay. It doesn't matter if you don't get that. But I will be showing some code, um, and what I'm gonna be showing is how to get the code and how to get into production.

[0:52](https://www.youtube.com/watch?v=HT4l0DeP69I&t=52s) So if you're a developer, this is how you can get your code and get it to cloud scale. If you're a leader, then this is how you can get your developers to get their code and get it into cloud scale.

[1:01](https://www.youtube.com/watch?v=HT4l0DeP69I&t=61s) Um, just a little bit about the kinds of things that I've done in the past. Um, so, um, I was incredibly fortunate a couple of years ago to work with Dr.

[1:09](https://www.youtube.com/watch?v=HT4l0DeP69I&t=69s) Dr. Andrew Ng, um, and some colleagues from, um, AWS on this course. This is the Fundamentals of LLMs. Um, over three hundred and seventy thousand people have taken this course so far.

[1:20](https://www.youtube.com/watch?v=HT4l0DeP69I&t=80s) It was the first of its course of its kind. I also got to play, um, Transformers with Andrew, which is cool, and if you get the reference there, I'm playing with Transformers.

[1:29](https://www.youtube.com/watch?v=HT4l0DeP69I&t=89s) Okay. And if you don't know who this is, um, that's Optimus Prime. Okay. [laughs] I think I'm holding, um, I can't... What's the other one called? Um, is it... Anybody?

[1:40](https://www.youtube.com/watch?v=HT4l0DeP69I&t=100s) Megatron. Megatron. Thank you. Yes. I ca- Yes, that's right. Um, so, um, let me jump into it. Let me jump straight into it. Um, some of you saw that code was coming, and code is coming.

[1:50](https://www.youtube.com/watch?v=HT4l0DeP69I&t=110s) Now, everything I'm gonna show is pre-recorded 'cause Wi-Fi, right? We know that. Um, but everything that I'm showing also is in real time. So what I wanna show first of all is just something super, super simple.

[2:01](https://www.youtube.com/watch?v=HT4l0DeP69I&t=121s) This is a single Python functio... a single Python file, um, which contains an agent, right? And it's the agent I'm going to use for the demonstration moving forward. This is where we get to dice rolling and T- TRPG, and the idea here is that I wanna do a simple agent with a simple tool that's not getting the

[2:18](https://www.youtube.com/watch?v=HT4l0DeP69I&t=138s) weather. 'Cause we know how to do that. Um, so in this code here, it doesn't use any frameworks or anything at all. It's actually kind of inefficient. Um, but I have this one, what we'd call a tool here.

[2:30](https://www.youtube.com/watch?v=HT4l0DeP69I&t=150s) This is my tool. Um, it's how to roll a dice. Essentially, it's a random number generator, um, but, uh, I'm calling it a dice roller. Um, and you can see here, um, if you, if you're, uh, familiar with this, it's using Ollama, um, and it's using the, um, uh, the Llama three point one, eight billion parameter model.

[2:48](https://www.youtube.com/watch?v=HT4l0DeP69I&t=168s) Super tiny, just running on my laptop. This is literally an agent running on my machine. Um, so if we skip through here, I've got some things which I've sort of collapsed down for brevity.

[3:00](https://www.youtube.com/watch?v=HT4l0DeP69I&t=180s) This is a simple agent. It's an agentic flow. We're gonna talk more in detail about what agents are in a moment. I have my system prompt where I tell it, um, what tools it's got available.

[3:10](https://www.youtube.com/watch?v=HT4l0DeP69I&t=190s) Um, I then also actually do include some examples as well. The reason I include examples, again, it's a tiny little model, and it just needs a little bit of a helping hand to understand how to use these tools, um, for example, to roll a D20.

[3:23](https://www.youtube.com/watch?v=HT4l0DeP69I&t=203s) A D20, this is gonna come up again in this session, so I'll tell you now. It's a twenty-sided dice. Um, if you wanna get one, we have them on the AWS stand.

[3:31](https://www.youtube.com/watch?v=HT4l0DeP69I&t=211s) Come and see us afterwards. You can have an IRL D20. But we're going to have an agent which will roll it for us. Um, so, um, let's just open up the terminal.

[3:40](https://www.youtube.com/watch?v=HT4l0DeP69I&t=220s) I'm just going to run this locally so you can see the kinds of things that my agency's go- uh, agent is gonna do. Um, so I'm just running my Python code here, um, and you can see it's waiting for my prompt.

[3:49](https://www.youtube.com/watch?v=HT4l0DeP69I&t=229s) So I'm going to... or waiting for my input. I'm going to tell it, um, okay, this is some terminology here from gameplay. Um, roll for initiative and add a dexterity modifier of five.

[3:59](https://www.youtube.com/watch?v=HT4l0DeP69I&t=239s) That means something to the few people that put their hands up in the room. Um, but it basically means that what I've done is I've passed in my natural language into the agent.

[4:09](https://www.youtube.com/watch?v=HT4l0DeP69I&t=249s) It's used its large language model and its language understanding to figure out what I meant by that. It's then looked at the tools that it's got available. The tool it has available is to roll a dice, and then it's performed that action, and then we've got an outcome here.

[4:23](https://www.youtube.com/watch?v=HT4l0DeP69I&t=263s) So it's rolled a D20. Um, it's come back with a random number of ten. It's added five to it. I've got my output of fifteen. So this is a simple, really simple expli...

[4:33](https://www.youtube.com/watch?v=HT4l0DeP69I&t=273s) uh, example of what an agent... how an agent's structured and what an agent can do. I know it's just a random number generator, but I think it's pretty exciting.

[4:43](https://www.youtube.com/watch?v=HT4l0DeP69I&t=283s) So I wanna take this code though, which is all running on my machine at really low scale, and I want to make this, uh, cloud scale. I wanna get this production ready.

[4:53](https://www.youtube.com/watch?v=HT4l0DeP69I&t=293s) So that's what I'm going to look at next. So let's, um... Yes, let's get back into slides just for one moment, and I wanna talk about the anatomy of an agent.

[5:02](https://www.youtube.com/watch?v=HT4l0DeP69I&t=302s) We've just looked at it running there, but let's look at the anatomy of an agent. And as we're doing this, each one of these things, uh, we actually have to get into the cloud, running at cloud scale, so that this is the components that we need to scale.

[5:15](https://www.youtube.com/watch?v=HT4l0DeP69I&t=315s) And so the first thing, I think it's probably the obvious thing, is the model. This is actually super simple and super easy for us to do, um, as in they exist already, so we can just go ahead and use those.

[5:25](https://www.youtube.com/watch?v=HT4l0DeP69I&t=325s) But this is our natural language understanding. Of course, we need this to be able to run our agent. Um, the next thing that I've got on my list, and this is my list.

[5:34](https://www.youtube.com/watch?v=HT4l0DeP69I&t=334s) There's probably other things you could add to this, but I think this is a minimum list that you need for an agent. Uh, you need a prompt. So you need something to explain to the agent why it exists in the world and what kinds of things it can do.

[5:45](https://www.youtube.com/watch?v=HT4l0DeP69I&t=345s) Give it a personality, for example. Um, next, a loop. So this is the agentic loop. So this is the ability for the agent to be able to, um, think essentially.

[5:56](https://www.youtube.com/watch?v=HT4l0DeP69I&t=356s) So it, it looks at the input, and it can then process that input. It then needs to go and use a tool. But then it needs to evaluate whether that tool actually answered the question or not.

[6:05](https://www.youtube.com/watch?v=HT4l0DeP69I&t=365s) It needs to figure out if it needs to go and run another tool. It needs to loop around. It really is nothing much more than a, a while statement, if, while, whatever, with some strings flowing around.

[6:15](https://www.youtube.com/watch?v=HT4l0DeP69I&t=375s) A lot of this stuff is just string manipulation, but we need that to be-

[6:19](https://www.youtube.com/watch?v=HT4l0DeP69I&t=379s) Hosted and, and cloud scale. Next up, history. This is a really important one actually, and I've had a couple of deep conversations about this recently. Um, when I say history, and I t- talk about conversational history, people think of that as like, okay, well, I'm asking my agent to do something today, and tomorrow I want it to

[6:36](https://www.youtube.com/watch?v=HT4l0DeP69I&t=396s) remember what I asked it yesterday. It's actually a little bit more deeper than that. The actual conversational history inside of an agent is, is crucial to the running of the agent.

[6:46](https://www.youtube.com/watch?v=HT4l0DeP69I&t=406s) So when we ask it that question, uh, such as rolling, you know, rolling for initiative or whatever it might be, um, that goes in, and then it does some reasoning steps, right?

[6:55](https://www.youtube.com/watch?v=HT4l0DeP69I&t=415s) It decides what it wants to do, and then it goes and calls a tool, and the results, the stuff that we're talking about before in the loop. But it needs to remember those things that it's, that it's done so that, um, it- each next step, it can do that within the context, um, of what it's done before.

[7:12](https://www.youtube.com/watch?v=HT4l0DeP69I&t=432s) So history is... and conversational history at a low level is actually really important. Um, and then finally, I'm gonna have tools here. So these are, of course, uh, how our agent has agency to be able to go and perform something in the outside world.

[7:27](https://www.youtube.com/watch?v=HT4l0DeP69I&t=447s) So another important part. Are there other components of agents? Probably, yes. Yes, there absolutely are. But this, I think, is the base fundamentals. You need these things in order to be able to have a, the minimal viable product, I guess, of a, of an agent.

[7:41](https://www.youtube.com/watch?v=HT4l0DeP69I&t=461s) So I'm here from AWS. Let me tell you about what AWS can do to host these agents at cloud scale. The first one, I mentioned it before as being easy.

[7:51](https://www.youtube.com/watch?v=HT4l0DeP69I&t=471s) Obviously, anybody who works for a model or a bo- laboratory would say actually making agents-- uh, making models is actually kind of tricky. But they've done it for us, right?

[7:59](https://www.youtube.com/watch?v=HT4l0DeP69I&t=479s) So the models exist. We've got Anthropic, we've got Amazon Nova model, and this icon here represents Amazon Bedrock. So Bedrock is a suite of capabilities that allow us to be able to build, uh, generative components into the applications that we're building.

[8:15](https://www.youtube.com/watch?v=HT4l0DeP69I&t=495s) So we can just take these components, slot them in, and build something. We have models from a number of different leading providers. Amazon, like I said, Anthropic, Meta, Mistral, um, AI21 Labs.

[8:27](https://www.youtube.com/watch?v=HT4l0DeP69I&t=507s) We have a number of different models available. You can plug them into your system. So that's the kind of the easy bit. Um, let's now build up the actual agent itself.

[8:36](https://www.youtube.com/watch?v=HT4l0DeP69I&t=516s) And so for that, I have Amazon Bedrock Agents, and Amazon Bedrock Agents is fully managed. There's no infrastructure to manage with this. You can just put your configuration in, and it will be cloud scale.

[8:47](https://www.youtube.com/watch?v=HT4l0DeP69I&t=527s) So the answer to the question that I'm here to answer is actually really straightforward. We're just gonna go and use this service. Now, inside of that, we have, uh, the configuration that we're gonna have for our agent.

[8:57](https://www.youtube.com/watch?v=HT4l0DeP69I&t=537s) Now, um, I have put here instruction. Instruction is the terminology we use. This is, again, the personality of the agent. It's a bit like the prompt. It's not quite the prompt because it gets combined with a prompt template to be the actual prompt.

[9:11](https://www.youtube.com/watch?v=HT4l0DeP69I&t=551s) But this essentially, for all intents and purposes, is our prompt. That prompt template, by the way, if you're interested, you can absolutely go and edit that if you want.

[9:19](https://www.youtube.com/watch?v=HT4l0DeP69I&t=559s) But you get delivered a default prompt template with the model that you've selected. Um, then we need to ha-- well, all of those things I talked about with the, the loop and the history, conversational history, it's all taken care of, so that's all just inside of the service.

[9:34](https://www.youtube.com/watch?v=HT4l0DeP69I&t=574s) But then from our configuration standpoint, the next thing is the action group. So this is where we connect into tools. So an action group is a collection of tools.

[9:43](https://www.youtube.com/watch?v=HT4l0DeP69I&t=583s) That's what you can see that as. I've got a couple of different action groups here just to show that you can have more than one. We only need one because I only have one dice rolling tool.

[9:53](https://www.youtube.com/watch?v=HT4l0DeP69I&t=593s) Um, and you see in the middle here, we've got Lambda. So hopefully you're familiar with Lambda. It's a, a function as a service. It scales super well. It handles that scaling for you.

[10:03](https://www.youtube.com/watch?v=HT4l0DeP69I&t=603s) It's just the way the service works. And it's a perfect place to host these kinds of tools. And therefore, your tools can do anything that Lambda can do. Which is, I mean, I'd be interested if you can find a use case that Lambda can't do.

[10:17](https://www.youtube.com/watch?v=HT4l0DeP69I&t=617s) There are some. But anything, anything that your code can do in there, um, your tool can do, including reaching out to the outside world, reaching to other AWS services, sending an email, launching a rocket, whatever it is that you wanna do.

[10:30](https://www.youtube.com/watch?v=HT4l0DeP69I&t=630s) Actually, I'd really like to see launching a rocket. So I say that from time to time. We need to go do that. We need to build that. So I've whistle-stop toured through those components.

[10:40](https://www.youtube.com/watch?v=HT4l0DeP69I&t=640s) The important things to remember there are the action groups, really, 'cause that's maybe terminology you haven't come across before. Um, so now I'm going to dive into the console, and we're gonna build this.

[10:51](https://www.youtube.com/watch?v=HT4l0DeP69I&t=651s) Again, this is all real time. I'm advancing it forward with my clicker, right? But, but in between those things, it's all real time. There are some people in the room that are now saying, "Well, hang on a minute.

[11:00](https://www.youtube.com/watch?v=HT4l0DeP69I&t=660s) You were saying ship this to production. I'm not gonna ship to production with ClickOps. That's awful." And you're right, it is. And so all the things that I'm gonna show you are all possible as well with Terraform or Pulumi or CloudFormation or SDK or SAM or whatever infrastructure as code framework that you wanna use.

[11:18](https://www.youtube.com/watch?v=HT4l0DeP69I&t=678s) So bear that in mind. But I'm showing you in the console 'cause it's easier to look at. All right. So what I need to do is just, uh, I'm at the Amazon Bedrock part of the AWS console page.

[11:30](https://www.youtube.com/watch?v=HT4l0DeP69I&t=690s) I've gone down to Agents on the bottom of the left or down on the left-hand side, and this next little part's going to be very bouncy ball, kind of easy stuff.

[11:40](https://www.youtube.com/watch?v=HT4l0DeP69I&t=700s) I'm gonna click Create a agent. Okay. So then I get to name it, and I get to give it a description so that six months from now, when I go into my console, and I was like, "What was that agent for?"

[11:49](https://www.youtube.com/watch?v=HT4l0DeP69I&t=709s) I say, "Oh, that's what that agent's for." So it's always a good idea to use descriptions in anything you do inside of AWS. So, um, I'm saying it's an agent to help me play tabletop RPG.

[12:00](https://www.youtube.com/watch?v=HT4l0DeP69I&t=720s) If those are the questions you have, by the way, we can definitely go to the booth afterwards. We can talk a lot about this kind of stuff. Um, so I've got that set up.

[12:08](https://www.youtube.com/watch?v=HT4l0DeP69I&t=728s) Um, I scroll down. You remember one of the pieces of configuration that we needed was to connect it to our model. And so I get to choose models here.

[12:16](https://www.youtube.com/watch?v=HT4l0DeP69I&t=736s) I've got the Amazon Nova models. I'm gonna select the Anthropic, um, Haiku 3.5, 3.5 Haiku. Um, it's a small, it's a capable model. It's fast. It's probably more than we need for this very simplistic, um, agent, but it's a good one.

[12:31](https://www.youtube.com/watch?v=HT4l0DeP69I&t=751s) And so Here, I'm adding in those instructions. If you remember before, the instructions get combined with the template to become the actual prompt. So you're a games master who can help me play tabletop RPG games.

[12:44](https://www.youtube.com/watch?v=HT4l0DeP69I&t=764s) That's probably what you're gonna take away from this, right? Everybody's gonna go away and start playing, um, these games. Um, so I've defined what I want my agent to be.

[12:51](https://www.youtube.com/watch?v=HT4l0DeP69I&t=771s) So I click Save so that I've got it ready to go, and the next thing I have to do is action groups. So once we've done that... Yes, so we go and we scroll down to action groups, and this is where I'm going to connect in my logic with, um, the code execution that we were talking about

[13:07](https://www.youtube.com/watch?v=HT4l0DeP69I&t=787s) before. So let's click Add. Guess what? It wants a name and a description. We're familiar territory here. Um, and so we can give it this description. Now, these descriptions are read by the large language model so that it can figure out what this tool is for.

[13:22](https://www.youtube.com/watch?v=HT4l0DeP69I&t=802s) Um, and this is sort of this new paradigm of programming, right? So in terms of definitions and schemas for how these things work, we actually write in natural language in here so that LLM can read it and figure out if that's what they wanna do, or what...

[13:35](https://www.youtube.com/watch?v=HT4l0DeP69I&t=815s) That, that's what they wanna use. So we've got our action group as a whole. Now let's go and add in the actual code. We have a few different options here, and this option here is the recommended one, which is to use Lambda, which we saw in that diagram before.

[13:49](https://www.youtube.com/watch?v=HT4l0DeP69I&t=829s) Also, with this quick start here, it'll set up the Lambda function for you, it'll do all the commu- uh, the permissions for you, um, and it will hook it up to the agent for you.

[13:58](https://www.youtube.com/watch?v=HT4l0DeP69I&t=838s) So it's a really quick way to get started. Definitely recommend using that. Um, and now we come down to define the actual tool itself that we want. This is my dice roll or my roll dice.

[14:09](https://www.youtube.com/watch?v=HT4l0DeP69I&t=849s) I can... I, I flip between the two. This one's gonna be called Roll Dice. And again, we're giving it a description. This description's important because it tells the LLM what, uh, what this does and whether it wants to use it or not.

[14:21](https://www.youtube.com/watch?v=HT4l0DeP69I&t=861s) Um, and so it's got, you know, roll the dice with a certain number of sides. So we need a way to pass in those certain number of sides. This was all in the code before as well.

[14:30](https://www.youtube.com/watch?v=HT4l0DeP69I&t=870s) Um, and so if I scroll down here, I get the parameters, and I get to, again, just describe these parameters that I want. Just expanding this out because I'm zoomed in for the screen's sake, um, and I get to add in my parameter.

[14:42](https://www.youtube.com/watch?v=HT4l0DeP69I&t=882s) And guess what? I give it a name [laughs] and I give it a description, and again, the description is something which is read by the large language model. We're following the pattern here, right?

[14:49](https://www.youtube.com/watch?v=HT4l0DeP69I&t=889s) So it knows what this is for. Um, and I'm going to set this up as an integer value because I only have a, a, you know, an integer number of sides on any dice.

[14:59](https://www.youtube.com/watch?v=HT4l0DeP69I&t=899s) Um, and I'm gonna say it's required. I need this to be there. I need to tell the model that if you're using this tool, you must provide me with an integer for that.

[15:08](https://www.youtube.com/watch?v=HT4l0DeP69I&t=908s) Okay. I know I'm going fast, but I'm respectful of your time, and I wanna show you this working. So let's click Create. Again, this is real time. It's gonna go ahead and build that Lambda function for me, integrate the permissions for me, and have everything set up.

[15:22](https://www.youtube.com/watch?v=HT4l0DeP69I&t=922s) And so once I save this and scroll down, I can get back to my action group, dive into my action group again, and what I have inside of there is now a link to the Lambda function.

[15:34](https://www.youtube.com/watch?v=HT4l0DeP69I&t=934s) So code's coming back, and we just need to put this logic into our Lambda function so it can work for us. Now, I'm gonna do a little bit of quick and dirty here.

[15:42](https://www.youtube.com/watch?v=HT4l0DeP69I&t=942s) I'm gonna take the boilerplate that it provided for me, and I'm just gonna whack in some, um, function to allow us to do this dice roll. Um, so here's my Python inside my Lambda function.

[15:52](https://www.youtube.com/watch?v=HT4l0DeP69I&t=952s) So this is just inside the console. You'll notice that as I'm coding here, um, Amazon Q Developer is actually built into the console, into this code editor, and it'll be making suggestions for me in terms of what code I might wanna put in.

[16:05](https://www.youtube.com/watch?v=HT4l0DeP69I&t=965s) So I'm going to import random, which of course is necessary. If you're familiar with Lambda already, then you'll know that you get this event that comes in, and that event sort of triggers how this thing is gonna work.

[16:16](https://www.youtube.com/watch?v=HT4l0DeP69I&t=976s) Um, and we have here a function which is passed in, so it's telling us which function we wanna use, um, and it sends in some parameters as well. So let's, um, rattle through putting some code in.

[16:26](https://www.youtube.com/watch?v=HT4l0DeP69I&t=986s) I'm gonna say, okay, well, if the function that we're calling is roll dice, um, then I wanna basically go and grab the number of sides, generate my random number, and off I go.

[16:37](https://www.youtube.com/watch?v=HT4l0DeP69I&t=997s) So with it being real time, you have to wait for me to actually type, um, which is the way it is, and you also have to wait for me to paste this one because I'm less good at doing this one by hand.

[16:47](https://www.youtube.com/watch?v=HT4l0DeP69I&t=1007s) Um, but in it comes, and we're nearly there.

[16:52](https://www.youtube.com/watch?v=HT4l0DeP69I&t=1012s) So the next thing I need to do is just format my response. So my response body here is going to have my, um, my random number generated. In this particular case, Q Developer, um, inside of this IDE knows exactly what I wanna do by this point, 'cause it...

[17:07](https://www.youtube.com/watch?v=HT4l0DeP69I&t=1027s) I know you, you wanna play RPG. Um, so it's written the code for me, so I can just tab select, tab complete on that. Um, and then with a little bit of tidy up just so that it works with the boilerplate that was there, just gonna indent that.

[17:21](https://www.youtube.com/watch?v=HT4l0DeP69I&t=1041s) Um, then I can go ahead and click the Deploy button, um, and that's all I need to do. So now I can go and click the Deploy button. Excellent.

[17:30](https://www.youtube.com/watch?v=HT4l0DeP69I&t=1050s) And that's all I need to do. So that Lambda function now is being saved into Lambda environment. That's all you need to do. Everything should be ready to go.

[17:37](https://www.youtube.com/watch?v=HT4l0DeP69I&t=1057s) So if I go back to my agent, um, I'm going to... I have to prepare my agent. And I just wanna talk through this for just one moment. Um, this is a production-ready environment, right?

[17:47](https://www.youtube.com/watch?v=HT4l0DeP69I&t=1067s) So we have the agent, and then we have alias IDs in here. We've got the whole, um, software development lifecycle thing going on, so you can have different aliases as you're, um, uh, publishing out your agents.

[17:59](https://www.youtube.com/watch?v=HT4l0DeP69I&t=1079s) Um, but once we've prepared that, we should be able to test it over on the right-hand side. And so let's ask it the question. I'm gonna be a little bit more flowery language in this case because we want to, um, stretch the model a tiny bit.

[18:13](https://www.youtube.com/watch?v=HT4l0DeP69I&t=1093s) We're not really stretching anything at all. Um, and as soon as we've got this and I figured out how to spell initiative, um, it will roll the dice for us.

[18:22](https://www.youtube.com/watch?v=HT4l0DeP69I&t=1102s) And as you might expect, it's gonna work. But what's happening here is that this agent is now fully hosted in a fully managed environment. It's gonna work for us at cloud scale, and our answer comes back with a quick 15.

[18:34](https://www.youtube.com/watch?v=HT4l0DeP69I&t=1114s) I just wanna go and wrap, wrap this up then. Um, if you're interested in learning more about this. So I mentioned before about the courses we have on DeepLearning.AI.

[18:44](https://www.youtube.com/watch?v=HT4l0DeP69I&t=1124s) These courses are totally free. You get a free AWS environment to be able to play around with Amazon Bedrock Agents completely risk-free. I'll put this QR code back up in a moment as well.

[18:54](https://www.youtube.com/watch?v=HT4l0DeP69I&t=1134s) Um, thank you so much. Um, so please come and talk to me following my prompt template. If you wanna talk about anything more than just this at cloud scale, MCP servers at cloud scale, I definitely wanna talk to you.

[19:07](https://www.youtube.com/watch?v=HT4l0DeP69I&t=1147s) If you wanna talk about our new open source SDK for developing model first agents, this is the stuff I hadn't got time to fit into this presentation. Um, if you want an in real life [laughs] D20, then come and join me on the AWS stand in the expo hall.

[19:21](https://www.youtube.com/watch?v=HT4l0DeP69I&t=1161s) If you wanna talk about anything else, then thank you so much for your time, and I will let you get to lunch. [audience applauding] [upbeat music]
