How AI Agents Work

Agents are where AI stops talking and starts doing things that change the world.

A chatbot answers questions. An agent takes actions that have side effects: it sends messages, moves data, and changes systems. The difference is not intelligence; it is architecture. An agent combines a language model as its reasoning engine, a context window as working memory, tools as its hands, and external memory as long-term storage. Its control flow follows the ReAct loop: reason, act, observe, then reason again until the goal is reached. Plan-and-execute is a faster alternative when the path is known in advance, and most real systems blend both.

The module gives you the design vocabulary. Three characteristics define an agent: autonomy, proactiveness, and action through tools, and each is a design choice rather than an innate property. PEAS, which stands for Performance measure, Environment, Actuators, and Sensors, is the specification framework that prevents most agent failures when applied early. Tool calling works through structured function schemas: the model outputs a JSON request, the surrounding system validates it, executes the real operation, and returns the result. Memory splits into short-term context for the current task and long-term storage retrieved through vector search.

After reading, you will be able to draw the safety lines. The language model is a reasoning processor, not a knowledge base, so facts must come from tools and retrieval. Non-determinism is acceptable for low-stakes decisions and unacceptable for irreversible ones, so verification checkpoints belong before payments, deletions, and external communications. An agent's mistakes scale instantly, which is why rate limits, allow-lists, and code-enforced guardrails matter more than prompt-level instructions.

The failure modes repeat across organizations. Teams give the agent broad access and hope the prompt will constrain it. They let early mistakes cascade through later steps without checkpoints. They treat the model as a source of truth for facts that should come from a verified data source. Ask for the PEAS specification, a rate limit, and a kill switch before approving any agent that touches production.

In one paragraph

A chatbot answers questions. An agent takes actions that have side effects. The difference is not intelligence, it is architecture. An agent combines a language model as the reasoning engine, a context window as its working memory, tools as its hands, and external memory as its long-term storage. Its control flow follows the ReAct loop: reason, act, observe, reason again, until the goal is reached. Plan-and-execute is a faster alternative when the path is known in advance. In practice, most systems blend both, adding human checkpoints before any irreversible action.

This module is part of the Agents and Tooling track in the free AI Learning Hub. Source material: How AI Agents Work.