Saltar al contenido

El contenido principal de esta página está en inglés.Traducir esta página

IA y temas en tendencia

AI Agents roadmap

AI agents are models in a loop that can call tools, observe results and decide what to do next. Learn the agent loop from scratch, add tools, memory and guardrails, evaluate agents properly, and build multi-agent systems only when they help.

Tiempo
⏱ 3–4 weeks
Level
Intermediate
Steps
6 steps
Architecture ↓Cheat sheet ↓7 interview Q&As ↓
Compartir

The roadmap

Click a step to open the full guide.

Best architecture: a production AI agent

An agent loop wrapped in guardrails, memory and observability.

Agent architecture

  1. Task intake (UI / API / schedule)
  2. Agent loop: plan → act → observe
  3. Tools (MCP) · retrieval · code sandbox
  4. Policy & approval layer
  5. Memory / state store
  6. Tracing · evals · budgets

Why it's built this way

  • The policy layer sits between the agent and any tool with side effects.
  • State is saved so tasks can pause for approval and resume.
  • Budgets (steps, tokens, money) are enforced outside the model.
  • Traces of every step feed debugging and evals.

AI Agents cheat sheet

The essentials on one screen. Bookmark it for revision.

Agent anatomy

ModelThe 'brain' that decides the next step
InstructionsGoal, rules, when to stop, output format
ToolsFunctions it can call (via API or MCP)
Loopthink → act → observe → repeat
MemoryContext + summaries + long-term store
GuardrailsLimits, approvals, validation, logs

Design rules

Start simpleWorkflow first; agent only where needed
Few good herramientasOne job each, clear descriptions
Hard limitsSteps, time, tokens, money
Approve writesHuman yes for send/pay/delete
Trace everythingDebug from the first wrong step
EvaluateTask suite with success rate

Improve performance

  • Use a smaller, faster model para simple routing or extraction steps and a strong model for planning.
  • Run independent tool calls in parallel when the model requests several at once.
  • Keep tool outputs short and summarise long histories to control context size.
  • Cache tool results (e.g. the same search) within a task.
  • Stop early: tell the agent exactly what 'done' looks like.

Security checklist

  • Least-privilege tools: read-only by default, scoped credentials per user.
  • Human approval for any action with real-world effects.
  • Treat all external content as untrusted (indirect prompt injection).
  • Run agent-written code only in an isolated sandbox with no secrets.
  • Budgets and step limits on every task, plus a manual kill switch.
  • Log full traces for auditing and incident review.

Most important interview questions

Click a question to see a strong answer. Each step also has its own questions.

1¿Qué es an AI agent?

A system where an LLM runs in a loop with tools: it decides which action to take, observes the result and continues until the goal is complete.

2What are the core components of an agent?

A model, instructions, tools, a control loop, memory/state, and guardrails (limits, approvals, validation, logging).

3¿Qué es the ReAct pattern?

Interleaving reasoning and acting: the model thinks about what to do, takes an action with a tool, observes the result, and repeats.

4Why do agents fail, and how do you fix it?

Common causes: unclear goals, poorly described tools, too much context, missing stop conditions, and tool errors. Fix by tightening instructions, improving tool descriptions, summarising context and evaluating on a task suite.

5How do agents use MCP?

The agent's host connects to MCP servers, discovers their tools and offers them to the model, so the agent can use many external tools without custom integrations.

6How do you control the cost of an agent?

Step and token budgets, smaller models for simple steps, short tool outputs, caching, parallel calls, and clear stop conditions.

7Agent frameworks: when to use one?

After you understand the basic loop. Frameworks help with tracing, memory, retries and multi-agent orchestration, but add abstraction; keep the core logic simple and testable.

Related rutas

1

AI Agents · Step 1 of 6 · 1 day

What an agent is

Model + tools + loop + goal.

A chatbot answers. A workflow runs fixed steps you designed. An agent decides its own next step: it calls a tool, reads the result, and repeats until the goal is done.

Use agents when the steps depend on what is found along the way. If the steps are always the same, a workflow is cheaper and more reliable.

What you'll learn

  • Chatbot vs workflow vs agent
  • The plan → act → observe loop
  • When agents help and when they don't
  • Autonomy levels

Chatbot vs workflow vs agent

Chatbot

  • One question, one answer
  • No herramientas
  • Example: FAQ bot

Workflow

  • Fixed steps you coded
  • Predictable
  • Example: summarise every new ticket

Agent

  • Chooses its own steps
  • Uses tools in a loop
  • Example: research and write a report

Key concepts

Workflow
Steps you designed in a fixed order. Predictable and cheap.
Agent
The model decides the next step based on results so far.
Autonomy level
How much the agent may do without asking a human.

Step by step

  1. 1.1

    Compare three designs

    Chatbot (answers), workflow (fixed steps), agent (chooses steps).

  2. 1.2

    Pick a real task

    Choose something where the next step depends on what you find.

  3. 1.3

    Decide the autonomy level

    Suggest only, act with approval, or act alone within limits.

