The default behavior of any large language model (LLM) is to act as a stateless predictor of text. You pass in a prompt, the model calculates probability distributions over vocabulary tokens, streams the resulting response, and halts. It does not verify whether its claims are true, query live systems, or correct mistakes encountered along the way.
This is the fundamental boundary separating a Chatbot from an AI Agent. While a chatbot generates text about a problem, an AI Agent is given the scaffolding to solve it autonomously—binding model reasoning to external tools, system memory, and continuous observation loops.
When you ask a coding agent to fix a bug in a codebase, it doesn't just guess the fix in a single shot. It reads the project directory, inspects the compiler output, writes a candidate patch, executes unit tests, and loops until the test suite passes.
The ReAct Execution Loop
Most modern agent architectures implement the ReAct (Reason + Act) framework. Rather than generating a single answer, the agent breaks its objective down into alternating cycles of reasoning and action:
- Thought: The LLM core evaluates the user prompt and current state to determine what information or action is needed next.
- Action: The agent issues a structured JSON payload calling an external tool signature (e.g., querying a database, invoking a web search, or running a shell script).
- Observation: The execution runtime intercepts the tool payload, runs the function, and feeds the response data directly back into the agent's context window.
This cycle repeats continuously until the agent determines that the goal has been achieved, at which point it returns the final result to the user.
Why Model Context Protocol (MCP) Matters
Historically, connecting AI agents to external databases and dev tools required custom API wrappers for every integration. Model Context Protocol (MCP) solves this by standardizing how host applications expose data sources, prompt templates, and tool interfaces to LLMs over JSON-RPC.
With MCP, an agent can seamlessly discover available tools—whether it is querying a local Git repository, fetching PostgreSQL records, or inspecting production deployment logs on Google Cloud—using a unified protocol interface.
The Path Forward
Building reliable AI agents requires moving beyond simple prompts and focusing on software engineering discipline: strict tool schemas, deterministic verification steps, and robust error recovery.
In the next chapter of The Visual AI Handbook, we will explore Tool Calling & Model Context Protocol (MCP) in depth—building a custom MCP server from scratch to connect agents to real-world infrastructure.


