TRANSCRIPTEnglish

AWS Certified Generative AI Developer - Professional: Multi-step tool calls + tracing

5m 23s864 words135 segmentsEnglish

FULL TRANSCRIPT

0:06

Day 20, multi-step tool calls and

0:08

tracing. Day 20 is where AWS stops

0:12

testing whether you can design agents

0:13

and starts testing whether you can debug

0:15

them in the real world because a system

0:17

you can't see inside is a system you

0:19

can't trust, fix, or ship.

0:22

Imagine this. A country runs an AI power

0:24

grid operator agent. Its job is to

0:27

detect outages, identify affected

0:29

regions, check safety rules, dispatch

0:31

repair crews, and notify authorities.

0:34

This is not one API call. It's a chain

0:36

of decisions and actions. One night,

0:38

something goes wrong. The agent

0:40

dispatches the wrong crew. It repeats

0:42

the same API call. It takes 45 seconds

0:45

to respond. Management asks one

0:47

question. Why did the agent do that? And

0:50

suddenly, you realize something

0:51

terrifying. Without tracing, you have no

0:54

idea.

0:55

Let's make this clear. Multi-step tool

0:58

calls mean the agent is calling multiple

1:00

tools in sequence where each result

1:01

changes what happens next. This is not a

1:04

static workflow. This is not a batch

1:06

job. This is not parallel execution. It

1:09

is dynamic, stateful, and

1:10

decision-driven. And that's exactly why

1:13

it breaks in surprising ways. Here's a

1:15

simple example. A user says, "Restore

1:17

power to the affected suburbs." The

1:19

agent does not solve this in one step.

1:22

It calls a tool to detect the outage,

1:24

then a tool to find affected regions,

1:26

then a tool to check safety rules, then

1:29

a tool to dispatch a repair crew, then a

1:32

tool to notify authorities. Each step

1:34

depends on the previous one. If step two

1:37

is wrong, everything after it is wrong.

1:39

This is why multi-step agents are

1:41

powerful and dangerous at the same time.

1:43

Now, lock this loop into your head. A

1:46

goal comes in. The planner decides the

1:48

next step. A tool is called. The tool

1:50

returns structured output. The agent

1:52

observes the result. Memory is updated.

1:55

Then the planner decides again. Agents

1:57

loop. They don't run once and stop. If

1:59

you understand that loop, you understand

2:01

why tracing is mandatory. Here's the

2:04

brutal truth AWS wants you to

2:06

internalize.

2:07

If something goes wrong, you must be

2:09

able to answer which tool was called,

2:12

with what input in what order, how long

2:15

did each step take, which step failed,

2:17

did the agent retry, did it loop? If you

2:20

can't answer those questions, the system

2:21

is unownable. AWS exams quietly reward

2:24

engineers who think this way. So, what

2:26

does tracing mean in AWS terms? Tracing

2:29

means endto-end visibility across the

2:31

entire agent flow. You can see LLM

2:34

decisions, tool calls, Lambda

2:36

executions, retries, timeouts, and

2:38

failures. Tracing lets you reconstruct

2:40

exactly what the agent did and why it

2:42

did it. In AWS, this is built from three

2:46

pillars. Cloudatch logs capture tool

2:48

inputs, outputs, and errors. AWS X-Ray

2:52

gives you distributed traces showing

2:54

latency and dependencies across steps,

2:56

and structured logging ties everything

2:58

together using trace IDs and correlation

3:00

IDs. These are not optional in

3:02

production and they are absolutely

3:04

exam-friendly answers. Here's what AWS

3:06

expects you to log for each tool call.

3:09

You log a trace ID so steps can be

3:11

linked. You log the step number. You log

3:13

the tool name. You log the input

3:15

parameters. You log the output status.

3:17

You log latency in milliseconds. And you

3:19

log error codes if anything fails. With

3:22

that, you can debug, replay, audit, and

3:24

even analyze cost. Without it, you are

3:27

guessing. Let's talk about the failures

3:29

AWS loves to test. First, infinite

3:32

loops. The symptom is simple. The same

3:35

tool keeps getting called. The cause is

3:37

almost always the same. Memory isn't

3:39

updated or the tool result is ignored.

3:42

The fix is not a better prompt. The fix

3:44

is updating memory after each step and

3:46

enforcing a maximum number of steps.

3:48

Second, slow responses. The agent takes

3:51

too long. This usually comes from too

3:54

many steps, slow tools, or no streaming.

3:57

The fix is to stream partial responses,

3:59

cache tool results, and reduce

4:01

unnecessary steps. AWS wants you to

4:03

optimize architecture, not just models.

4:06

Third, wrong actions. The agent executes

4:09

the wrong tool. This happens when tool

4:11

schemas are unclear, tool names are

4:12

ambiguous, or the planner lacks facts.

4:15

The fix is improving tool descriptions,

4:17

adding rag before planning, and

4:19

validating tool outputs. Again, not a

4:21

bigger model. Here's something subtle

4:24

AWS loves. Tracing is not just for

4:26

debugging. Tracing also shows you which

4:29

steps cost the most, which tools

4:31

dominate latency, and where token usage

4:33

spikes. If the exam asks, "How do you

4:36

identify bottlenecks in an agent?" The

4:39

answer is not guessing. The answer is

4:41

tracing and logs. Now, watch for the

4:43

traps. Do not use a bigger model to

4:45

debug behavior. Do not add more prompts

4:48

to understand failures. Do not rely on

4:51

chat history as tracing. None of those

4:53

give you observability. Only structured

4:55

logs and distributed tracing do. Here is

4:58

the one sentence to memorize. Multi-step

5:00

agents must be traceable or they are

5:02

unfixable. Say that once and day 26.

5:06

Final self test. An agent calls several

5:09

tools dynamically and sometimes fails in

5:11

production. How do you determine where

5:13

it failed? Add structured logging and

5:16

distributed tracing using Cloudatch and

5:18

X-Ray. That's day 20 mastered.

UNLOCK MORE

Sign up free to access premium features

INTERACTIVE VIEWER

Watch the video with synced subtitles, adjustable overlay, and full playback control.

SIGN UP FREE TO UNLOCK

AI SUMMARY

Get an instant AI-generated summary of the video content, key points, and takeaways.

SIGN UP FREE TO UNLOCK

TRANSLATE

Translate the transcript to 100+ languages with one click. Download in any format.

SIGN UP FREE TO UNLOCK

MIND MAP

Visualize the transcript as an interactive mind map. Understand structure at a glance.

SIGN UP FREE TO UNLOCK

CHAT WITH TRANSCRIPT

Ask questions about the video content. Get answers powered by AI directly from the transcript.

SIGN UP FREE TO UNLOCK

GET MORE FROM YOUR TRANSCRIPTS

Sign up for free and unlock interactive viewer, AI summaries, translations, mind maps, and more. No credit card required.