What are AI agents?

Agents are LLMs that can plan, act, and iterate. Instead of one-shot responses, they loop through reasoning, tool use, and observation until tasks are complete.

What happens when AI can take multiple steps to solve a problem?

Most AI interactions are one-shot: you ask, it answers. But complex tasks require multiple steps. Researching a topic, booking a trip, debugging a codebase: these can't be done in a single response.

Agents are systems where the LLM drives a loop: reason about the task, take an action (often using tools), observe the result, and repeat until done. The model isn't just generating text. It's pursuing a goal through multiple steps.

The agent loop

User: "Find the cheapest flight to NYC next Tuesday and book it"

Agent loop:
1. Reason: Need to search for flights first
2. Act: Call flight_search(destination="NYC", date="next Tuesday")
3. Observe: Got 5 options, cheapest is $199 on Delta
4. Reason: Found cheapest, now need to book
5. Act: Call book_flight(flight_id="DL123", ...)
6. Observe: Booking initiated, needs confirmation
7. Reason: Should confirm with user before charging
8. Act: Ask user to confirm
9. Observe: User confirms
10. Act: Complete booking
11. Done: Return confirmation to user

The model drives the process, making decisions at each step about what to do next.

What makes something "agentic"?

Key characteristics:

  • Goal-directed: Working toward a specified objective
  • Multi-step: Takes multiple actions over time
  • Tool use: Interacts with external systems
  • Adaptive: Adjusts based on observations
  • Autonomous: Makes decisions without step-by-step human guidance

A simple chatbot isn't agentic; it just responds. An AI that researches, drafts, revises, and publishes based on a single request is agentic.

Agent architectures

Different patterns for organizing agent behavior:

ReAct (Reason + Act) The model alternates between reasoning about the situation and taking actions. Each step includes explicit reasoning visible in the output.

Thought: I need to find the user's account info first
Action: lookup_account(user_id="12345")
Observation: Account found: Premium tier, joined 2020
Thought: Now I can answer their billing question
Action: respond("Your premium account is billed annually...")

Plan-then-Execute The model first creates a plan, then executes steps. Better for complex tasks with clear structure.

Plan:
1. Search for relevant papers
2. Read abstracts
3. Identify key themes
4. Synthesize findings
5. Write summary

Executing step 1...

Hierarchical Agents A planner agent coordinates specialized executor agents. The planner decides what needs doing; executors have narrow expertise.

Planner: "Need to update the database schema"
โ†’ Delegates to: Database Agent
โ†’ Which uses: SQL tools, migration tools

Planner: "Need to update the API"
โ†’ Delegates to: Code Agent
โ†’ Which uses: File editing, testing tools

The autonomy spectrum

Not all agents are equally autonomous:

Low autonomy: Human approves each action before execution. Safe but slow.

Medium autonomy: Agent executes within boundaries, escalates edge cases. Balances speed and safety.

High autonomy: Agent pursues goals with minimal oversight. Fast but risky.

The right level depends on the stakes. Booking flights might warrant high autonomy. Financial transactions probably need human approval.

Challenges with agents

Agents are powerful but tricky:

  • Compounding errors: Each step can fail, and errors accumulate
  • Cost: Many LLM calls add up quickly
  • Latency: Multi-step processes take time
  • Reliability: More steps mean more chances for failure
  • Safety: Autonomous action can cause real harm
  • Observability: Hard to debug long action chains

When to use agents

Good fits for agentic patterns:

  • Multi-step research: Searching, reading, synthesizing
  • Code tasks: Edit, test, debug, iterate
  • Data workflows: Extract, transform, validate, load
  • Complex bookings: Search options, compare, select, confirm
  • Document creation: Research, outline, draft, revise

Poor fits:

  • Simple Q&A: One-shot is faster and cheaper
  • Highly sensitive actions: Too risky for autonomy
  • Real-time requirements: Loops are too slow
  • Unpredictable costs: When you can't afford runaway loops

The future of agents

Current agents are impressive but limited. The frontier is expanding:

  • Longer horizons: Tasks spanning hours or days, not seconds
  • Better planning: More sophisticated reasoning about multi-step tasks
  • Learned strategies: Agents that improve through experience
  • Multi-agent systems: Teams of specialized agents collaborating
  • Safer autonomy: Better guardrails for higher-autonomy agents

The trajectory is toward more capable, more autonomous AI systems. Understanding agents now prepares you for where AI is heading.

Sources & Further Reading

๐Ÿ“– Docs