Back to Post
LLM Agents: Tools in a Loop
1 / 1

📖 Quick Start

Inspired by Simon Willison’s definition—“LLMs calling tools in a loop to achieve a goal”—this post keeps things simple and practical. If you remember one thing about agents, make it this: an agent is a loop that thinks, acts with tools, observes, and repeats until done.

What is an Agent?

The Core Loop

goal → think → choose_tool → call_tool → observe_result
    → decide: done? otherwise refine plan and loop
flowchart TD
    Start([Goal]) --> Think[Think: Analyze situation]
    Think --> Choose[Choose Tool]
    Choose --> Call[Call Tool]
    Call --> Observe[Observe Result]
    Observe --> Decide{Goal Reached?}
    Decide -->|No| Think
    Decide -->|Yes| End([Done])

Tools an Agent Can Call

A Quick Example

Goal: “Turn expenses.csv into a bar chart of monthly totals.”

  1. Think: “I need to read the file, group by month, and plot.”
  2. Act: Call file.read('expenses.csv') → observe rows
  3. Think: “I’ll write and run a small Python snippet.”
  4. Act: Call code.run(python, script) → observe a PNG path
  5. Decide: Goal reached → return “Chart saved at charts/monthly.png”

🔨 Try It Now (2 minutes)

Task: Watch an agent think, act, and verify in your own codebase

Prompt:

Read package.json, list all dependencies, and create a summary
markdown file called deps-summary.md with total count.

Verification:

Expected outcome: You’ll see the agent read the file, count dependencies, create a new file, and confirm it worked—the core loop in action.

When Does the Loop Stop?

Why This Matters

Quick FAQ

Q: How is an agent different from ChatGPT or Copilot? A: ChatGPT gives you text responses. Copilot suggests code. Agents run tools in a loop—they read files, run tests, see results, and iterate until the goal is met.

Q: What if the agent makes a mistake? A: Review diffs, stage good changes, discard bad ones. Git is your safety net.

Q: Can agents write entire apps? A: They excel at focused tasks with clear goals. Think “fix this bug and verify” not “build me Instagram.”

What’s Next

Now that you understand the core loop, it’s time to experience it yourself:

Next: Get Your First Win in 15 Minutes — Watch the agent loop in action on a real task in your codebase.

Alternative start: Coding with Agents in 2025 — Complete overview and mindset before diving in.

Practice Path:

  1. You are here: What is an Agent
  2. First Win in 15 Minutes
  3. Workflows That Stick
  4. Power Patterns
  5. Planning Workflow

Reference: Simon Willison’s post on agents provides the foundational definition this intro builds on.