Build This Now
Build This Now
Qu'est-ce que le code Claude ?Installer Claude CodeL'installateur natif de Claude CodeTon premier projet Claude Code
How Does an LLM Actually Work? (ChatGPT and Claude, Explained Without Math)How Does AI Image Generation Work? (The Noise-to-Picture Trick)How Do AI Agents Actually Work? (The Loop That Lets AI Do Things)What Is a Token in AI? (Why ChatGPT Charges by the Token)What Is a Vector Embedding? (And How RAG Lets AI Read Your Documents)How ChatGPT's 'Dreaming' Memory Works (and What to Turn Off)Why a Hidden Line of Text Can Hijack Your AI BrowserHow Much Energy and Water Does AI Actually Use?Is AI a Bubble? 'Circular Financing' in Plain EnglishThe EU AI Act, Explained: What Changes on August 2, 2026How Do AI Voice-Cloning Scams Work? (And How to Spot One)What Is Agentic Commerce? How AI Agents Buy Things for YouWhy Does AI Run on GPUs, Not CPUs? (One Genius vs. a Thousand Interns)How Does HTTPS Work? (The Padlock, and Why Nobody Can Read Your Password)
speedy_devvkoen_salo
Blog/Handbook/Core/How Do AI Agents Actually Work? (The Loop That Lets AI Do Things)

How Do AI Agents Actually Work? (The Loop That Lets AI Do Things)

An AI agent is a language model put in a loop and given tools and a goal, so it can take actions instead of just chatting. Here's the plan-act-observe loop that powers agentic AI, explained simply.

Arrête de tout configurer. Place à la construction.

Des templates SaaS avec orchestration IA.

Published Jun 13, 20269 min readHandbook hubCore index

An AI agent is a language model placed inside a loop and handed two things: a set of tools (search, run code, send email, query a database) and a goal. Instead of answering once and stopping, it plans a step, takes an action with a tool, looks at the result, and decides what to do next — repeating until the goal is done. The difference between a chatbot and an agent is the difference between asking someone for directions and handing them your car keys.

This is the defining shift in AI for 2026: models stopped just talking and started doing. Here's the surprisingly simple loop underneath it.

