AI Agents Overview
Goals, loops, and tools
An agent is a model in a loop: it plans, calls tools, observes results, and iterates toward a goal — autonomously or with human checkpoints. Agents turn single-shot LLM calls into goal-driven systems.
What you will learn
- Define what makes something an agent
- Map the agent loop and its stages
- Set the right autonomy level per task
What is this?
An agent is a system where a model drives a loop toward a user goal: interpret the goal, plan, invoke tools, observe results, revise, repeat — until completion or a stop. Unlike a one-shot call, an agent holds state, acts, and adapts. Autonomy ranges from fully supervised (approve each step) to fully autonomous (bounded by caps).
Why do you need it?
- Complex goals need multiple steps and real-world inputs.
- Loop structure makes behavior inspectable and evaluable.
- Tool access turns understanding into action.
- Explicit stop conditions keep autonomy safe and bounded.
Mental model
A junior engineer with a task board
An AI agent
They read the ticket (goal), break out steps (plan), check the docs and run tests (tools), see results, iterate, and check in at decision points (human checkpoints). You gave them the board, not the keys to the kingdom.
How it works
- Define the goal and success criteria.
- Give the agent tools + a loop (see agent-loop).
- Let it plan, act, observe, revise — with caps.
- Decide autonomy: approvals for high-stakes steps.
- Evaluate completion quality and safety.
The agent pattern.
In production
- Customer-service agents ticket, research, and draft replies.
- Research agents gather and synthesize across sources.
- DevOps copilots diagnose, fix, and verify infrastructure issues.
Best practices
- Start supervised: approvals for anything consequential.
- Give every loop a cap and a clear done-condition.
- Log each step for eval and debugging.
- Treat the agent as a bounded worker, not a free agent.
Common mistakes
- No success criteria — the loop stops by vibes.
- Full autonomy from day one.
- Silent steps: users can't see or audit progress.
Common issues
Agent drifts from the user's goalGoal ambiguity
Restate the goal each loop; keep criteria visible.
Too many approvals kills momentumOverly cautious gates
Auto-approve known-safe reads; gate only writes/costly acts.
Debugging tips
- Agent loops forever → missing stop condition or cap.
- Wrong goals met → success criteria vague; tighten.
- Steps unreproducible → log inputs/outputs per step.
Interview checkpoint
Hands-on lab
- Represent a plan as an ordered list of actions
- Execute actions with a done condition and a step cap
- Trace every step and result for post-hoc inspection
Run a Deterministic Agent Loop
25 min · beginner
Quick quiz
The defining features of an agent:
High-stakes steps should start with human approval.