Data Scientist → AI Engineer • Training 12
Article-Training • AI Engineering Foundations

Agents

Giving LLMs Tools, State and Actions

Move beyond single-turn generation. Learn how agents choose tools, maintain state, plan steps, recover from errors and operate within bounded permissions.

Goal → Observe → Decide → Tool → Result → Update State → Continue/Stop
🎯 GOAL
→
👁️ OBSERVE
→
🧠 DECIDE
🔧 TOOL
→
📦 STATE
→
✅ STOP
8learning modules
24interactive practices
5rapid review questions
50%certificate threshold
Learning target
Design bounded agents that use tools and state to complete multi-step tasks reliably.
Practice progress0 / 24

Complete 12 of 24 practices (50%) and enter your name to unlock the Certificate of Participation.

MODULE 01
🤖

What Makes an Agent an Agent?

An agent uses a model inside a loop that observes state, chooses actions or tools, receives results and decides what to do next.

👁️
See it this way

The difference from a chatbot is not personality; it is controlled action over multiple steps.

Core ideas

  • Goal-directed loop
  • Tool/action selection
  • State updated between steps
Production sketch
while not done:
  action = decide(state)
  state = act(action, state)
✅

Use agents when the task genuinely benefits from iterative tool use or multi-step decisions.

Practice — 3 cases

Practice 1 / Práctica 1
Which principle best matches What Makes an Agent an Agent??
Practice 2 / Práctica 2
Which behavior is the clearest anti-pattern for What Makes an Agent an Agent??
Practice 3 / Práctica 3
What should a production team check for What Makes an Agent an Agent??
MODULE 02
🔧

Tools as Controlled Capabilities

Tools let agents read data, call APIs, search, calculate or create side effects. Their contracts should be explicit and narrow.

👁️
See it this way

The tool boundary is where model suggestions become real system actions.

Core ideas

  • Use clear tool names and descriptions
  • Validate arguments before execution
  • Scope permissions to the task
Production sketch
tool = {'name':'get_order','args_schema':OrderQuery}
✅

Treat tool calls as structured API requests that require validation.

Practice — 3 cases

Practice 4 / Práctica 4
Which principle best matches Tools as Controlled Capabilities?
Practice 5 / Práctica 5
Which behavior is the clearest anti-pattern for Tools as Controlled Capabilities?
Practice 6 / Práctica 6
What should a production team check for Tools as Controlled Capabilities?
MODULE 03
🔁

The Agent Loop: Observe, Decide, Act

Agents repeatedly inspect the current state, choose the next step, execute it and incorporate the result.

👁️
See it this way

Reliability comes from a disciplined loop with explicit stop conditions, not endless reasoning.

Core ideas

  • Observe current state
  • Choose one bounded next action
  • Update state from tool result
  • Stop when goal or limit is reached
Production sketch
for step in range(MAX_STEPS):
  action = policy(state)
  if action == 'done': break
✅

Every agent needs step, time or cost limits plus a clear stop condition.

Practice — 3 cases

Practice 7 / Práctica 7
Which principle best matches The Agent Loop: Observe, Decide, Act?
Practice 8 / Práctica 8
Which behavior is the clearest anti-pattern for The Agent Loop: Observe, Decide, Act?
Practice 9 / Práctica 9
What should a production team check for The Agent Loop: Observe, Decide, Act?
MODULE 04
📦

State and Memory

Agents need working state: current goal, completed steps, tool results, constraints and sometimes durable memory.

👁️
See it this way

Not every past message belongs in active state; keep only what the next decision needs.

Core ideas

  • Separate working state from long-term memory
  • Store structured facts when possible
  • Expire or summarize stale context
Production sketch
state = {'goal':goal,'facts':{},'completed':[]}
✅

State should be explicit, minimal and inspectable enough to debug decisions.

Practice — 3 cases

Practice 10 / Práctica 10
Which principle best matches State and Memory?
Practice 11 / Práctica 11
Which behavior is the clearest anti-pattern for State and Memory?
Practice 12 / Práctica 12
What should a production team check for State and Memory?
MODULE 05
📐

Tool Schemas and Reliable Interfaces

Agents perform better when tools expose precise inputs, outputs, allowed values and errors.

👁️
See it this way

Ambiguous tools create ambiguous actions.

Core ideas

  • Use typed parameters
  • Return structured results
  • Expose predictable errors
Production sketch
def schedule(date:str, attendee_id:str)->Result: ...
✅

