Agents & Tool Use / Agent Fundamentals

AI Agent

Intermediate [3/5]
Autonomous agent LLM agent Agentic AI

Definition

An AI agent is an LLM-powered system that can autonomously plan, make decisions, and take actions to accomplish goals. Unlike simple chatbots that just respond to queries, agents can use tools, browse the web, write code, and interact with external systems.

Think of it as giving an LLM "hands" to actually do things in the world, not just talk about them.

Key Concepts

  • Planning: Breaking down goals into steps
  • Tool use: Calling APIs, running code, accessing databases
  • Memory: Remembering context across interactions
  • Reasoning: Deciding what to do next based on results

Examples

Agent Loop
How Agents Work
GOAL: "Book me a flight to NYC next Friday" 1. THINK (Reasoning) "I need to search for flights, compare prices, and make a booking. Let me start by searching." 2. ACT (Tool Use) → Call flight_search(dest="NYC", date="next Friday") → Returns: [Flight A: $299, Flight B: $350, ...] 3. OBSERVE (Process Results) "Found 5 flights. Flight A is cheapest but has a layover. Let me check user preferences." 4. THINK (Reasoning) "User usually prefers direct flights. Let me ask before booking." 5. ACT (Response) → "I found flights ranging from $299-$450. The cheapest has a 2-hour layover. Direct flights start at $350. Which do you prefer?" [Loop continues until goal is achieved]
Agents cycle through thinking, acting, and observing until they complete their task.
Agent Types
Common Agent Architectures
ReAct (Reasoning + Acting) • Alternates between thinking and acting • Most common pattern • Good for complex, multi-step tasks Plan-and-Execute • Creates full plan upfront • Executes steps sequentially • Good for predictable workflows Tool-Using Agents • Focuses on selecting right tools • Minimal planning overhead • Good for API-heavy tasks Multi-Agent Systems • Multiple specialized agents collaborate • Each agent has specific expertise • Good for complex problems
Different architectures suit different use cases.
Agent Tools
What Agents Can Do
INFORMATION TOOLS • Web search • Database queries • Document retrieval • API calls ACTION TOOLS • Send emails • Create files • Execute code • Make purchases ANALYSIS TOOLS • Data analysis • Image recognition • Sentiment analysis • Summarization INTEGRATION TOOLS • Slack messages • Calendar management • CRM updates • Ticket creation
The power of an agent depends on the tools available to it.

Interactive Exercise

🤖
Design an Agent

Design a customer support agent for an e-commerce site. Define:

  • What tools would it need?
  • What actions should it be able to take?
  • What should require human approval?
Pro Tips
  • Start simple—add tools incrementally
  • Always include human-in-the-loop for critical actions
  • Log all agent actions for debugging and audit
  • Set clear boundaries on what agents can do autonomously

Related Terms