# Introduction to AI Agent

## 1. Introduction to AI Agents

Why is everyone suddenly talking about AI Agents?

In this section, we’ll explore an AI Agent, how it relates to large language models (LLMs), why structured data matters, and how to design an Agentic Workflow, with images and examples for clarity.

### 1. What is an AI Agent?

An **AI Agent** is a system that can **understand user instructions or contextual situations** and **autonomously execute tasks** to achieve a given goal.

To do so, it can leverage various **tools** and **APIs**, making decisions based on a **data-driven understanding of the situation**.

✅ In short, an AI Agent is an **intelligent system that acts autonomously to accomplish a given objective**.

### 2. Relationship Between LLMs and Agents

<figure><img src="https://3125209651-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0AHWR242P4nbzOKCgBYv%2Fuploads%2FO1asrjjYdFFhlzWe2TXY%2Fimage%20(1).png?alt=media&#x26;token=3f5009a8-7096-475a-a58a-e923d03a9c60" alt=""><figcaption></figcaption></figure>

Large Language Models (LLMs) are primarily designed for **understanding and generating text**.

As LLMs have grown in scale, their **reasoning capabilities** have significantly improved—this is the power of the **Scaling Law**.

<figure><img src="https://3125209651-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0AHWR242P4nbzOKCgBYv%2Fuploads%2FMxvqCmsYP9uWfWhEFC7T%2Fimage%20(2).png?alt=media&#x26;token=15771a01-444a-4840-977f-183486328e79" alt=""><figcaption></figcaption></figure>

However, solving real-world problems requires more than just generation.

That’s where **AI Agents** come into play—**expanding LLMs' capabilities** by integrating additional tools and workflows.

### 3. Reasoning: LLMs' Core Strength—Enhanced by Agents

Agents take advantage of LLMs' reasoning abilities and combine them with other capabilities, like computation, web search, or external API calls, to automate complex tasks.

One of the key technologies that makes this possible is **Function Calling**.

> Want to dive deeper?
>
> 👉 Check out **"Getting Started with Function Calling"** for more details!

#### 🧠 What is Function Calling?

**Function Calling**

allows an LLM to "request" the use of an external tool. You can think of it like **an AI pressing a button in a program to act**.

For example:

* When asked: *“What’s the weather like in Seoul tomorrow?”*

  → The LLM can respond with something like:

  **`get_weather(location="Seoul", date="tomorrow")`**

```python
from langchain.tools import tool

# Use a decorator to turn a function into a tool
@tool
def get_weather(location: str, date: str) -> str:
    """Returns the weather information for a specific location and date."""
    # Real API logic can go here
    return f"The weather in {location} on {date} is sunny."
```

* `@tool` decorator: Registers this function as a callable tool.
* **Docstring**: Describes the function’s purpose—this helps the LLM decide **when** to use it.

So, LLMs can **understand a user’s intent** and express it **as a function call**, like a developer writing code.

#### 🤖 The Function Calling Workflow with Agents

Here's how LLMs and Agents work together:

1. **LLM** analyzes the question and generates a suitable function call
2. **The agent** executes the actual function
3. **LLM** receives the result and presents it in natural language

{% hint style="success" %}
**Summary**:&#x20;

* **Function Call** = A request from the LLM to use an external tool (API, calculator, search engine, etc.)
* **Agent** = The assistant that executes the request and returns the result&#x20;
  {% endhint %}

### 4. For Agents to Collaborate: Structure Your Data

<figure><img src="https://3125209651-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0AHWR242P4nbzOKCgBYv%2Fuploads%2Fbe5seeanWk5QOHBhVayB%2Fimage%20(3).png?alt=media&#x26;token=ac5ea86b-5a89-442f-a330-a18cf8862ad0" alt=""><figcaption></figcaption></figure>

For multiple agents to collaborate, they can't just rely on ambiguous natural language.

* ❌ Unstructured: “아버지가방에들어가신다” (no spaces = unclear)
* ✅ Structured: `{"Person": "Father", "Place": "Room"}`

Agents collaborate effectively using **structured data formats like JSON**.

> Want to learn more?
>
> 👉 Check out **"Getting Started with Structured Output"** for deeper insights!

## 2. Agentic Workflow

How can we design a practical **Agentic Workflow**?

An **Agentic Workflow** is a structured design approach that breaks down a complex goal into smaller **tasks** and assigns each task to the most suitable Agent to handle it.

### 1. How to Design an Agent Workflow

**🔍 The key is task decomposition.**

