Agents & Orchestration Entry

AI agents, explained

Reviewed August 2026

TL;DR: An AI agent is a language model wrapped in a loop and given tools. Instead of answering once and stopping, it observes the situation, decides on an action, executes it, reads the result, and repeats until the task is done. The model supplies the judgment; the loop and the tools supply the ability to actually do things.

How it works

A chatbot is a single round trip: prompt in, text out. An agent runs the same language model inside a loop. Each turn, the model sees the goal plus everything that has happened so far, then chooses one of two moves: call a tool, or declare the task finished. If it calls a tool, your code runs the action, appends the result to the transcript, and hands control back to the model for the next turn. That observe-decide-act cycle is the whole trick - there is no separate planning engine, just a model repeatedly asked "given all this, what next?"

A concrete example: ask an agent to find out why checkout is failing in production. Turn one, it calls a log-search tool and reads the errors. Turn two, it greps the codebase for the function throwing them. Turn three, it opens the file, spots a null check missing after a recent change, and writes up the diagnosis with the offending line. No human scripted that sequence - the model chose each step based on what the previous step returned.

Four parts make this work. The model provides reasoning and decides what to do. The tools - defined through function calling - are the actions available: search, file edits, API calls, code execution. The harness is the surrounding program that runs the loop, executes tool calls, and manages the transcript. And the stopping conditions decide when the loop ends: the model says it is done, a turn budget runs out, or an error forces a halt. Weakness in any one of the four caps the whole system.

Autonomy is a dial, not a switch. At the low end sits a fixed agentic workflow where the model fills in steps a developer ordered in advance. At the high end, the model plans, acts, and self-corrects for many turns unattended. More autonomy buys more capability and more ways to fail - agents compound small errors across turns, which is why real deployments pair them with guardrails, review gates, and per-tool permissions.

Where it sits in the AI stack

The agent is the layer that connects a user's goal to real-world effects. It consumes the model's reasoning, drives tools, and produces actions:

Everything else in this category hangs off this loop: memory feeds it context between sessions, guardrails constrain what it may do, and multi-agent systems run several loops in parallel. The most visible agents in practice are coding agents, where the tools are a terminal, a file editor, and a test runner.

Key tools and implementations

  • Provider agent SDKs

    Model vendors ship SDKs with the loop, tool execution, and context handling built in.

  • LangGraph

    Models an agent as a graph of nodes and edges, giving explicit control over loops and state.

  • Coding agents

    CLI and IDE agents that edit files, run tests, and iterate - the pattern's proving ground.

  • Plain-code loops

    A while loop around a model API call - many production agents are exactly this, on purpose.