Notes

  • Start with a workflow; upgrade to an agent only where flexibility is needed.

Tips & tricks

  • Write the task as a checklist a new employee could follow; that shapes your tools.

Interview questions

What makes a system 'agentic'?

The model controls the flow: it chooses actions, observes results and decides what to do next until a goal is met, instead of following a fixed script.

Give an example where a workflow beats an agent.

Generating a daily sales summary: the steps never change (query → summarise → email), so a fixed workflow is cheaper, faster and more reliable.

The quick way to study this

Remember: agent = LLM deciding the next action in a loop with tools.

2

AI Agents · Step 2 of 6 · 3 days

Build the agent loop from scratch

Understand every moving part.

Most model APIs support tool calling: you describe tools, the model replies with a tool call, you run it and send back the result, and the model continues. Wrap that in a loop with a maximum number of steps.

Writing this yourself once makes every agent framework easy to understand and debug.

What you'll learn

  • Tool definitions (name, description, schema)
  • Sending tools to the model
  • Executing tool calls
  • Feeding results back
  • Stopping conditions
  • Step and cost limits

Think → act → observe

  1. Model reads goal + history
  2. Chooses a tool
  3. Your code runs it
  4. Result added to history

Repeats as a loop

Key concepts

Tool call
A structured request from the model: tool name + arguments.
Tool result
What your code returns, sent back so the model can continue.
Step limit
A maximum number of loop iterations to prevent runaway cost.

Step by step

  1. 2.1

    Describe herramientas

    Name, description and JSON schema for each tool's inputs.

  2. 2.2

    Call the model with herramientas

    Send messages plus the tool list.

  3. 2.3

    Execute requested herramientas

    Validate arguments, run the function, capture the result or error.

  4. 2.4

    Loop with limits

    Append results, call the model again; stop on final answer or limit.

# The agent loop (pseudo-code; adapt to your provider's tool-calling API)
messages = [system("You are a helpful agent."), user(task)]
for step in range(8):                      # hard step limit
    reply = llm(messages, tools=TOOLS)
    messages.append(reply)
    if not reply.tool_calls:               # model is done
        print(reply.text); break
    for call in reply.tool_calls:
        result = run_tool(call.name, call.arguments)  # validate inputs!
        messages.append(tool_result(call.id, result))
else:
    print("Stopped: step limit reached")

Notes

  • Always cap the number of steps and total tokens.

Tips & tricks

  • Log the model's tool choice and arguments at every step.

Interview questions

Walk me through how tool calling works.

You send the model the conversation and tool schemas. It replies with a tool call (name + arguments). Your code validates and executes it and sends the result back. The model continues until it returns a final answer.

How do you handle a tool error inside the loop?

Catch it and return a short, clear error message as the tool result so the model can retry with different arguments or choose another approach, while counting it toward the step limit.

The quick way to study this

Implement the loop below with a calculator and a search tool.

Practice project

A research agent that searches the web and writes a cited summary.

3

AI Agents · Step 3 of 6 · 3 days

Tools, MCP and RAG

Give agents the right abilities.

Agents are only as good as their tools. Good tools do one clear thing, have descriptive names and return concise, structured results.

Use MCP to plug in existing tools and RAG to give agents access to your documents.

What you'll learn

  • Designing good herramientas
  • Tool descriptions the model understands
  • Connecting MCP servers
  • Retrieval as a tool
  • Code execution sandboxes

An agent's toolbox

Agent
  • Web search
  • Document search (RAG)
  • Calculator / code sandbox
  • Database (read-only)
  • Calendar (via MCP)
  • Draft email (needs approval)

Key concepts

Good tool
One job, clear name, example in the description, simple inputs, concise output.
Sandbox
An isolated environment for running code the agent writes, so it can't harm your system.

Step by step

  1. 3.1

    Design tools from the task

    Write the task as a checklist; each action becomes a tool.

  2. 3.2

    Keep outputs small

    Return only the fields the model needs, in structured form.

  3. 3.3

    Plug in MCP servers

    Reuse existing tools instead of writing integrations.

  4. 3.4

    Add retrieval

    Give the agent a search tool over your documents.

Notes

  • Return short, relevant results; long tool outputs confuse models and cost tokens.

Tips & tricks

  • Include examples of good arguments in tool descriptions.

Interview questions

How many tools should an agent have?

As few as needed. Many overlapping tools confuse the model. If you need many, group them by task or use sub-agents with smaller toolsets.

The quick way to study this

Connect one MCP server and one retrieval tool to your agent.

4

AI Agents · Step 4 of 6 · 3 days

Memory, planning and state

Handle longer, multi-step tasks.

Long tasks overflow the context window. Agents need a plan (a written to-do list they update), a way to summarise old steps and sometimes long-term memory stored in a database.

