01. Agent Basics - Build your first agent

What are agents? Build your first AI agent.

1-2 hours

🎯 Lesson Objectives

By the end of this lesson, you will be able to:

  • Understand - What are AI agents?
  • Create and test your first few agents with Google ADK

🤖 What are AI agents?

There is often a confusion between LLMs, Chatbots and AI agents. It is important to understand the difference.

LLMs - Large Language Models. Generate next token for a given token. Can be fine tuned for tasks like answering questions or summrization. E.g. Google Gemini model, GPT4 etc.

Chatbots - Primarily answer user questions by consulting with an LLM. The responses can be based on knowledge that the LLM already has or proprietary information like corporate information. E.g. Chatbots on websites.

AI Agents - These are programs that have some “Agency”. Viz. an ability or tools to perform a task. For example search internet, book a hotel, update a booking etc.

Following diagram explains this really well

alt

🏁 Knowledge Check - Is gemini.google.com/ Gemini App a chatbot or an agent? Think before you click for answer!
Well, they are agents. Why? well you can ask https://gemini.google.com to generate an image. Or you can ask it a question with the latest information (something the Gemini LLM model was not even trained on) and it will fetch that information and respond based on that.

Reason why it might get a bit confusing is because all these terms (LLMs, Chatbots and Agents) are used interchangeably. And Google’s LLM model is also called as Gemini!

But an agent is some application that has some agency (ability to do something) and it generally does that with tools. So while Gemini is an LLM (with versions like 2.0, 2.5, 3.1 etc.) and you can create a chatbot using it, https://gemini.google.com or Gemini App on your mobile is an agent.

In fact Gemini has tools right there in the interface -

alt

🤖 Before we build

Before we understand the anatomy of an AI agent and actually build one, here are some foundational concepts you must understand:

  1. Agent Framework / Development Kit
    A toolkit that provides structure, APIs, and workflows to design, manage, and run AI agents reliably in real applications. e.g. Google ADK, Langchain, Autogen and CrewAI.

  2. Session, Memory and Artifacts
    These components allow agents to maintain context, remember past interactions, and store intermediate outputs while completing tasks.

  3. Tools
    External functions, APIs, or services that agents can call to perform actions beyond text generation, such as querying data or executing workflows.

  4. Deployment
    The process of running your agent in a production environment so it can securely operate, scale, and interact with users or other systems.

🤖 Anatomy of an AI Agent

As seen in the figure above at a high level the Agent has following

  1. LLM - An AI agent’s brain
  2. Tools - An AI agent’s hands that give it agency. These tools could be local functions or API/MCP (Model Context Protocol) based tools (more on that later)
  3. An interface with execution logic - to interact with users and other agents.

A typical user interaction with an agent looks like following -

Notice how the agent is using its brain to interpret user’s request and tool’s response and how it is using tool to get work done.

💡 - I am trying to go as slow as possible, in case you are overwhelmed, don’t worry. Things will be clear once we actually build and run agents (which is next)

A Typical User/Agent Interaction: alt

🤖 Build and test your first agent

At this point if you do not know any Python, consider taking the free course Essential Python (1-2 hours). It is also recommended to take the Essential Shell Scripting course (1-2 hours).

🤖 Let’s provide agency to our agent with a tool

Quiz

What is the difference between lists and tuples?

Lists

  • Lists are mutable - they can be changed
  • Slower than tuples
  • Syntax: a_list = [1, 2.0, 'Hello world']

Tuples

  • Tuples are immutable - they can’t be changed
  • Tuples are faster than lists
  • Syntax: a_tuple = (1, 2.0, 'Hello world')

Is Python case-sensitive?

Yes

Next