cd /news/ai-agents/ai-agents-explained-how-they-actuall… · home topics ai-agents article
[ARTICLE · art-132530] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=· neutral

AI Agents Explained: How They Actually Work

A developer explainer details how AI agents differ from conventional LLM workflows: rather than following predefined code paths, an agent's model dynamically directs its own process and tool usage in a loop, observing state, choosing an action, executing it, and feeding the result back. The piece cites Anthropic's engineering guidance that agents should include stopping conditions such as a maximum iteration count, and recommends a no-progress guard that hashes tool, arguments, and result to halt after two or three identical repeats. It also notes that tool calling is a structured JSON feature, with MCP standardizing how agents connect to tools they don't already know about.

by read3 min views3 publishedSep 17, 2026

Originally published on DevToolHub. AI agents explained in one sentence: software where an LLM decides what to do next — which tool to call, with what arguments — based on the result of what it just did, in a loop, instead of following a script you wrote in advance. That loop, and the model's control over it, is the entire difference between an agent and a regular app that happens to call an LLM.

Anthropic's own engineering team draws the line clearly. A workflow is a system "where LLMs and tools are orchestrated through predefined code paths." An agent is a system where "LLMs dynamically direct their own processes and tool usage, maintaining control over how they accomplish tasks." In a workflow, your code decides what happens next. In an agent, the model does — which tool to call, whether to call another after seeing the result, and when the task is done.

Tool calling is a structured feature, not a prompt trick. You describe each tool as a JSON schema and pass it to the model. Ollama's /api/chat documents the shape: a tools array with type: "function" entries carrying a name, description, and parameters. When the model wants to use one, it returns a tool_calls array with the function name and arguments — your code executes it and sends the real result back as a new message.

Observe state, decide an action, execute it, feed the result back as the new state. Left unchecked, that loop has no natural end. Anthropic's guidance is explicit that agent tasks "often terminate upon completion, but it's also common to include stopping conditions (such as a maximum number of iterations) to maintain control." Pick at least one before an agent goes near production traffic.

Tool-calling JSON solves how a model requests a tool. It doesn't solve how an agent connects to tools it doesn't already know about — that's what MCP standardizes. See which MCP servers are worth connecting and what changed when MCP's auth spec updated before wiring an agent into one.

A common failure isn't a wrong answer — it's the same tool call, same arguments, repeated forever, because "nothing in its setup tells it that repeating an identical call is pointless." Frameworks default to generous iteration caps (LangGraph 25 steps, LangChain 15) that catch this late. A no-progress guard — hash (tool, arguments, result), halt after 2-3 identical repeats — catches it in seconds.

If the steps are known and fixed, build a workflow: more predictable, easier to debug, lower runaway-cost risk. Reach for an agent when the right sequence genuinely depends on what's discovered along the way. Most real systems mix both rather than making an entire pipeline agentic by default. Vague tool success signals that invite retries. Trusting iteration limits alone to catch stuck loops fast. Skipping the tool-permission question — an agent is only as safe as what its tools can do. Making everything agentic when a fixed workflow would be simpler and cheaper.

Full article with FAQ and quick summary: devtoolhub.com/ai-agents-explained

── more in #ai-agents 4 stories · sorted by recency
── more on @anthropic 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/ai-agents-explained-…] indexed:0 read:3min 2026-09-17 ·