Save agent state so tasks can resume after errors or human approval.

What you'll learn

  • Short-term memory (conversation)
  • Long-term memory (stored facts)
  • Planning and to-do lists
  • Summarising long histories
  • Resuming tasks

Agent memory

  1. Current goal and plan
  2. Recent steps (full detail)
  3. Summary of older steps
  4. Long-term memory store

Key concepts

Short-term memory
The current conversation and tool results in the context window.
Long-term memory
Facts saved outside the model (database) and retrieved later.
Checkpoint
Saved agent state you can resume from.

Step by step

  1. 4.1

    Add a plan

    Ask the agent to write a to-do list first and update it each step.

  2. 4.2

    Summarise history

    Compress older steps when the context gets long.

  3. 4.3

    Add long-term memory

    Store useful facts in a database and retrieve them when relevant.

  4. 4.4

    Save state

    Persist progress so tasks resume after errors or approvals.

Notes

  • Explicit plans make agents more reliable and easier to debug.

Tips & tricks

  • Ask the agent to write and update a checklist as it works.

Interview questions

How do you give an agent memory across sessions?

Extract important facts or preferences, store them in a database (often with embeddings), and retrieve the relevant ones into the prompt at the start of new sessions.

The quick way to study this

Add a planning step and a summary of past steps to your agent.

5

AI Agents · Step 5 of 6 · 2 days

Guardrails and human-in-the-loop

Keep agents safe and accountable.

Give agents the least power they need. Read-only tools can run freely; actions that send messages, spend money or delete data need human approval.

Treat web pages, emails and documents as untrusted: they may contain instructions designed to hijack your agent.

What you'll learn

  • Permission levels for herramientas
  • Approval for risky actions
  • Prompt injection defences
  • Budget and time limits
  • Audit logs

A guarded action

  1. Agent proposes action
  2. Policy check
  3. Human approves
  4. Execute
  5. Log & report

Key concepts

Approval gate
The agent waits for a human yes before continuing.
Indirect prompt injection
Malicious instructions hidden in pages or files the agent reads.
Blast radius
How much damage a mistake could cause. Keep it small.

Step by step

  1. 5.1

    Classify tools by risk

    Read-only vs write vs irreversible (payments, deletions).

  2. 5.2

    Add approval gates

    Pause and show the user exactly what will happen before risky actions.

  3. 5.3

    Set budgets

    Limits on steps, time, tokens and money per task.

  4. 5.4

    Defend against injection

    Mark external content as data and never follow instructions inside it.

Notes

  • Separate 'read' tools from 'write' tools and protect the write ones.

Tips & tricks

  • Show users a clear summary of what the agent will do before approval.

Interview questions

How do you make an agent safe to deploy?

Least-privilege tools, approval for write actions, budgets and step limits, input/output validation, isolation for code execution, full audit logs, and a kill switch.

The quick way to study this

Add an approval step before any action that changes something outside your app.

6

AI Agents · Step 6 of 6 · 4 days

Evaluation and multi-agent systems

Measure success, then scale up carefully.

Evaluate agents on a set of realistic tasks: did they succeed, how many steps, how much did it cost? Review full traces of failures to find which tool or instruction caused them.

Multi-agent systems (an orchestrator delegating to specialist agents) help for broad, parallel tasks such as research, but add cost and complexity. Use them only when one agent clearly struggles.

What you'll learn

  • Task success rate
  • Trajectory review
  • Cost and latency per task
  • Orchestrator–worker patterns
  • Agent frameworks
  • When multiple agents help

Multi-agent (orchestrator–worker)

Orchestrator
  • Researcher A
  • Researcher B
  • Data analyst
  • Writer
  • Reviewer

Key concepts

Task success rate
The share of test tasks the agent completes correctly.
Trace
The full record of an agent run, used for debugging.
Orchestrator–worker
One agent splits work and delegates to specialist agents.

Step by step

  1. 6.1

    Build a task suite

    15–30 realistic tasks with clear pass/fail criteria.

  2. 6.2

    Record traces

    Save every step: reasoning, tool calls, results, tokens, time.

  3. 6.3

    Analyse failures

    Find the first wrong step; fix the tool, description or prompt.

  4. 6.4

    Try multi-agent only if needed

    Use an orchestrator + specialists for broad, parallel work.

Notes

  • Most production agents are a single agent with good tools.

Tips & tricks

  • Try a framework after building from scratch; you will understand what it does for you.

Interview questions

How do you evaluate an AI agent?

Run a fixed suite of realistic tasks, measure success rate, steps, cost and time, review traces of failures, and re-run after every change.

When are multi-agent systems worth it?

For broad tasks that split into independent parts (e.g. researching many sources in parallel). They cost more tokens and are harder to debug, so start with one agent.

The quick way to study this

Create 15 test tasks and track success rate as you change prompts and tools.

Comparte esta página