AI Agents for Beginners - 1. Intro to AI Agents and Agent Use Cases
A breakdown of AI Agent core components (Environment, Sensors, LLM, Tools, Memory), 7 agent types, when to use agents, and a hands-on Python example with Azure AI Foundry.
June 8, 2026
AI Agents for Beginners - 1. Intro to AI Agents and Agent Use Cases
This article is a summary based on Lesson 01 of Microsoft's AI Agents for Beginners course.
What is an AI Agent?
To summarize in one line:
An AI Agent is a system that enables a Large Language Model (LLM) to go beyond simply generating text and take actions in the real world using tools and knowledge.
An LLM on its own only generates response text to a prompt.
An AI Agent combines it with an Environment, Sensors, and Actuators to turn it into a system capable of taking real action.
An AI Agent combines it with an Environment, Sensors, and Actuators to turn it into a system capable of taking real action.
AI Agent Core ComponentsMermaidflowchart TD User(["👤 User"]) User -->|"Natural language request"| Agent subgraph Agent["🤖 AI Agent"] direction TB LLM["🧠 LLM\nReasoning Engine"] Memory["💾 Memory\nShort-term / Long-term"] LLM <-->|"Context reference"| Memory end ENV["🌐 Environment\n(e.g. booking platform)"] Tools["🔧 Tools\n(API / DB / Code Runner)"] Agent -->|"Sensors: read state"| ENV ENV -->|"Current state"| Agent Agent -->|"Actuators: take action"| Tools Tools -->|"Result"| Agent Agent -->|"Response"| User
Role of each component:
| Component | Description | Travel Booking Agent Example |
|---|---|---|
| Environment | The space in which the agent operates | Flight and hotel booking platform |
| Sensors | Methods to read the current state of the environment | Querying flight prices, room availability |
| Actuators | Actions taken by the agent | Booking a room, sending confirmation email, canceling reservation |
| LLM | Natural language understanding and planning | Converting ambiguous requests → concrete action plans |
| Memory | Short-term (current conversation) + long-term (customer DB) memory | Remembering "prefers window seat" |
| Tools | Execution capabilities provided to the agent | Flight search API, payment system |
Types of AI Agents
Not all agents are built with the same architecture. They are broadly categorized into 7 types based on complexity and capability.
| Type | How It Works | Travel Agent Example |
|---|---|---|
| Simple Reflex | Follows hardcoded rules only. No memory or planning | Forwarding complaint emails → CS team |
| Model-Based Reflex | Maintains an internal world model and tracks changes | Monitoring flight price history |
| Goal-Based | Creates step-by-step plans toward a goal | Booking an entire itinerary from origin → destination |
| Utility-Based | Calculates trade-offs to find the best solution | Finding the optimal itinerary balancing cost and convenience |
| Learning | Continuously improves through feedback | Improving recommendations based on travel reviews |
| Hierarchical | A higher-level agent delegates subtasks to lower levels | Subagents dedicated to flights, hotels, and car rentals |
| Multi-Agent (MAS) | Independent agents collaborate or compete | Collaboration among dedicated hotel, flight, and tour agents |
When to Use AI Agents
Just because AI Agents are powerful does not mean they should always be used.
Agents deliver true value when the following three conditions are met:
Agents deliver true value when the following three conditions are met:
When to Use AI AgentsMermaidflowchart LR A["Problem Type"] --> B{Can the steps be\npre-defined?} B -->|Yes| C["Simple LLM call\nor workflow is enough"] B -->|No| D["✅ Open-Ended Problem\nLLM decides the path dynamically"] E["Task Scope"] --> F{Can a single tool\ncall handle it?} F -->|Yes| G["Simple API call is enough"] F -->|No| H["✅ Multi-Step Process\nUse tools across multiple turns"] I["Improvement Need"] --> J{Should it get\nsmarter over time?} J -->|No| K["Static solution is enough"] J -->|Yes| L["✅ Improvement Over Time\nFeedback-driven learning"]
Basics of Agentic Solutions
Agent Development
When building an agent, the first thing to do is define what the agent can do.
Tools, Actions, and Behaviors must be clearly designed.
Tools, Actions, and Behaviors must be clearly designed.
In this course, Azure AI Agent Service is used as the primary platform:
- Support for diverse models including OpenAI, Mistral, and Meta (Llama)
- Integration with licensed data providers such as Tripadvisor
- Standardized OpenAPI 3.0 tool definitions
Agentic Patterns
Communication with an LLM takes place through prompts, but an agent must operate autonomously across numerous steps.
Writing prompts manually at every step is impossible.
Agentic Patterns are reusable strategies for orchestrating LLMs in a more scalable and reliable manner.
Writing prompts manually at every step is impossible.
Agentic Patterns are reusable strategies for orchestrating LLMs in a more scalable and reliable manner.
Agentic Frameworks
An agent framework provides templates, tools, and infrastructure to make it easier for developers to create agents:
- Wiring up tools and capabilities
- Observability (monitoring and debugging agent behavior)
- Multi-agent collaboration
In this course, we focus on the Microsoft Agent Framework (MAF) for building production-grade agents.
Code Example: First Travel Agent
Let's see how an AI Agent works in practice with real code.
1. Setup
setup.pypython
imports.pypython
Required environment variables:
AZURE_AI_PROJECT_ENDPOINT— Azure AI Foundry project endpointAZURE_AI_MODEL_DEPLOYMENT_NAME— deployed model name (e.g.gpt-4o-mini)
2. Defining a Tool
Define the tool to provide to the agent using the @tool decorator.
This function will be called automatically when the agent determines it is necessary.
This function will be called automatically when the agent determines it is necessary.
tool_definition.pypython
3. Creating & Running the Agent
create_and_run_agent.pypython
4. Streaming Response
You can stream responses token by token, just like a real-time chat interface.
streaming.pypython
Agent Execution Flow
Let's look at how the code above actually works using a sequence diagram.
Travel Agent Tool Calling FlowMermaidzenuml title Travel Agent Tool Calling Flow User->TravelAgent: recommend a warm beach destination TravelAgent->LLM: analyze request and decide tool call LLM->TravelAgent: call get_destinations TravelAgent->Tool: get_destinations() Tool->TravelAgent: return destinations list TravelAgent->LLM: filter by warm beach preference LLM->TravelAgent: recommend Bali and Sydney TravelAgent->User: final recommendation
Key points:
- The LLM analyzes the user request and decides on its own which tool to call.
- The
get_destinationstool simply returns the list; filtering is handled by the LLM. - The agent passes the tool result back to the LLM to generate the final response.
Summary
To summarize what we learned in this lesson:
Lesson 01 SummaryMermaidflowchart LR Root["AI Agent"] Root --> Types["7 Types"] Root --> Cases["Use Cases"] Root --> Concepts["Core Concepts"] Types --> T1["Simple Reflex"] Types --> T2["Model-Based"] Types --> T3["Goal-Based"] Types --> T4["Utility-Based"] Types --> T5["Learning"] Types --> T6["Hierarchical"] Types --> T7["Multi-Agent"] Cases --> U1["Open-Ended Problems"] Cases --> U2["Multi-Step Processes"] Cases --> U3["Improvement Over Time"] Concepts --> C1["Agentic Patterns"] Concepts --> C2["Agentic Frameworks"] Concepts --> C3["Tool Calling"]
- An AI Agent is a system that enables an LLM to go beyond text generation and take real action.
- The core of an agent is the combination of Environment + Sensors + LLM + Actuators + Memory.
- You should choose an agent that fits your goal from among the 7 types.
- An agent is not necessary in every situation — if the steps of a problem can be pre-defined, a simple workflow is sufficient.