A well-designed tool looks like a reliable API contract, not free-form text.

Practice — 3 cases

Practice 13 / Práctica 13
Which principle best matches Tool Schemas and Reliable Interfaces?
Practice 14 / Práctica 14
Which behavior is the clearest anti-pattern for Tool Schemas and Reliable Interfaces?
Practice 15 / Práctica 15
What should a production team check for Tool Schemas and Reliable Interfaces?
MODULE 06
🧯

Failure Recovery and Retries

Tools can timeout, return partial data or reject requests. Agents need bounded retries, fallback paths and escalation rules.

👁️
See it this way

Retrying the same failing action forever is not recovery.

Core ideas

  • Classify transient vs permanent errors
  • Limit retries with backoff
  • Escalate unresolved failures
Production sketch
for attempt in range(3):
  try: return tool()
  except Timeout: backoff()
✅

Recovery policy should be explicit and observable.

Practice — 3 cases

Practice 16 / Práctica 16
Which principle best matches Failure Recovery and Retries?
Practice 17 / Práctica 17
Which behavior is the clearest anti-pattern for Failure Recovery and Retries?
Practice 18 / Práctica 18
What should a production team check for Failure Recovery and Retries?
MODULE 07
👤

Human-in-the-Loop Agents

Agents should pause for confirmation when actions are expensive, irreversible, sensitive or uncertain.

👁️
See it this way

The best approval point is before the side effect.

Core ideas

  • Preview the intended action
  • Require authorized approval
  • Resume with an auditable decision
Production sketch
proposal = agent.propose()
approve(proposal)
execute(proposal)
✅

Human approval is a control boundary, not an after-the-fact notification.

Practice — 3 cases

Practice 19 / Práctica 19
Which principle best matches Human-in-the-Loop Agents?
Practice 20 / Práctica 20
Which behavior is the clearest anti-pattern for Human-in-the-Loop Agents?
Practice 21 / Práctica 21
What should a production team check for Human-in-the-Loop Agents?
MODULE 08
🏭

Production Agent Operations

Production agents need traces, tool-call logs, budgets, evals, guardrails and clear ownership.

👁️
See it this way

If you cannot reconstruct why an agent acted, you cannot operate it safely.

Core ideas

  • Trace each decision and tool call
  • Measure task success and failure recovery
  • Enforce budgets and permissions
Production sketch
trace(step, tool, args, result, latency)
assert cost < budget
✅

Operate agents like production systems, not autonomous black boxes.

Practice — 3 cases

Practice 22 / Práctica 22
Which principle best matches Production Agent Operations?
Practice 23 / Práctica 23
Which behavior is the clearest anti-pattern for Production Agent Operations?
Practice 24 / Práctica 24
What should a production team check for Production Agent Operations?
5-Question Knowledge Check

Can you design a bounded production agent?

Open each item after answering it in your own words.

1. What is the key lesson of What Makes an Agent an Agent??

An agent is a bounded action loop, not merely a conversational tone.

2. What is the key lesson of Tools as Controlled Capabilities?

Use explicit schemas and least privilege for agent tools.

3. What is the key lesson of The Agent Loop: Observe, Decide, Act?

Use bounded loops with explicit stopping criteria.

4. What is the key lesson of State and Memory?

Keep agent state structured and limited to what drives decisions.

5. What is the key lesson of Tool Schemas and Reliable Interfaces?

Define narrow typed tool contracts and structured results.

Agent Blueprint

A reusable production pattern

LayerPurpose
What Makes an Agent an Agent?An agent is a bounded action loop, not merely a conversational tone.
Tools as Controlled CapabilitiesUse explicit schemas and least privilege for agent tools.
The Agent Loop: Observe, Decide, ActUse bounded loops with explicit stopping criteria.
State and MemoryKeep agent state structured and limited to what drives decisions.
Tool Schemas and Reliable InterfacesDefine narrow typed tool contracts and structured results.
Failure Recovery and RetriesUse bounded retries and distinct fallback or escalation behavior.
Human-in-the-Loop AgentsPause high-impact actions before execution and require approval.
Production Agent OperationsTrace, evaluate and bound agent behavior in production.

Certificate of Participation

Complete at least 12 of the 24 practice cases (50%) and enter your name.

0 / 24 • 0%
Production note

Agentic systems can create side effects. Constrain tools, permissions, budgets and stopping conditions, and evaluate task success plus failure recovery.