Sign in
All library
Library· Fundamentals

What are AI agents?

A working definition, the observe-act-observe loop, and when to reach for an agent instead of a workflow.

#fundamentals#beginner
6 min read

An AI agent is a system that uses a large language model (LLM) to decide, step by step, which actions to take to accomplish a goal. Unlike a single prompt-and-response, an agent runs in a loop: it observes state, chooses a tool, executes it, reads the result, and repeats until it either finishes or gives up.

The canonical loop

  1. Plan — the model reads the goal and current context.
  2. Act — it calls a tool (search, code execution, HTTP request, DB query).
  3. Observe — the tool result is fed back into the context window.
  4. Repeat until a stop condition (goal reached, budget hit, error).

Recommended reading

When to use one

Agents shine when the problem is open-ended and the steps can't be enumerated ahead of time (research, debugging, multi-hop customer support). If you can write the flow as a static DAG, a workflow is cheaper, faster, and easier to debug.