SproutStackSproutStack home

What are AI Agents?

5 min readBeginner-friendlyFree to read

Read a little, play a little. No scary maths, and no rush.

Share:

From answering to doing

A chatbot answers questions. An agent completes jobs: "refund order 12847, notify the customer, and file a ticket" — planning steps, calling tools, adapting when reality differs from the plan. The difference is the loop: agents act, observe results, and replan, while chatbots just respond once.

The loop that defines them

Plan → act → observe → repeat. Given "book me a trip," the agent checks calendars (tool), finds flights (tool), notices a conflict (observation), and asks you which meeting moves (replan). See /animations/agent-loop for the visual. Everything else — memory, tools, guardrails — exists to keep this loop honest and safe.

Memory: yesterday matters

  • Short-term: recent conversation turns, kept verbatim (and summarized when long).
  • Long-term: user preferences, past orders, learned facts — retrieved from vector stores or profile databases when relevant.
  • Checkpoints: full run state saved per step, so crashes resume instead of restarting (or double-charging).

One run of a refund agent

Request: "Order 12847 arrived broken, I want my money back."

  1. Plan. Look up the order, check the refund policy, refund if eligible, tell the customer.
  2. Act and observe. get_order(12847) shows delivery four days ago, $180, paid by card. The policy search returns: damaged items, full refund within 30 days.
  3. Gate. The refund exceeds the $100 auto-approve limit, so the agent drafts it and pauses for a human to approve.
  4. Act. After approval it calls issue_refund with an idempotency key, so a retry cannot pay twice.
  5. Finish. It messages the customer and records every step.

The loop handled the unexpected (the approval threshold) without being scripted for it, and the risky step still went past a person.

Guardrails before autonomy

Start with 1–2 read-only tools and strict evals. Add writes only with human approval above thresholds. Multi-agent setups (planner + worker + checker) come last — most tasks don't need the orchestra, just one reliable loop with good tools and a human on the risky buttons.

Agent or workflow?

If you can write the steps down in advance (extract the fields, look up the customer, draft a reply), you do not need an agent. A workflow, a fixed sequence of model and tool calls in your code, is cheaper, faster, and far easier to test. Reach for an agent when the path genuinely depends on what is discovered along the way, such as debugging, research, or support cases that branch unpredictably. Many products sold as agents are better built as workflows.

Knowing when to stop

An agent needs explicit stopping rules: a maximum number of steps, a cost budget per task, a clear definition of done, and an instruction to ask the user rather than guess when it is uncertain. Without them, a confused agent keeps trying variations, spending money until something external stops it.

Remember this

  • Agents = ReAct loops with memory and tools, aimed at jobs not questions.
  • Autonomy is earned: read-only first, approvals for writes, evals throughout.

Check your understanding

5 questions · first-try answers earn the most XP

1. What distinguishes an AI agent from a plain single-turn chatbot?
2. Why does the chapter say most tasks do not need a multi-agent setup?
3. Why start an agent with one or two read-only tools?
4. What is a checkpoint for, in an agent system?
5. Your agent books a flight and finds a calendar conflict. What should happen next?

My notes

Saved in this browser. Highlight a line above and save it, or write it in your own words.

Nothing saved yet. Your highlights will live here.

References

Finished reading?

Ticking it here also ticks the chapter in the sidebar, the section count and your streak — it is all one number.

Related chapters

Spotted a mistake or want a topic covered? Report an issue

📬 An occasional email when new lessons land

New lessons and showdowns, no more than a few times a month. No spam, unsubscribe anytime. We store your email only to send the newsletter.