Agents & Tool Use

Layer 1 · Intuition

Agents & Tool Use

What an LLM agent is, why tools turn a text predictor into something that can act, and the buzzwords decoded.

5 min read40 XP

  1. User goal

    "book me a flight"

  2. Model thinks

    plans next action

  3. Tool call

    search_flights(...)

  4. Tool result

    fed back as text

  5. Repeat or answer

    loop until done

The agent loop: think, act, observe, repeat.

A base LLM only does one thing: given some text, predict more text. An agent is a base LLM wrapped in a loop that lets it also *act* on the world — search the web, run code, query a database, send an email — by emitting a structured request for a tool call, having that tool actually executed outside the model, and reading the result back in as new context before deciding what to do next.

  • Tool / function calling — the model outputs a structured request (e.g. JSON naming a function and its arguments) instead of, or alongside, a normal reply.
  • Agent loop — the repeated cycle of the model observing state, deciding an action, and receiving the outcome, until it decides the task is finished.
  • ReAct — a prompting pattern that interleaves *reasoning* traces ('I should search for X') with *actions* (the actual tool call), which noticeably improves reliability over acting silently.
  • Orchestration / agentic framework — libraries (LangChain, LlamaIndex agents, OpenAI's Assistants/Responses API) that manage the loop, tool schemas, and memory for you.

The reason this exploded in popularity around 2023–2024 is that models got reliable enough at *following a schema* (emit exactly this JSON shape) to make automated execution safe-ish, and providers started training models specifically to know *when* to call a tool versus just answering directly.

  • Agents let LLMs answer questions requiring fresh or private information (search, internal APIs) they were never trained on.
  • They let LLMs perform multi-step tasks — booking, coding, data analysis — where the answer only emerges after several actions.
  • The failure modes are new too: calling the wrong tool, hallucinating arguments, looping forever, or taking an irreversible action (sending a real email) based on a wrong plan.

Think of an agent as three separable pieces: (1) a way for the model to *express* an action (the tool schema/interface), (2) a harness that executes actions and reports results, (3) a stopping condition so the loop knows when to hand control back to the user. Later layers unpack how each piece actually works.

Check your understanding

4 questions · answer all to submit

  1. 1.What core characteristic transforms an LLM into an 'agent'?

  2. 2.In the ReAct prompting strategy, what is the primary benefit of interleaving explicit reasoning steps with actions?

  3. 3.Which component is responsible for executing a tool call requested by an LLM agent?

  4. 4.What is a documented drawback when an agent is provided with an excessive number of available tools?