# What an AI Agent Really Is: The Perceive, Plan, Act, Observe Loop
Type this into a modern AI assistant: "Research the top 3 competitors to Notion and put them in a comparison table."
Watch what happens. It searches the web. It reads a few pages. It notices it only found two solid competitors, so it searches again. It pulls pricing, checks a review site, then builds the table. You gave it one instruction and it took maybe eight steps on its own.
That self-directed loop is the whole difference between an agent and a chatbot. A chatbot answers. An agent works.
A single prompt is one question in, one answer out. You ask, the model responds using only what it already knows. If it needs fresh information or a calculation, it can't go get it. It just guesses.
An AI agent is a language model that can take actions, see the results, and decide what to do next, repeating until the goal is met. The key word is *loop*. The agent isn't limited to one turn. It keeps going until the job is done or it decides it's stuck.
Here's the plain-language definition we'll use:
> An agent is a language model plus tools plus a loop.
A tool is any action the model can trigger: a web search, a calculator, a database lookup, sending an email, running code. The loop is the engine that lets the model use those tools repeatedly, adjusting as it learns.
Every agent, no matter the vendor, runs some version of this four-step cycle. Let's trace it with the competitor-research task.
The agent takes in the current situation: your instruction plus everything it knows so far.
At the start, "perceive" is just your prompt: *"Research the top 3 competitors to Notion and put them in a comparison table."* Later in the loop, perceiving also means reading the results of its own previous actions (the search results it just got back).
The agent decides the next step. Not the whole project, just the next move.
Its internal reasoning might be: *"I don't know Notion's top competitors off the top of my head with current data. I should search the web first."*
This is the part people underestimate. The agent isn't following a fixed script you wrote. It's choosing each step based on what it currently knows.
The agent uses a tool. Here, it calls a web-search tool with a query like Notion competitors 2026.
This is the moment an agent leaves the chatbot behind. It's no longer just producing text. It's doing something in the world and getting real data back.
The agent reads what the action returned. The search comes back with Coda, Obsidian, and a vague mention of "others."
Now it evaluates: *"I have two strong competitors and one gap. I need one more."*
And then the loop restarts. It perceives the updated situation, plans a second search (best all-in-one workspace apps 2026), acts, and observes again. It might loop three or four times: one search per competitor, one for pricing, one to verify. Only when it has enough does it stop and write the table.
That repeated cycle, driven by the model's own judgment about what's still missing, is what makes it an agent.
You do not need to build this from scratch (the SDKs below handle it for you), but seeing the skeleton makes the concept click. This is vendor-neutral pseudocode for the loop:
goal = "Research top 3 competitors to Notion and build a comparison table."
messages = [{"role": "user", "content": goal}]
while True:
# PERCEIVE + PLAN: model looks at everything so far and decides next step
response = model.generate(messages, tools=[web_search])
if response.tool_call:
# ACT: run the tool the model asked for
result = run_tool(response.tool_call) # e.g. web_search("Notion competitors 2026")
# OBSERVE: feed the result back so the model can perceive it next turn
messages.append(response)
messages.append({"role": "tool", "content": result})
else:
# No tool needed: the model has its final answer (the table)
print(response.content)
breakRead the comments and you'll see all four steps. model.generate is perceive and plan. run_tool is act. Appending the result is observe. The while loop is what turns a one-shot answer into an agent. The model, not you, decides when to stop by returning a final answer instead of another tool call.
A common assumption: "A smarter model makes a better agent." Partly true. But the loop is what unlocks the model's ability to *recover*.
If the first search returns junk, an agent notices in the observe step and tries a different query. A single prompt can't do that. It commits to its one answer, mistakes and all.
This is also why agents can handle open-ended tasks. You don't have to know in advance how many searches it takes to find three competitors. The agent figures that out as it goes.
The trade-off: loops can run long, cost more, and occasionally go in circles. Good agent design puts limits on the loop, for example "stop after 10 steps" or "stop when the table is complete." We'll cover guardrails like this later in the block.
Knowledge check
1. According to the lesson, what is the defining characteristic that separates an AI agent from a chatbot?
2. The lesson defines an agent with the formula 'a language model plus tools plus a loop.' What role does the 'loop' play in this definition?
3. In the competitor-research example, the agent searches again after finding only two solid competitors. Which step of the Perceive–Plan–Act–Observe loop does this 'searching again' decision most directly illustrate?
4. Select ALL correct answers. Which of the following are accurately described as 'tools' an agent can trigger, based on the lesson's definition?
Select all the correct answers.
5. Select ALL correct answers. Which statements accurately describe a single prompt (one question in, one answer out) compared to an agent?
Select all the correct answers.
Without tools, even the loop is useless. A model that can only talk can't research anything. Tools are how the agent reaches outside its own head.
Common tool types you'll see in real agents:
For the competitor task, the agent needed exactly one tool: web search. Add a "write to Google Sheets" tool and the same agent could drop the finished table straight into your workspace, no copy-paste.
If you want a clear, free primer on how tool use and agent loops fit together, Anthropic's Building Effective Agents guide is vendor-neutral in spirit and widely referenced across the industry.
The perceive-plan-act-observe loop is identical across providers. What differs is the toolkit each one gives you to build it:
All three wrap the same loop, handle the tool-calling plumbing, and add features like memory and guardrails. Pick one based on the model you already use; the concepts you learned here transfer directly. The provider deep-dive blocks later in this course cover each SDK hands-on.
For now, the mental model matters more than the tool. If you understand that an agent is *model plus tools plus a loop*, you understand every agent framework on the market in 2026.
Ask yourself, of any AI feature you use: *does it take multiple actions and decide the next one based on results?*
The dividing line is the loop, not how impressive the answer sounds.