Generative AI Agents: From Chatbots to Action Bots

Generative AI Agents: From Chatbots to Action Bots

The future of AI is Agentic. Learn how Agents differ from standard LLMs by using 'Tools' to perform tasks like booking appointments, querying SQL databases, and sending emails.

The Rise of the Agent

In Module 1-3, we talked about models that generate text. "Write an email." "Summarize this PDF."

But business requires action. "Send the email." "Refund the customer." "Update the database."

A standard LLM cannot do these things. It just outputs text. To make it "do" things, we wrap it in a system called an Agent.

For the Leader certification, you must understand the concept of Tool Use (or Function Calling) and how agents orchestrate complex workflows.


1. What is an AI Agent?

An Agent is an AI system that:

  1. Reasons: Uses an LLM to understand the user's intent.
  2. Plans: Decides which steps are needed to solve the problem.
  3. Acts: Uses Tools (APIs) to execute those steps.
  4. Observes: Looks at the result of the action and decides if it's finished or needs to do more.

The "ReAct" Loop (Reason + Act)

graph TD
    User[User: 'Book me a flight to NYC on Friday'] --> Reason[Reason: I need to check flight availability first.]
    Reason --> Act[Act: Call FlightSearch_API(dest='NYC', date='Friday')]
    Act --> Result[API Result: 'United 123 is available at 5pm']
    Result --> Observation[Observe: Found a flight. Now I need to book it.]
    Observation --> Act2[Act: Call BookFlight_API(flight='UA123')]
    Act2 --> Final[Response: 'Booked! Your confirmation is #XYZ']
    
    style Reason fill:#4285F4,stroke:#fff,stroke-width:2px,color:#fff
    style Act fill:#EA4335,stroke:#fff,stroke-width:2px,color:#fff
    style Act2 fill:#EA4335,stroke:#fff,stroke-width:2px,color:#fff

2. Use Cases for Agents

Agents move us from "Information Retrieval" to "Transactional" value.

A. Customer Service Agent

  • Old Chatbot: "Here is a link to our return policy." (Information)
  • AI Agent: "I see your order #123. I have processed the return label. It has been emailed to you." (Transaction)

B. Data Analyst Agent

  • Task: "How did sales compare to last year?"
  • Action: The agent writes a SQL query, runs it against BigQuery, gets the numbers, calculates the percentage difference, and writes a summary.

C. Personal Employee Assistant

  • Task: "Schedule a meeting with Bob."
  • Action: The agent checks your Calendar API, checks Bob's Calendar API, finds a free slot, and sends the invite.

3. Vertex AI Agent Builder (Action Capabilities)

We mentioned Vertex AI Agent Builder in Module 2. This is the Google Cloud tool for building these bots.

It allows you to define Tools. A tool is simply an API definition (using OpenAPI schema) that you give to the model.

  • "Here is a tool called check_inventory. It takes product_id as an input."
  • "Here is a tool called send_slack. It takes message as an input."

When the model decides it needs to use a tool, it outputs a structured JSON object (e.g., {"tool": "check_inventory", "args": {"product_id": "shoe_123"}}). The system executes it and feeds the result back.


4. Code Example: Defining a Tool

This is how "Function Calling" looks in Python. This is the mechanism that powers agents.

from google.cloud import aiplatform
from vertexai.generative_models import GenerativeModel, Tool, FunctionDeclaration

# 1. Define the Function (The Tool)
get_weather_func = FunctionDeclaration(
    name="get_current_weather",
    description="Get the current weather in a given location",
    parameters={
        "type": "object",
        "properties": {
            "location": {"type": "string", "description": "City and state, e.g. San Francisco, CA"}
        },
        "required": ["location"]
    },
)

weather_tool = Tool(function_declarations=[get_weather_func])

# 2. Give the tool to the model
model = GenerativeModel("gemini-1.5-pro", tools=[weather_tool])

# 3. Ask a question that requires the tool
response = model.generate_content("Is it raining in London?")

# 4. The model DOES NOT generate text. It generates a "Function Call"
print(response.candidates[0].function_calls)
# Output: name: "get_current_weather" args { location: "London, UK" }

# (Your code would then actually call the weather API and feed the result back)

5. Summary

  • Agents extend capabilities beyond text generation to Task Execution.
  • Tools (APIs) are the hands of the agent.
  • Orchestration is the brain power required to chain multiple steps together.
  • Vertex AI Agents allows you to build these conversation flows visually or through code.

In the final lesson of Module 4, we will look at the financials. How do we calculate the ROI of these projects and prioritize which ones to build?


Knowledge Check

?Knowledge Check

You want to build an AI that can reset user passwords in your LDAP system. You connect Gemini to your 'ResetPassword API'. Why is this considered an 'Agent' workflow rather than a standard RAG workflow?

Subscribe to our newsletter

Get the latest posts delivered right to your inbox.

Subscribe on LinkedIn