Build This Now
Build This Now
クロード・コードとは何か?Claude Code のインストールClaude Code ネイティブインストーラーClaude Code で最初のプロジェクトを作る
How LLMs WorkAI Image GenerationHow AI Agents Workエージェンティックコーディングとは?やさしい言葉での解説バイブコーディングとは?やさしい言葉での解説AI TokensVector EmbeddingsChatGPT Dreaming MemoryAI Browser InjectionAI Energy & WaterIs AI a BubbleEU AI ActAI Voice ScamsAgentic CommerceWhy AI Uses GPUsHow HTTPS Works
speedy_devvkoen_salo
Blog/Handbook/Core/How AI Agents Work

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.

設定をやめて、構築を始めよう。

AIオーケストレーション付きSaaSビルダーテンプレート。

企業向けに構築している実績を見る →
speedy_devvkoen_salo
speedy_devvWritten by speedy_devvPublished 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

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.

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

  • Claude Codeにおける100万トークンコンテキストウィンドウ
    AnthropicはClaude CodeのOpus 4.6とSonnet 4.6に対して100万トークンのコンテキストウィンドウを有効化した。ベータヘッダー不要、追加料金なし、定額料金、そして圧縮の削減。
  • AGENTS.md vs CLAUDE.md 解説
    2つのコンテキストファイル、1つのコードベース。AGENTS.mdとCLAUDE.mdの違い、それぞれが何をするか、重複なしに両方を使う方法を解説します。
  • 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.
  • 15 AI Research Breakthroughs (June 2026)
    The latest AI research, explained: DeepSeek shipped DSpark and a million-token V4, open coding models closed the gap, AI disproved an 80-year-old math conjecture, and inference costs kept dropping. 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

  • 深い思考のテクニック
    「think harder」「ultrathink」「think step by step」などの思考トリガーフレーズは、Claude Code を拡張推論モードに切り替え、同じモデルでテスト時計算を増やします。
  • 効率化パターン
    置換フレームワークを使えば、手動で8〜12回ビルドしたものをCLAUDE.mdテンプレートに変換し、Claude Codeがバリエーション11、12、13をオンデマンドで生成できるようになります。一度記録するだけで完了です。
  • Claude Code ファストモード
    ファストモードは Claude Code で Opus 4.6 のリクエストを優先サービングパスにルーティングします。同じモデル、同じ上限品質で、トークン単価は上がりますが返答が2.5倍速くなります。
  • スピードの最適化
    モデルの選択、コンテキストの大きさ、プロンプトの具体性が、クロード・コードの返答の速さを決める3つのレバーである。/モデル俳句、/コンパクト、/明確をカバーする。

設定をやめて、構築を始めよう。

AIオーケストレーション付きSaaSビルダーテンプレート。

企業向けに構築している実績を見る →
speedy_devvkoen_salo

AI Image Generation

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.

エージェンティックコーディングとは?やさしい言葉での解説

エージェンティックコーディングとは、AI エージェントが複数のステップにまたがって、自分で計画し、書き、実行し、テストすることです。ただ行を補完するだけではありません。どう動くのか、オートコンプリートやバイブコーディングとどう違うのかを解説します。

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?

設定をやめて、構築を始めよう。

AIオーケストレーション付きSaaSビルダーテンプレート。

企業向けに構築している実績を見る →