Table of Contents

  1. Chatbot vs. Agent: The Real Difference
  2. The Loop: Plan, Act, Observe, Repeat
  3. Tools Are the Agent's Hands
  4. A Worked Example
  5. Why Agents Fail (and How They're Kept in Line)
  6. From One Agent to a Team
  7. Frequently Asked Questions

Arrête de tout configurer. Place à la construction.

Des templates SaaS avec orchestration IA.

Chatbot vs. Agent: The Real Difference

A chatbot is a single round trip: you ask, the model predicts an answer, it stops. It can't check anything, can't act, can't recover from being wrong — it just produces text.

An agent keeps going. Give it "book me the cheapest flight to Lisbon next Friday," and a chatbot can only describe how you'd do that. An agent can actually search flights, compare prices, and (if you let it) complete the booking — because it can take actions and react to what it finds.

ChatbotAI agent
InteractionOne question, one answerMany steps toward a goal
Can it act?No — text onlyYes — uses tools
Reacts to results?NoYes — adjusts as it goes
Stops whenIt finishes replyingThe goal is met (or it gives up)

The Loop: Plan, Act, Observe, Repeat

Strip an agent down and it's a four-beat cycle running over and over:

  1. Plan — Given the goal and everything so far, the model decides the next step. ("I should search for flights first.")
  2. Act — It calls a tool to do that step. ("Search flights: LIS, Friday.")
  3. Observe — The tool returns a result, which gets fed back into the model. ("Cheapest is €74 at 9am.")
  4. Repeat — With that new information, it plans the next step. ("Now check the return options.")

The loop continues until the model judges the goal complete. That's the entire engine. The intelligence is the same next-token prediction as a chatbot — the power comes from running it in a loop with access to the real world.

Tools Are the Agent's Hands

On its own, a language model can only produce text. Tools are how that text turns into action. A tool is any function the agent is allowed to call — and the model is taught to output a structured request like "use the search_web tool with query X" instead of just talking.

Common tools an agent might have:

  • Search the web or a knowledge base (see how RAG lets AI read your documents)
  • Run code to calculate or test something
  • Read and write files
  • Call an API — send an email, create a calendar event, place an order
  • Query a database

Give a capable model good tools and a clear goal, and the loop does the rest. Take the tools away and it's back to being a chatbot.

A Worked Example

Goal: "Find the three most-starred new AI repos this week and email me a summary."

  1. Plan: "First, search for trending AI repositories." → Act: calls the search tool → Observe: gets a list.
  2. Plan: "Now rank by stars and pick the top three." → Act: runs code to sort → Observe: gets the top three.
  3. Plan: "Read each repo's description for the summary." → Act: fetches each page → Observe: gets the text.
  4. Plan: "Write the summary and send it." → Act: calls the email tool → Observe: "sent." → Done.

Four trips around the same loop, each informed by the last. No step was pre-scripted by a human — the model chose each one.

Why Agents Fail (and How They're Kept in Line)

More autonomy means more ways to go wrong:

  • Compounding errors. A wrong step early sends the whole chain sideways. Recent research found even top models can correctly identify where an agent went wrong only about 41% of the time — so agents are bad at self-correcting. (See the June 2026 research digest.)
  • Prompt injection. If an agent reads a malicious web page, hidden instructions can hijack it. (See how a hidden line of text hijacks an AI browser.)
  • Doing too much. An over-eager agent can take an irreversible action you didn't intend.

The fixes are all about containment, not blind trust: give the agent the minimum permissions it needs, sandbox its tools, put a human approval gate in front of irreversible actions (sending money, deleting data), and use external checks rather than letting it grade its own work.

From One Agent to a Team

The frontier of 2026 is multiple agents working together. Instead of one generalist, you orchestrate specialists — one plans, one writes code, one tests it, a quality gate checks the result — handing work between them. That's how complex software gets built: a coordinated team of agents, each doing one job well, with guardrails between them.

That orchestration — specialist agents, quality gates, and a human in control — is exactly the model behind a production AI build system like Build This Now. For the deeper mechanics, see autonomous agent loops and Claude Code dynamic workflows.

Arrête de tout configurer. Place à la construction.

Des templates SaaS avec orchestration IA.

Frequently Asked Questions

How does an AI agent work in simple terms?

An AI agent is a language model running in a loop with tools and a goal. It plans a step, uses a tool to act, observes the result, and repeats — adjusting as it goes — until the goal is complete. Unlike a chatbot, it can take real actions, not just produce text.

What's the difference between an AI agent and a chatbot?

A chatbot answers once and stops. An agent keeps working toward a goal across many steps, using tools to act on the world and reacting to what it finds. Asking a chatbot is like asking for directions; an agent is like handing someone the keys to drive there.

What does "agentic" mean?

"Agentic" describes AI that takes autonomous, multi-step action toward a goal rather than just responding to a single prompt. An agentic system plans, acts with tools, and adapts — the behavior at the heart of 2026's AI products.

Are AI agents safe?

They carry real risks because they can take actions: errors compound, malicious content can hijack them, and they can overreach. The standard safeguards are limiting their permissions, sandboxing their tools, requiring human approval for irreversible actions, and using external checks instead of trusting the agent to police itself.

How do multiple AI agents work together?

In a multi-agent system, specialist agents each handle one job — planning, coding, testing, reviewing — and pass work between them, often coordinated by an orchestrator with quality gates in between. This division of labor handles complex tasks more reliably than a single all-purpose agent.

Continue in Core

  • La Fenêtre de Contexte 1M dans Claude Code
    Anthropic a activé la fenêtre de contexte 1M tokens pour Opus 4.6 et Sonnet 4.6 dans Claude Code. Sans header beta, sans surcharge, tarification fixe, et moins de compactions.
  • AGENTS.md vs CLAUDE.md : expliqué
    Deux fichiers de contexte, une seule base de code. Comment AGENTS.md et CLAUDE.md diffèrent, ce que chacun fait, et comment utiliser les deux sans rien dupliquer.
  • Why a Hidden Line of Text Can Hijack Your AI Browser
    AI browsers read the whole web page — including text hidden from you. That's the door behind prompt injection, OWASP's #1 AI security risk in 2026. Here's how the attack works, in plain English.
  • AI Research for Builders: The Latest Breakthroughs, Explained Monthly
    A monthly digest of the latest AI research — agents, reasoning, efficiency, and models — with every claim traced to its source and translated into what it means if you build with AI.
  • 10 AI Research Breakthroughs That Matter for Builders (June 2026)
    The latest AI research, explained: AI disproved an 80-year-old math conjecture, agents got cheaper and more reliable, and inference costs dropped up to 100x. What each finding means if you build with AI.
  • Did Anthropic Call for an AI Pause? What It Actually Said
    Anthropic did not call to halt the AI boom. Here is what its June 2026 'recursive self-improvement' post actually said, why the 80%-of-its-own-code stat spooked it, and what it means if you build with Claude Code.

More from Handbook

  • Principes de base de l'agent
    Cinq façons de construire des agents spécialisés dans le code Claude : Sous-agents de tâches, .claude/agents YAML, commandes slash personnalisées, personas CLAUDE.md, et invites de perspective.
  • L'ingénierie du harness agent
    Le harness, c'est toutes les couches autour de ton agent IA sauf le modèle lui-même. Découvre les cinq leviers de contrôle, le paradoxe des contraintes, et pourquoi le design du harness détermine les performances de l'agent bien plus que le modèle.
  • Patterns d'agents
    Orchestrateur, fan-out, chaîne de validation, routage par spécialiste, raffinement progressif, et watchdog. Six formes d'orchestration pour câbler des sub-agents Claude Code.
  • Meilleures pratiques des équipes d'agents
    Patterns éprouvés pour les équipes d'agents Claude Code. Prompts de création riches en contexte, tâches bien calibrées, propriété des fichiers, mode délégué, et correctifs v2.1.33-v2.1.45.

Arrête de tout configurer. Place à la construction.

Des templates SaaS avec orchestration IA.

How Does AI Image Generation Work? (The Noise-to-Picture Trick)

AI image generators like Midjourney and DALL-E start with pure visual static and slowly remove the noise until a picture appears — guided by your words. Here's how diffusion actually works, explained simply.

What Is a Token in AI? (Why ChatGPT Charges by the Token)

A token is a chunk of text — roughly ¾ of a word — and it's the unit AI models read, generate, remember, and bill by. Here's what a token actually is and why it controls your AI costs and limits.

On this page

Table of Contents
Chatbot vs. Agent: The Real Difference
The Loop: Plan, Act, Observe, Repeat
Tools Are the Agent's Hands
A Worked Example
Why Agents Fail (and How They're Kept in Line)
From One Agent to a Team
Frequently Asked Questions
How does an AI agent work in simple terms?
What's the difference between an AI agent and a chatbot?
What does "agentic" mean?
Are AI agents safe?
How do multiple AI agents work together?

Arrête de tout configurer. Place à la construction.

Des templates SaaS avec orchestration IA.