It’s important to note that **task decomposition must be done by humans—not the LLM**.

LLMs or Agents alone can't fully understand how to break down complex goals. We, as designers, need to understand the objective and **logically deconstruct it** into manageable steps.

Only then can we effectively assign each task to a specific agent.

Let’s look at a few examples:

#### 🪜 Example 1: Weather Assistant

**User request:** “Do I need to bring an umbrella in Seoul tomorrow?”

**🧩 Task Breakdown:**

1. Identify location and date

   → Seoul, tomorrow
2. Retrieve weather data

   → Check the chance of rain
3. Apply rain threshold logic

   → Recommend an umbrella if the chance ≥ 60%
4. Generate a natural language response

**🤖 Example Agent Assignment:**

* **NLP Agent**: Extracts date and location from the query
* **Weather Agent**: Calls the weather API
* **Judge Agent**: Applies decision rules (e.g., bring an umbrella if needed)
* **Response Agent**: Generates a user-friendly response

#### 💼 Example 2: Auto-Generating Marketing Emails

**User request:** “Create a promotional email for our new product.”

**🧩 Task Breakdown:**

1. Analyze target customers
2. Summarize product details
3. Choose email tone/style
4. Write email content
5. Add personalized suggestions

**🤖 Example Agent Assignment:**

* **Customer Analysis Agent**: Uses CRM data to identify customer segments
* **Product Summary Agent**: Extracts product highlights
* **Tone Styling Agent**: Adapts style to marketing goals
* **Copywriting Agent**: Writes persuasive email content
* **Personalization Agent**: Adds behavior-based recommendations

#### 🧠 More Real-World Agent Examples:

* **Data Analysis Agent**: Analyzes large CSV files, visualizes data, and fixes errors
* **File Management Agent**: Automates file deletion, movement, and reading/writing
* **Report Writing Agent**: Searches documents, summarizes them, and creates formatted reports with images

#### ✅ Summary

* **Agentic Workflow = Task Decomposition + Role Assignment**
* **Humans must define the tasks strategically**
* Each Agent handles what it does best
* Overall structure: **Router → Task → Agent → Response**

### 2. AI Agent Orchestration

As we’ve seen, designing workflows where multiple Agents collaborate is essential. To make this collaboration efficient, we need a smart controller:

The **Orchestration Layer**.

#### 🎼 What Is the Orchestration Layer?

The orchestration layer acts like a **conductor**, coordinating the right Agents or Models based on the user's input.

* It understands the user’s intent
* Chooses the most efficient Agent combination
* Assigns roles and sequences tasks appropriately

#### 🔄 Multi-Agent Systems with Diverse Models

<figure><img src="https://3125209651-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0AHWR242P4nbzOKCgBYv%2Fuploads%2FZpb4JmiBSZiD3yYiUKuK%2Fimage%20(4).png?alt=media&#x26;token=22df6e36-58e7-47f9-9714-5191c828262f" alt=""><figcaption></figcaption></figure>

Modern AI systems no longer rely on a single model. Instead, they combine multiple **Agents** and **Models** with specialized abilities.

#### 🧠 Why Agent Orchestration Matters

* ✅ **Service Stability**

  → If one Agent fails, others can still complete the task
* ✅ **Performance Optimization**

  → Select high-efficiency or low-cost models as needed
* ✅ **Collective Intelligence**

  → Multiple Agents working together yield better outcomes

#### 🧱 Handling Diverse Inputs in Multi-Agent Systems

Users express goals in many ways:

> “Make it accurate.” “I need it cheap.” “Exclude models from Country X.”
>
> “Speed is critical.” “I need the result today.”

Based on these constraints, the orchestration layer dynamically chooses the best model and agent combination.

#### 🧬 The Future of Agents

Agents are becoming more **intelligent and interactive**.

They are evolving from simply executing commands to:

* Recognizing what they can/can’t do
* Requesting missing information
* Making autonomous decisions based on context

***

## Wrap Up

In this section, we covered the core concepts behind AI Agents:

🔹 **What is an AI Agent?**

An autonomous system that reasons and acts to achieve a goal

🔹 **LLM + Agent Architecture**

LLMs handle reasoning; Agents handle external execution

🔹 **Structured Data**

Essential for Agent collaboration

🔹 **Agentic Workflow**

Break tasks down and assign them to the right Agent

***

📘 Up next, we’ll get hands-on and start building your very first AI Agent using **Upstage APIs**. Ready to create your own Agent? Let’s go! 🤖✨

**YoungHoon Jeon** | **AI Edu** | **Upstage**
