An AI agent is an LLM in a loop in 20 lines of code: where complexity begins
"Build us an AI agent" today sounds like "build us a button"—but the word "agent" hides three different things: a prompt, a chatbot, and an actual agent. A Habr author shows an agent's anatomy with code (at its core: an LLM in a loop of 20 lines), breaks down five ways to accidentally burn your agent budget, and offers a simple filter to understand if you need one at all.
AI-processed from Habr AI; edited by Hamidun News
The phrase "build us an AI agent" now sounds as simple as "build a button," even though the word "agent" in practice hides three different things — a prompt, a chatbot, and an actual agent, explains the author of an article on Habr dedicated to the anatomy of AI agents.
How an Agent Differs From a Prompt and Chatbot
According to the author, confusion around agents arises because three completely different things — a simple prompt, a dialogue chatbot, and a full-fledged agent — are called the same. The difference is fundamental: an agent does not simply answer a question, it acts in a loop, making decisions independently about the next step.
What Is the Anatomy of an Agent
At the core of a minimal AI agent, according to the author, lies an LLM running in a loop — such a construct can be implemented in literally twenty lines of code. This is where the real complexity begins: turning a minimal loop into a reliable system that does not waste budget and solves a real problem.
- The basic architecture of an agent — an LLM in a loop, approximately 20 lines of code
- The author identifies three different concepts confused under the word "agent": prompt, chatbot, agent
- The article outlines five ways to accidentally burn through budget on an agent
- A simple filter is given for checking whether a task really needs an agent
What This Means
Demand for "AI agents" outpaces understanding of what they actually are: while teams confuse a prompt, a chatbot, and an agent, budgets continue to be wasted on development. Clear separation of these concepts and a simple filter of "do we even need an agent" is a practical way to avoid overpaying for a trendy term.
- Oct 29, 2026Sonnet 4.6 with Sourcegraph MCP Server Beats Fable 5: 0.698 vs 0.568
- Oct 29, 2026Stale Facts in Agent Memory Drop Qwen2.5 Accuracy from 100% to 44.6%
- Oct 29, 2026Skills for AI agents hurt weak models: a meta-skill recovered up to 14 points
- Oct 29, 2026AI agent on GPT-5.5 audits 2600 TravelLine autotests in two weeks
Key Questions Answered
How an Agent Differs From a Prompt and Chatbot?
According to the author, confusion around agents arises because three completely different things — a simple prompt, a dialogue chatbot, and a full-fledged agent — are called the same. The difference is fundamental: an agent does not simply answer a question, it acts in a loop, making decisions independently about the next step.
What Is the Anatomy of an Agent?
At the core of a minimal AI agent, according to the author, lies an LLM running in a loop — such a construct can be implemented in literally twenty lines of code. This is where the real complexity begins: turning a minimal loop into a reliable system that does not waste budget and solves a real problem. The basic architecture of an agent — an LLM in a loop, approximately 20 lines of code The author identifies three different concepts confused under the word "agent": prompt, chatbot, agent The article outlines five ways to accidentally burn through budget on an agent A simpl
What This Means?
Demand for "AI agents" outpaces understanding of what they actually are: while teams confuse a prompt, a chatbot, and an agent, budgets continue to be wasted on development. Clear separation of these concepts and a simple filter of "do we even need an agent" is a practical way to avoid overpaying for a trendy term.
Build & Ship Production AI Agents Without Boilerplate Code
Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.