← Library · agents

Agents — when an LLM gets hands and memory

Agents — when an LLM gets hands and memory

An LLM with tool use, a loop, and memory. Lots of marketing, few definitions. Here's the plain version.

What it is

An agent = an LLM in a loop with access to tools (search, shell, APIs)
and some form of memory. The cycle is dumb:

while not done:
    decide(next action) → call tool → read result → update plan

That's it. Everything else is a variation.

What it is not

  • Not consciousness. Not "AGI". Not "the AI that replaces you".
  • Not a chatbot you told "do whatever". That's just a chatbot with a
    frustrated user.
  • Not one giant prompt. State, plan, and memory live outside the LLM,
    in the application. The LLM only picks the next action.

Where "agent vs. workflow" splits

  • Workflow: steps are predefined, the LLM just fills in the holes.
    (Classic "summarize → translate → email".)
  • Agent: the LLM picks the next step from state. The loop can run
    long and do things you didn't expect.

Workflow is safer, cheaper, easier to debug. Agents make sense when the
task requires exploration — unknown data, unknown environment.

MCP, ReAct, tool use

  • Tool use = the format an LLM uses to say "call X with arguments Y".
    Anthropic does it natively, OpenAI too — a solved problem.
  • ReAct = the original paper that said "alternate Reasoning and
    Action". Now it's just a historical term for "agent loop".
  • MCP (Model Context Protocol) = a standardized way to expose tools
    and resources (filesystem, DB, APIs) to a model like plugins. Local
    server, declarative schema. Anthropic is pushing it, the ecosystem
    is growing.

Memory

Three layers worth distinguishing:

  1. Working memory — token window of the current conversation.
  2. Episodic — what happened in previous sessions.
    Typically log + summarization + RAG.
  3. Semantic — learned facts about the domain.
    Typically a structured store + a lookup tool.

A single "magical" memory layer doesn't exist. That's marketing.

Common mistakes

  • No loop limits → the agent loops forever and chews through your
    token budget.
  • No human-in-the-loop for irreversible actions (delete, payment, deploy).
  • Too many tools → the model picks the wrong one.
    Rule of thumb: under 10, ideally 3–5.
  • No evals. If you don't know how many actions a task takes on average
    and what the success rate is, you're just hoping.

What to remember

An agent is a dumb loop around a smart model. Most problems people
blame on the model (hallucinations, lost context, bad decisions) are
actually bugs in the loop — not in the model.