TRANSCRIPTEnglish

AWS Certified Generative AI Developer - Professional: Build an agent + Lambda tool

5m 22s847 words132 segmentsEnglish

FULL TRANSCRIPT

0:06

Day 18, build an agent plus a Lambda

0:08

tool. Day 18 is where AWS tests whether

0:11

you understand a very strict rule. The

0:13

LLM is allowed to think. Only Lambda is

0:16

allowed to touch real systems. That

0:18

separation is the entire point of this

0:21

day. Imagine this. A large hospital

0:24

deploys an AI assistant called the

0:26

hospital bed manager. Doctors and nurses

0:28

ask it things like, "Is there a free bed

0:30

in cardiology? Reserve a bed for an

0:33

incoming patient. Notify the correct

0:35

ward." If this assistant guesses

0:37

availability, people get delayed care.

0:40

If it hallucinates reservations, the

0:42

hospital descends into chaos. So, the

0:44

hospital makes one rule very clear. The

0:46

AI can plan, but only real systems are

0:49

allowed to decide the truth. This is

0:51

what AWS means by agent plus lambda

0:54

tool. An agent is not a single call. It

0:56

is a loop. The LLM plans the next step.

0:59

A Lambda tool executes a real action.

1:01

The tool returns structured results. The

1:03

LLM observes those results and decides

1:05

what to do next. And the loop continues

1:08

until the task is complete. The key exam

1:10

idea is this. Tool outputs are the

1:13

source of truth. The LLM must never fake

1:15

them. Now picture the clean examfriendly

1:18

architecture. A client, web or voice,

1:21

sends a request through API gateway.

1:24

That request goes to an agent

1:26

orchestrator, usually another Lambda or

1:28

application service. The orchestrator

1:30

talks to Bedrock where the LLM acts as

1:32

the planner. When an action is required,

1:34

the orchestrator invokes a Lambda tool.

1:37

That Lambda touches the database or

1:38

internal API. Results flow back. The

1:41

agent decides the next step. Finally, a

1:44

response is returned to the client.

1:46

Every part has a role. Nothing overlaps.

1:50

Let's be very clear about who does what.

1:52

The bedrock model interprets the user's

1:54

goal. It decides which tool to call and

1:56

in what order. It writes the final

1:58

userfacing response. The Lambda tool

2:01

performs the real work. It queries

2:03

databases. It calls internal APIs. It

2:05

reserves resources. The orchestrator

2:07

enforces the loop. It manages retries.

2:10

It handles timeouts. It applies safety

2:12

and control. This separation is exactly

2:15

what AWS wants you to describe. Now,

2:17

let's talk about what a Lambda tool must

2:19

look like. In AWS's mental model, tools

2:22

return structured JSON, always, not

2:24

pros, not explanations, not friendly

2:27

text. For example, a bed availability

2:30

tool returns a clear result, a status, a

2:32

count of available beds, the ward name,

2:35

a timestamp. This structure is not

2:37

optional. It's how the agent stays

2:38

deterministic. AWS expects you to follow

2:41

strict tool rules. Tools never return

2:43

free form text. They always include

2:45

status and error codes. They validate

2:48

inputs. They run with least privilege IM

2:50

roles. They log every invocation and

2:53

they are item potent. So retries are

2:55

safe. These details matter in exam

2:58

questions. Now let's walk through a real

3:00

request. A nurse says find a bed for a

3:03

patient in cardiology and reserve it if

3:05

available. The agent does not guess. The

3:08

planner thinks. First check bed

3:10

availability in cardiology. If beds are

3:12

available, reserve one. Then notify the

3:14

ward. The executive. The Lambda tool

3:17

runs those steps. One Lambda checks the

3:19

real database. Another Lambda writes the

3:22

reservation. The LLM never invents

3:24

numbers. It only reacts to tool output.

3:27

Finally, the assistant responds, "Bedb

3:29

14 and cardiology has been reserved. The

3:31

ward has been notified." That response

3:33

is grounded in real system calls. Why

3:36

does AWS love Lambda as the tool layer?

3:39

Because Lambda creates a clean security

3:41

boundary. It integrates easily. It works

3:44

cleanly with IM. It logs automatically.

3:47

It supports retries and timeouts. It can

3:49

run inside a VPC to reach private

3:51

systems. If the exam mentions calling

3:54

internal APIs, touching databases, or

3:56

performing actions securely, Lambda

3:58

tools are a top tier answer. Error

4:01

handling is also exam relevant. If a

4:03

tool times out or fails, the

4:05

orchestrator retries, the LLM is told

4:07

the tool failed and can choose a

4:08

fallback. If there's an access denied

4:11

error, the fix is IM, not prompting. If

4:14

a tool returns invalid JSON, it's

4:16

treated as a failure. The LLM never

4:18

makes up missing tool results. AWS also

4:21

cares deeply about observability. You

4:23

must be able to answer which tool was

4:25

called, with what parameters, how long

4:28

it took, what it returned, which user

4:30

triggered it. This is done with

4:32

Cloudatch logs and X-ray tracing.

4:34

Especially when agents perform multiple

4:36

steps, tracing becomes essential. Now,

4:39

watch for the exam traps. Never let the

4:41

LLM pretend it called a tool. Never

4:44

return unstructured text from tools.

4:46

Never put secrets into prompts. Never

4:48

give tools wild card IM permissions.

4:50

Never skip timeouts and retries. These

4:53

are all subtle ways to fail day 18

4:55

questions.

4:56

Here is the one sentence to lock this

4:58

in. The LLM decides. Lambda verifies and

5:01

executes. If you remember that, day 18

5:04

becomes automatic. Final selfch check. A

5:08

system must plan actions using an LLM,

5:10

but only trusted code may access

5:12

databases and APIs. What architecture

5:14

should you use? An agent with Lambda

5:16

tools. That's day 18 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.