Building AI Agents with Google's ADK

In this video, you're going to learn what AI agents are,

not just in theory, but in practice.

We'll look at the ideas behind modern agents,

and then we'll build your very first AI agent

step-by-step using Google's ADK.

By the end, you'll understand how agents reason,

act, and adapt.

And you'll have code that you can actually run yourself.

So what are AI agents?

At the simplest level, an agent is software

that doesn't just answer, it can decide and take action.

Instead of generating a single response

like a traditional chatbot,

it looks at your request,

figures out what steps need to be taken,

maybe calls an API, runs code,

looks at the results, and then decides what to do next.

One of the clearest explanations

comes from the research paper REACT,

Synergizing, Reasoning, and Acting in Language Models.

The idea in that paper was simple but powerful.

Language models shouldn't just generate text in one go.

They can actually reason step-by-step,

take an action like calling a tool or API,

observe the results, and then decide what to do next.

That cycle of reasoning, acting, observing, and adjusting

is the foundation of how modern AI agents work.

And it lines up with how it's defined.

Systems with reasoning, planning, and memory,

with enough autonomy to adapt

and make decisions on behalf of the user.

Now, not all agents behave the same way.

A useful way to think about them is in three broad patterns.

First, we have sequential agents.

These run step-by-step like an assembly line.

Step one, then step two, then step three.

They're predictable but rigid.

Second, we have reactive agents.

These decide in the moment.

They look at the current state and ask,

what should I do next?

Maybe tool A one time, tool B the next.

They're flexible, but they don't plan ahead.

Lastly, we have deliberate or planning agents.

These pause to sketch a plan, then execute.

Think about booking travel.

You don't just buy a flight randomly.

You pick dates, hotels,

and then that's the order of steps that you follow through.

So which of these is the right one for you?

It depends on the problem.

For simple, predictable flows, sequential is fine.

For dynamic, reactive works better.

And for multi-step goals with dependencies,

you want planning agents.

Okay, that's the high-level view.

Now, let's actually build an agent

so you can see these ideas in action.

We'll build a blog writing agent.

You give it a topic, it will generate a structured outline,

turn that outline into a full blog post,

and then suggest alternative titles and hooks.

This is where ADK's categories comes in.

As we walk through the code,

notice how the planner and writer agent are LLM agents,

which are powered by a model.

They're wrapped in loop agents,

which are workflow agents in ADK.

These handle retries automatically if validation fails.

And if we ever wanted something beyond that,

ADK would also let us extend a custom agent

by subclassing the base agent.

So let's set up the environment

and then go line by line through the code.

First off, you need to install UV.

You can do that by running the command right here.

Secondly, you need to install Google ADK

because we need to obviously use ADK in this.

And then let's create a file called agent.py in your IDE.

We need to import these key libraries,

and then we can start building out our very first agent.

So the first agent that we're building out

is called the blog planner.

Its only job is to take a topic

and turn it into a structured outline.

We give it the name blog planner so it's easy to identify,

and we tell it which model to use,

which comes from our environment file.

The description is just a human readable note.

The important part of the introduction

is here we actually tell it what to produce,

which is a markdown outline with a title,

a short introduction, four to six sections

with bullet points and a conclusion.

By spelling that out, we make the output much more reliable.

Finally, look at the output key.

We set it to blog outline.

This means whatever this agent writes

will be stored in shared state under that name

so that the next agent that can pick it up

can do it automatically.

Next, we add a second agent,

the outline validation checker.

This one doesn't write anything new.

It just checks the outline.

Its instruction is strict.

If the outline in state has a title, an intro,

four to six sections, and a conclusion,

it must answer with the word okay.

If something is missing,

it must answer with the word retry

and explain what's wrong.

That way we can automatically decide

whether to accept the outline or try again.

To connect the planner and the checker,

we've wrapped them inside a loop agent

called robust blog planner.

The loop first runs the planner,

then the checker.

If the checker says okay, we're done.

If the checker says retry,

the loop runs the planner again

with the same instructions.

It can do this up to three times.

This gives us a safety net

so if the model forgets something,

it has another chance to get it right.

Now we create another agent called blog writer.

This one takes the outline we just saved

in blog underscore outline

and turns it into a full markdown blog post.

The instruction tells it how to write.

It should assume the audience is software engineers,

skip the basics and focus on practical insights,

explain both the how and the why

and include short code snippets where helpful.

It should also follow the structure of the outline

with proper headings.

The finished draft is saved under blog underscore post

in shared state, ready for the next step.

Next up, we're gonna add another checker,

this time for the post.

It's called blog post validation checker.

It looks at blog underscore post

and checks if the article has an introduction,

sections that match the outline,

a conclusion and clear explanations.

If it passes, the checker says, okay.

If not, it says retry and list the fixes which are needed.

Just like with planning,

we combine the writer and its checker

into a loop agent called robust blog writer.

This makes the system automatically retry the writing step

until the validation passes up to three times.

Now we wrap each loop, the robust blog planner

and the robust blog writer as tools.

This is what lets the root agent call them directly

without worrying about what's happening inside.

Finally, we put it all together

with the root agent called blogger.

The instructions for blogger are simple.

When a user gives it a topic,

first it calls the planner tool to make an outline,

then it calls the writer tool to draft the full post

and finally it adds three alternative titles

and two tweet length hooks.

The root agent only has access to the two tools we exposed,

the planner and the writer.

So its workflow is clear and controlled.

You give it a topic, it plans, it writes, it checks,

and then it gives you a polished blog post.

You've now successfully written your first agent script.

The next step is to actually run it.

Head into your terminal and launch it

using this command with ADK web.

So you can view everything inside a simple UI.

Once that's running, open the local ADK web link

in your browser and start interacting

with the agent directly.

To kick things off, I'm going to ask it to generate a blog

on the top 10 use cases for AI agents.

Let's see how it plans, writes, and delivers the results.

Your sub-agents will then work together

to create a blog post.

And that's it.

You've built and run your first AI agent with Google's ADK.

We started from the idea of what agents are,

then walked through the code step-by-step,

and finally saw it come to life in Terminal.

Thank you for watching.

Check out the description box.

End of transcript · 1,374 words

iPhone app Translate videos on your iPhone Paste a TikTok, Instagram or X link, add subtitles in your language and save the video to Photos.

Read any video in your language

Paste a link from X, TikTok, YouTube or Instagram. You get a page like this one.

© 2026 TranslateMom Transcripts Sources Pricing Legal