ArcLibrary

Agent

Upgrading 'chatbot' to 'AI that can actually get things done.'

AgentBasics
核心 · Key Idea

In one line: An Agent is an AI system that perceives an environment, makes its own decisions, calls tools, and iterates until a goal is met — not just a "ask one, answer one" chatbot.

What it is#

A chatbot answers a single turn. An Agent takes a goal, decomposes it into tasks, watches the results, and picks the next step on its own. At minimum it has four pieces:

  1. Brain (LLM) — makes decisions
  2. Tools — fetch external data, perform actions
  3. Memory — keeps context and history
  4. Loop — think → act → observe → think again, until done

Analogy#

打个比方 · Analogy

A chatbot is the restaurant host — answers what you ask, nothing more.
An Agent is the intern — say "book me a high-speed train to Shanghai tomorrow" and it checks schedules, compares prices, clicks "book", fills in your details, pays, and emails you the PDF — all without you micromanaging each step.

Key concepts#

LLM CoreBrain
Every decision is generated by an LLM — it is the Agent's CPU.
ToolsTools
Search, browser, code interpreter, API calls — the Agent's 'hands' into the outside world.
PlanningPlanning
Breaking a big goal into small steps. The line between Agent and chatbot.
MemoryMemory
Short-term (context window) + long-term (vector DB / database) so the Agent can work across sessions.
LoopLoop
Patterns like ReAct let the model iterate — without a loop you only have a one-shot assistant.

How it works#

In essence: Agent = LLM + Tools + Loop. Everything else is a refinement on top of those three.

Practical notes#

  • Decide the loop's exit condition first. Does the model declare "done"? Or do you cap the step count? Without this an Agent will burn money forever.
  • The tool description matters more than the tool itself. Whether the model picks the right tool is 95% a function of how well its description and parameter schema are written.
  • A hard-coded shortcut beats full autonomy. Anything you can pin in the prompt (e.g. "first search, then analyse, then summarise") shouldn't be left to the model — it's both more stable and cheaper.
  • Observability is non-negotiable. Every think / act / observe step must be traced. Without traces the Agent is a black box you cannot debug.

Easy confusions#

Chatbot
Single-turn, stateless.
Doesn't call tools, can't actually do things.
Agent
Multi-step loop, has memory.
Calls tools, changes the world, delivers a result.
Agent
**The model decides** what to do next.
Flexible but unpredictable.
Workflow
**A human pre-defines** the nodes and transitions.
Stable but never improvises.

Further reading#

  • ReAct — the canonical "think-act-observe" pattern
  • Planning — decomposing large goals
  • Multi-Agent — collaborating agents
  • Workflow — the deterministic counterpart to Agents